diff --git a/code/third_party/vMaterials_2/Concrete/Concrete_Floor_Damage.mdl b/code/third_party/vMaterials_2/Concrete/Concrete_Floor_Damage.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e4fe28ea8022f15c84eee5f71eea79459a0d40dd --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Concrete_Floor_Damage.mdl @@ -0,0 +1,533 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A stone concrete material"; + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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); +} + +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); +} + + + +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); +} + ::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)); +} + +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); +} + +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; + + 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, .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 + )); +} +::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)); +} +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); +} + + +export material Concrete_Floor_Damage( + 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") + ]], + color stone_color = color(1.f, 0.928306997f, 0.848088026f) [[ + ::anno::description("."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 1.f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_weight = 0.9f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform 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) + ]], + 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(1.f, 1.f)), + ::anno::in_group("Transform") + ]], + 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 in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Dry Concrete"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "dry", "damage", "concrete")), + ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Concrete_Floor_Damage.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.229999989f, ::math::lerp(0.790000021f, 0.620000005f, reflection_weight)), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, reflection_roughness) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, reflection_roughness), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, reflection_roughness) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, reflection_roughness), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.498039007f, 0.466666996f, 0.431373f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, stone_color, ::base::color_layer_overlay, 1.f).tint, color(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_overlay, -0.199999988f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_floor_damage_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.501960993f, 0.498039007f, 0.882353008f), 11.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_floor_damage_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_floor_damage_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.501960993f, 0.498039007f, 0.882353008f), 11.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_floor_damage_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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, 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, + geometry: tmp5); + +export material Defined_Reflections_Damaged_Concrete(*) +[[ + ::anno::display_name("Defined Reflections Damaged Concrete"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "dry", "damage", "concrete")), + ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Defined_Reflections_Damaged_Concrete.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Concrete_Floor_Damage +( + infinite_tiling: true, + stone_color: color(0.957370f, 0.932277f, 0.851252f), + reflection_roughness: 0.f, + reflection_weight: 1.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: true, + uv_space_index: 0 +); + +export material Shiny_Damaged_Concrete(*) +[[ + ::anno::display_name("Shiny Damaged Concrete"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "shiny", "damage", "concrete")), + ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Shiny_Damaged_Concrete.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Concrete_Floor_Damage +( + infinite_tiling: true, + stone_color: color(0.957370f, 0.932277f, 0.851252f), + reflection_roughness: 0.2f, + reflection_weight: 0.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: true, + uv_space_index: 0 +); + +export material Soft_Reflections_Damaged_Concrete(*) +[[ + ::anno::display_name("Soft Reflections Damaged Concrete"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "soft", "damage", "concrete")), + ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Soft_Reflections_Damaged_Concrete.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Concrete_Floor_Damage +( + infinite_tiling: true, + stone_color: color(0.957370f, 0.932277f, 0.851252f), + reflection_roughness: 0.65f, + reflection_weight: 0.75f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: true, + uv_space_index: 0 +); + +export material Matt_Damaged_Concrete(*) +[[ + ::anno::display_name("Matt Damaged Concrete"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "soft", "damage", "concrete")), + ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Matt_Damaged_Concrete.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Concrete_Floor_Damage +( + infinite_tiling: true, + stone_color: color(0.957370f, 0.932277f, 0.851252f), + reflection_roughness: 1.f, + reflection_weight: 0.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: true, + uv_space_index: 0 +); + +export material Dark_Damaged_Concrete(*) +[[ + ::anno::display_name("Dark Damaged Concrete"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "dark", "damage", "concrete")), + ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Dark_Damaged_Concrete.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Concrete_Floor_Damage +( + infinite_tiling: true, + stone_color: color(0.157281f, 0.157281f, 0.157281f), + reflection_roughness: .6f, + reflection_weight: 0.f, + bump_strength: 0.35f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: true, + uv_space_index: 0 +); + +export material Dark_Rough_Concrete(*) +[[ + ::anno::display_name("Dark Rough Concrete"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "dark", "damage", "concrete")), + ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Dark_Rough_Concrete.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Concrete_Floor_Damage +( + infinite_tiling: true, + stone_color: color(0.157281f, 0.157281f, 0.157281f), + reflection_roughness: 1.f, + reflection_weight: 1.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: true, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/Concrete_Formed.mdl b/code/third_party/vMaterials_2/Concrete/Concrete_Formed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c3af5157a0e9c08a165d3304184e7635374519f6 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Concrete_Formed.mdl @@ -0,0 +1,255 @@ +/****************************************************************************** + * 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"; + + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +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 histogram_scan_small(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(0.0, 1.0 - width, position), + ::math::lerp(width, 1.0 , position)), + 0.0, + 1.0); +} + +::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 Concrete_Formed( + float diffuse_brightness = 0.82f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Diffuse Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.06f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float 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) + ]], + 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.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.4f, 1.4f)) + ]], + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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::description("A formed concrete material with wooden texture imprint."), + ::anno::in_group("Concrete"), + ::anno::display_name("Formed Concrete Shiny"), + ::anno::key_words(string[]("concrete", "architecture", "hard", "solid", "artificial", "interior", "exterior", "construction", "wood", "pattern", "neutral", "gray")), + ::anno::thumbnail("./.thumbs/Concrete_Formed.Concrete_Formed.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_small(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint)[0], 0.660000026f, 0.649999976f), 2.20000005f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint)[1], math::lerp(0.660000026f, 1.f, roughness), math::lerp(0.5f, 0.800000012f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint)[1], math::lerp(0.660000026f, 1.f, roughness), math::lerp(0.5f, 0.800000012f, roughness)), histogram_range(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint)[1], math::lerp(0.660000026f, 1.f, roughness), math::lerp(0.5f, 0.800000012f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint)[1], math::lerp(0.660000026f, 1.f, roughness), math::lerp(0.5f, 0.800000012f, roughness)), color(1.f, 1.f, 1.f), state::texture_tangent_u(0), df::scatter_reflect), df::weighted_layer(1.f, df::diffuse_reflection_bsdf(base::file_texture(texture_2d("./textures/conrete_formed_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(math::lerp(0.641000032f, 1.f, diffuse_brightness)), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint, 0.f), bsdf(), base::tangent_space_normal_texture(texture_2d("./textures/conrete_formed_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f)), base::tangent_space_normal_texture(texture_2d("./textures/conrete_formed_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? state::rounded_corner_normal(radius * 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 Concrete_Formed_Rough(*) +[[ + ::anno::description("A formed concrete material with wooden texture imprint."), + ::anno::in_group("Concrete"), + ::anno::display_name("Formed Concrete Rough"), + ::anno::key_words(string[]("concrete", "architecture", "hard", "solid", "artificial", "interior", "exterior", "construction", "wood", "pattern", "neutral", "gray")), + ::anno::thumbnail("./.thumbs/Concrete_Formed.Concrete_Formed_Rough.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = Concrete_Formed( + diffuse_brightness: 0.55f, + roughness: 0.8f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 + +); + + + + + + diff --git a/code/third_party/vMaterials_2/Concrete/Concrete_Polished.mdl b/code/third_party/vMaterials_2/Concrete/Concrete_Polished.mdl new file mode 100644 index 0000000000000000000000000000000000000000..27e1888d56b4bba27ac6739ec40708bdc5c5bbce --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Concrete_Polished.mdl @@ -0,0 +1,416 @@ +/****************************************************************************** + * 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 fine polished concrete material."; + +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 +) +{ + 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); +} + + 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 remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_small(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(0.0, 1.0 - width, position), + ::math::lerp(width, 1.0 , position)), + 0.0, + 1.0); +} + +float histogram_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 Concrete_Polished( + 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 diffuse_brightness = 1.f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Diffuse Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_weight = 1.f [[ + ::anno::description("."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + 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) + ]], + float reflection_variation = 0.8f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Reflection Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + 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, 2.f) + ]], + 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.0f) [[ + ::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") + ]], + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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("Concrete Polished"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Polished.Concrete_Polished.png"), + ::anno::key_words(string[]("concrete", "polished", "smooth", "infinite", "tiling", "new", "artificial", "construction", "interior", "architecture", "gray")), + ::anno::in_group("Concrete"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.04f, 1.f, 5.f, ::math::pow(histogram_scan_small(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.0340000018f, 0.824000061f, reflection_weight), 1.f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], ::math::lerp(0.205000013f, 1.f, reflection_variation), ::math::lerp(0.465000033f, 0.852000058f, reflection_roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], ::math::lerp(0.205000013f, 1.f, reflection_variation), ::math::lerp(0.465000033f, 0.852000058f, reflection_roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], ::math::lerp(0.205000013f, 1.f, reflection_variation), ::math::lerp(0.465000033f, 0.852000058f, reflection_roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], ::math::lerp(0.205000013f, 1.f, reflection_variation), ::math::lerp(0.465000033f, 0.852000058f, reflection_roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.470587999f, 0.470587999f, 0.454901993f), 2.14100003f, true) : ::base::file_texture(texture_2d("./textures/conrete_polished_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.300000012f, 0.f, diffuse_brightness)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/conrete_polished_norm.jpg", ::tex::gamma_linear), bump_strength * 2.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.5f, 0.5f, 1.f), 2.14100003f) : ::base::tangent_space_normal_texture(texture_2d("./textures/conrete_polished_norm.jpg", ::tex::gamma_linear), bump_strength * 2.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/conrete_polished_norm.jpg", ::tex::gamma_linear), bump_strength * 2.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.5f, 0.5f, 1.f), 2.14100003f) : ::base::tangent_space_normal_texture(texture_2d("./textures/conrete_polished_norm.jpg", ::tex::gamma_linear), bump_strength * 2.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::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); + + +export material Concrete_Polished_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Polished Matte"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Polished.Concrete_Polished_Matte.png"), + ::anno::key_words(string[]("concrete", "polished", "infinite", "tiling", "new", "artificial", "construction", "interior", "architecture", "rough", "matte", "gray")), + ::anno::in_group("Concrete"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Polished +( + infinite_tiling: true, + diffuse_brightness: 1.0f, + reflection_weight: 1.0f, + reflection_roughness: 0.8f, + reflection_variation: 1.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + + texture_scale: float2(1.0f), + round_corners: false, + radius_mm: 1.5f, + across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/Concrete_Precast.mdl b/code/third_party/vMaterials_2/Concrete/Concrete_Precast.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2482dfb540bdb7435c208f157eb5011d13c7d477 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Concrete_Precast.mdl @@ -0,0 +1,1288 @@ +/****************************************************************************** + * 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 ::state::*; +import ::base::*; +import ::tex::*; +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"; + + +export material Concrete_Precast( + + color concrete_color = color ( 0.57f, 0.57f, 0.57f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.20f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.5f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = .5f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - White"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_gray.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "white", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color ( reflection_roughness ), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); + + + +export material concrete_precast_light_gray( + + color concrete_color = color ( 0.68f , 0.68f , 0.68f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.40f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.15f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - Light Gray"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_light_gray.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "gray", "light gray", "light", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color (reflection_roughness), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); + + +export material concrete_precast_ivory( + + color concrete_color = color ( 0.883f , 0.851f , 0.797f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.30f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.15f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - Ivory"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_ivory.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "white", "ivory", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color (reflection_roughness), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); + + + +export material concrete_precast_light_warm_gray( + + color concrete_color = color (0.932f , 0.859f , 0.797f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.55f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.15f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - Light Warm Gray"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_light_warm_gray.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "gray", "light gray", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color (reflection_roughness), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); + + + +export material concrete_precast_warm_gray( + + color concrete_color = color (0.932f , 0.859f , 0.797f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.55f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.15f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - Warm Gray"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_warm_gray.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "gray", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color (reflection_roughness), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); + + + + +export material concrete_precast_dark_gray( + + color concrete_color = color ( 0.53f , 0.505f , 0.494f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.5f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.15f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - Dark Gray"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_dark_gray.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "dark", "gray", "dark gray", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color (reflection_roughness), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); + + + +export material concrete_precast_dark_charcoal( + + color concrete_color = color ( 0.28f , 0.259f , 0.239f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.5f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.15f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - Charcoal"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_dark_charcoal.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "dark", "charcoal", "gray", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color (reflection_roughness), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); + + + +export material concrete_precast_walnut( + + color concrete_color = color ( 0.47f , 0.307f , 0.239f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.5f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.15f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - Walnut"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_walnut.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "walnut", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color (reflection_roughness), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); + + +export material concrete_precast_sienna( + + color concrete_color = color ( 0.517f , 0.453f , 0.344f ) + [[ + ::anno::display_name("Concrete Color"), + ::anno::description ( "Choose the color of the Concrete."), + ::anno::in_group("Appearance") + ]], + float grunge_amount = 0.5f + [[ + ::anno::display_name("Grunge Amount"), + ::anno::description("higher values results in more noise difference in the color of the concrete."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.15f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + 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("Rotate angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f , 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + uniform float ior = 1.5f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]]) + [[ + ::anno::display_name("Concrete Precast - Sienna"), + ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."), + ::anno::author("NVIDIA vMaterials"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_sienna.png"), + ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "sienna", "gray", "unfinished", "rough")) + ]]= + ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: concrete_color, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_overlay, + weight: 1.0f ).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: grunge_amount ).tint, + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: 1.0f, + reflection_roughness: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) , + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: color (reflection_roughness), + mode: ::base::color_layer_overlay, + weight: 1.0f ).mono, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: ior, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear), + scaling: 0.5f/ texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength * 0.20f, + texture_space: uv_space_index)); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/Concrete_Rough.mdl b/code/third_party/vMaterials_2/Concrete/Concrete_Rough.mdl new file mode 100644 index 0000000000000000000000000000000000000000..113953b3b09e83c5aaac59513a3891026a1db2d5 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Concrete_Rough.mdl @@ -0,0 +1,457 @@ +/****************************************************************************** + * 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"; + + + +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_small(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(0.0, 1.0 - width, position), + ::math::lerp(width, 1.0 , position)), + 0.0, + 1.0); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 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 Concrete_Rough( + 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 diffuse_brightness = 1.f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Diffuse Brightness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float roughness = 0.f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float reflectivity = 1.f [[ + ::anno::description("Higher values make the surface more reflective."), + ::anno::display_name("Reflectivity"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float moss_growth = 0.f [[ + ::anno::description("Grows a layer of moss on top of the material."), + ::anno::display_name("Moss Growth"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Strength"), + ::anno::hard_range(0.f, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float dirt = 0.f [[ + ::anno::description("The strength of the dirtlayer."), + ::anno::display_name("Dirt Strength"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.f, 0.f, 0.f) [[ + ::anno::description("Adjust the color of the dirt layer."), + ::anno::display_name("Dirt Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + 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("Rotation 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(1.0, 1.0)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::description("A rough concrete material with a dirt and moss layer."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Rough"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough.png"), + ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_small(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.0340000018f, 1.f, reflectivity), 1.f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))) * ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))), ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))) * ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.705882013f, 0.705882013f, 0.678430974f), 2.02700019f, true) : ::base::file_texture(texture_2d("./textures/concrete_rough_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.356000006f, 0.f, diffuse_brightness)).tint, nvidia::core_definitions::blend_colors(dirt_color, color(1.f, 1.f, 1.f), ::base::color_layer_blend, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f)).tint, ::base::color_layer_multiply, dirt * 0.699999988f).tint, ::base::file_texture(texture_2d("./textures/moss_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, ::base::color_layer_multiply, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))).tint, 0.f), bsdf(), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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, ::math::normalize(::math::lerp(infinite_tiling ? endless_normal(texture_2d("./textures/concrete_rough_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.5f, 0.5f, 1.f), 2.02700019f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_rough_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), normalmap_normal(texture_2d("./textures/moss_norm.jpg", ::tex::gamma_linear), 2.f, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))))); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +export material Concrete_Rough_Dirty(*) +[[ + ::anno::description("A rough concrete material with a dirt and moss layer."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Rough Dirty"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Dirty.png"), + ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = Concrete_Rough( + infinite_tiling: true, + diffuse_brightness: 1.0f, + roughness: 0.5f, + reflectivity: 1.0f, + moss_growth: 0.0f, + bump_strength: 1.0f, + dirt: 1.0f, + dirt_color: color(0.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Concrete_Rough_Mossy(*) +[[ + ::anno::description("A rough concrete material with a dirt and moss layer."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Rough Mossy"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Mossy.png"), + ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "decayed", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = Concrete_Rough( + infinite_tiling: true, + diffuse_brightness: 1.0f, + roughness: 0.5f, + reflectivity: 1.0f, + moss_growth: 0.5f, + bump_strength: 1.0f, + dirt: 0.0f, + dirt_color: color(0.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Concrete_Rough_Heavy_Decay(*) +[[ + ::anno::description("A rough concrete material with a dirt and moss layer."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Rough Heavy Decay"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Heavy_Decay.png"), + ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "decayed", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = Concrete_Rough( + infinite_tiling: true, + diffuse_brightness: 1.0f, + roughness: 0.75f, + reflectivity: 1.0f, + moss_growth: 0.80f, + bump_strength: 1.0f, + dirt: 0.0f, + dirt_color: color(0.0f), + 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/Concrete/Concrete_Wall_Aged.mdl b/code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged.mdl new file mode 100644 index 0000000000000000000000000000000000000000..67cb357c049921bb9da126c584200623260cf704 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged.mdl @@ -0,0 +1,436 @@ +/****************************************************************************** + * 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 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)); +} + + +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 Concrete_Wall_Aged( + 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 diffuse_brightness = 0.8f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Diffuse Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.45f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float 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, 3.f), + ::anno::soft_range(0.f, 1.f) + ]], + float grunge_weight = 0.0f [[ + ::anno::description("Adjusts the shininess of the grunge reflection. Vallues less than 0.5 make it shinier, value greater than 0.5 make it rougher. Set to 0.5 for neutral setting."), + ::anno::display_name("Grunge Amount"), + ::anno::in_group("Appearance", "Grunge"), + ::anno::hard_range(0.f, 1.f) + ]], + float grunge_roughness = 0.65f [[ + ::anno::description("Specifies the roughnes."), + ::anno::display_name("Grunge Roughness"), + ::anno::in_group("Appearance", "Grunge"), + ::anno::hard_range(0.f, 1.f) + ]], + color grunge_tint = color(0.0546f, 0.0478f, 0.0446f) [[ + ::anno::description("Tints the grunge layered upon the concrete."), + ::anno::display_name("Grunge Tint"), + ::anno::in_group("Appearance", "Grunge") + ]], + 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(1.0, 1.0)), + ::anno::in_group("Transform") + ]], + 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 in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::description("An old concrete wall."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Aged"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged.png"), + ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.576470971f, 0.560783982f, 0.517647028f), 5.44000006f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, grunge_tint, ::base::color_layer_multiply, float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] * grunge_weight).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.300000012f + 0.300000012f).tint, 0.f, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.5f, 0.5f, 1.f), 5.44000006f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.5f, 0.5f, 1.f), 5.44000006f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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 Concrete_Wall_Aged_Slight_Grunge(*) +[[ + ::anno::description("An old concrete wall."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Aged - Slight Grunge"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged_Slight_Grunge.png"), + ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Wall_Aged +( + infinite_tiling: false, + diffuse_brightness: 0.7f, + roughness: 0.33f, + bump_strength: 1.0f, + grunge_weight: 0.74f, + grunge_tint: color(0.0528f, 0.0399f, 0.0342f), + grunge_roughness: 0.81f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 2.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +export material Concrete_Wall_Aged_Rough_Black_Grunge(*) +[[ + ::anno::description("An old concrete wall."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Aged - Black Grunge"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged_Slight_Grunge.png"), + ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "grunge", "dirt", "dirty", "scratched", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Wall_Aged +( + infinite_tiling: false, + diffuse_brightness: 0.7f, + roughness: 0.67f, + bump_strength: 1.0f, + grunge_weight: 1.0f, + grunge_tint: color(0.009696f, 0.005522f, 0.000992f), + grunge_roughness: 0.19f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 2.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged_Scratched.mdl b/code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b3d1882e4ecbd3bb67a9dd327d0da8e1e20569ae --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged_Scratched.mdl @@ -0,0 +1,462 @@ +/****************************************************************************** + * 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 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)); +} + +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); +} + + + +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 Concrete_Wall_Aged_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 diffuse_brightness = 1.f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Diffuse Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 1.f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float grunge = 0.f [[ + ::anno::description("Adds a layer of grunge on top of the material."), + ::anno::display_name("Grunge"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 2.f), + ::anno::hard_range(0.f, 3.f) + ]], + 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(1.5, 1.5)), + ::anno::in_group("Transform") + ]], + 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 in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::description("A worn painted concrete wall that shows signs of damage."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Aged Scratched - Rough"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched.png"), + ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.649999976f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (1.f - float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.6f, float3(0.396f, 0.858f, 0.894f), 3.6f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (grunge * 0.299999982f), 1.f, roughness * 0.370000005f + 0.400000006f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (1.f - float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (grunge * 0.299999982f), 1.f, roughness * 0.370000005f + 0.400000006f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (1.f - float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (grunge * 0.299999982f), 1.f, roughness * 0.370000005f + 0.400000006f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (1.f - float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (grunge * 0.299999982f), 1.f, roughness * 0.370000005f + 0.400000006f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.596077979f, 0.568627f, 0.541176021f), 3.5999999f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f)), ::base::color_layer_multiply, grunge * 0.699999988f).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.300000012f + 0.300000012f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_aged_scratched_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.501960993f, 0.505882025f, 0.988234997f), 3.5999999f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_aged_scratched_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_aged_scratched_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.501960993f, 0.505882025f, 0.988234997f), 3.5999999f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_aged_scratched_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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: false, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Concrete_Wall_Aged_Scratched_Shiny(*) +[[ + ::anno::description("A worn painted concrete wall that shows signs of damage."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Aged Scratched - Shiny"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Shiny.png"), + ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Wall_Aged_Scratched +( + infinite_tiling: true, + diffuse_brightness: 1.0f, + roughness: 0.03f, + grunge: 0.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.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +export material Concrete_Wall_Aged_Scratched_Medium_Grime(*) +[[ + ::anno::description("A worn painted concrete wall that shows signs of damage."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Aged Scratched - Medium Grime"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Medium_Grime.png"), + ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Wall_Aged_Scratched +( + infinite_tiling: true, + diffuse_brightness: 1.0f, + roughness: 0.8f, + grunge: 0.52f, + 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.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +export material Concrete_Wall_Aged_Scratched_Heavy_Grime(*) +[[ + ::anno::description("A worn painted concrete wall that shows signs of damage."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Aged Scratched - Heavy Grime"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Heavy_Grime.png"), + ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "dirty", "worn", "scratched", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Wall_Aged_Scratched +( + infinite_tiling: true, + diffuse_brightness: .56f, + roughness: 0.71f, + grunge: 0.85f, + 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.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/Concrete_Wall_Even.mdl b/code/third_party/vMaterials_2/Concrete/Concrete_Wall_Even.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f6ec78b2da52fa59dfcf9a52d2ea5e7bb1499d9e --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Concrete_Wall_Even.mdl @@ -0,0 +1,449 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA’s Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float remap(float input, float low_1, float high_1, float low_2, float high_2) +{ + return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1); +} + +float histogram_scan(float input, float width, float position) +{ + float low = ::math::clamp(1.0f - position * 2.0, 0.0f ,1.0f); + float high = ::math::clamp(position > 0.5f ? 1.0 : 2.0f - 2 * position, 0.0f, 1.0f); + //float center = (low + high)/2.0f); + float offset = ((high - low) / 2.0) * width; + low += offset; + high -= offset; + return ::math::clamp( + remap(input, + low, + high, + 0.0, + 1.0), + 0.0, + 1.0); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + + +export material Concrete_Wall_Even( + 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") + ]], + color diffuse_tint = color(0.737205f) [[ + ::anno::description("Choose the color of the concrete wall."), + ::anno::display_name("Diffuse Tint"), + ::anno::in_group("Appearance") + ]], + float diffuse_brightness = 0.65f [[ + ::anno::description("Adjusts the lightness of the diffuse color."), + ::anno::display_name("Diffuse Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.62f [[ + ::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 dirt_layer_weight = 0.0f [[ + ::anno::description("Weight of the dirt layer."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + color dirt_layer_color = color(0.6f, 0.6f, 0.6f) [[ + ::anno::description("Set the color of the dirt layer."), + ::anno::display_name("Dirt Layer Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + 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.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(1.5, 1.5)), + ::anno::in_group("Transform") + ]], + 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 in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + 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::description("A flat concrete wall."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Even - Rough"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Even.Concrete_Wall_Even.png"), + ::anno::key_words(string[]("concrete", "wall", "outdoor", "indoor", "even", "new", "construction", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, histogram_scan(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.919999957f, 0.109999999f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] * dirt_layer_weight * 0.50999999f, 1.f, roughness * 0.25f + 0.649999976f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] * dirt_layer_weight * 0.50999999f, 1.f, roughness * 0.25f + 0.649999976f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] * dirt_layer_weight * 0.50999999f, 1.f, roughness * 0.25f + 0.649999976f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] * dirt_layer_weight * 0.50999999f, 1.f, roughness * 0.25f + 0.649999976f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.55686301f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, diffuse_tint, ::base::color_layer_overlay, 1.f).tint, dirt_layer_color, ::base::color_layer_multiply, float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] * dirt_layer_weight).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.400000006f + 0.400000006f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_even_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.498039007f, 0.498039007f, 0.996078014f), 10.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_even_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_even_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.498039007f, 0.498039007f, 0.996078014f), 10.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_even_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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 Concrete_Wall_Even_New_Shiny(*) +[[ + ::anno::description("A flat concrete wall."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Even - Shiny"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_New_Shiny.png"), + ::anno::key_words(string[]("concrete", "wall", "outdoor", "indoor", "even", "new", "shiny", "construction", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Wall_Even +( + infinite_tiling: false, + diffuse_tint: color(0.6f, 0.6f, 0.6f), + diffuse_brightness: .65f, + roughness: .0f, + dirt_layer_weight: 0.0f, + dirt_layer_color: color(0.420508f, 0.378676f, 0.348865f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 2.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +export material Concrete_Wall_Even_Brownish_Dirty(*) +[[ + ::anno::description("A flat concrete wall with a brownish dirt layer on top."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Even - Dirty Brownish"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_Brownish_Dirty.png"), + ::anno::key_words(string[]("concrete", "wall", "outdoor", "indoor", "even", "dirt", "dirty", "grunge", "construction", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Wall_Even +( + infinite_tiling: false, + diffuse_tint: color(0.701170f, 0.645555f, 0.566810f), + diffuse_brightness: .65f, + roughness: .65f, + dirt_layer_weight: 1.0f, + dirt_layer_color: color(0.399293f, 0.358654f, 0.280124f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 2.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +export material Concrete_Wall_Even_Greenish_Dirty(*) +[[ + ::anno::description("A flat concrete wall."), + ::anno::in_group("Concrete"), + ::anno::display_name("Concrete Wall Even - Dirty Greenish"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_Greenish_Dirty.png"), + ::anno::key_words(string[]("concrete", "wall", "outdoor", "indoor", "even", "dirt", "dirty", "grunge", "construction", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Concrete_Wall_Even +( + infinite_tiling: false, + diffuse_tint: color(0.673049f, 0.701170f, 0.666117f), + diffuse_brightness: .65f, + roughness: .65f, + dirt_layer_weight: 1.0f, + dirt_layer_color: color(0.219520f, 0.271577f, 0.193972f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 2.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/Mortar.mdl b/code/third_party/vMaterials_2/Concrete/Mortar.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4e282d0dae817e2bbd3dbccba6a057ccc3ff9a7b --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Mortar.mdl @@ -0,0 +1,626 @@ +/****************************************************************************** + * 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 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 1 + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization + */ + + // 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)); +} + +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); +} + +color remap(color input, color low, color high) +{ + return low + input * (high - low); +} + + + +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 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ ::anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 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; + + 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(); +} + + +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); +} + + + + +export material Mortar( + 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 mortar_tint = color(0.612066f) [[ + ::anno::description("Choose a color to overlay the mortar with. Set to neutral gray for original tone."), + ::anno::display_name("Mortar Tint"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + + float brightness_adjust = 0.f [[ + ::anno::description("Adjusts the final brightness of the grout."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + + float roughness = 0.71f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float diffuse_grain = 0.0f [[ + ::anno::description("Darkens the mortar and adds a grainy overlay."), + ::anno::display_name("Diffuse Grain"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.78f [[ + ::anno::description("Determines the degree of bumpiness."), + ::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(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(.15f, .15f)), + ::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("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 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) + ]] +) +[[ + ::anno::description("Mortar material to fill grouts with."), + ::anno::display_name("Mortar Gray"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Mortar.Mortar.png"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + bool tmp0 = false; + + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.129999995f, ::math::lerp(0.140000001f, 0.50999999f, roughness)), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.399999976f, 0.779999971f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.399999976f, 0.779999971f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.399999976f, 0.779999971f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.399999976f, 0.779999971f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(remap(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.517647028f, 0.517647028f, 0.513724983f), 4.f, true) : ::base::file_texture(texture_2d("./textures/mortar_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 2.20000005f)), ::base::color_layer_multiply, 0.449999988f).tint, color(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f)), ::base::color_layer_hardlight, diffuse_grain).tint, color(brightness_adjust * 0.300000012f), color(1.f, 1.f, 1.f)), mortar_tint, ::base::color_layer_overlay, 1.f).tint, 0.f, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/mortar_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.501960993f, 0.498039007f, 0.964706004f), 4.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/mortar_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/mortar_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.501960993f, 0.498039007f, 0.964706004f), 4.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/mortar_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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 Mortar_Moist(*) +[[ + ::anno::description("Mortar material to fill grouts with."), + ::anno::display_name("Mortar Moist Gray"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "moist", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Mortar.Mortar_Moist.png"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Mortar( + infinite_tiling: true, + mortar_tint: color(0.173439f), + brightness_adjust: 0.0f, + roughness: 0.0f, + diffuse_grain: 0.0f, + bump_strength: .78f, + 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.5, + roundcorners_across_materials: true +); + + +export material Mortar_White(*) +[[ + ::anno::description("Mortar material to fill grouts with."), + ::anno::display_name("Mortar White"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "light", "white")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Mortar.Mortar_White.png"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Mortar( + infinite_tiling: true, + mortar_tint: color(0.974300f), + brightness_adjust: 0.23f, + roughness: 0.83f, + diffuse_grain: 0.0f, + bump_strength: .78f, + 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.5, + roundcorners_across_materials: true +); + + + +export material Mortar_Antique_White(*) +[[ + ::anno::description("Mortar material to fill grouts with."), + ::anno::display_name("Mortar Antique White"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "light", "white")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Mortar.Mortar_Antique_White.png"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Mortar( + infinite_tiling: true, + mortar_tint: color(1.000000f, 0.940601f, 0.766744f), + brightness_adjust: 0.44f, + roughness: 0.83f, + diffuse_grain: 0.0f, + bump_strength: .78f, + 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.5, + roundcorners_across_materials: true +); + + +export material Mortar_Sand_White(*) +[[ + ::anno::description("Mortar material to fill grouts with."), + ::anno::display_name("Mortar Sand White"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "sand", "light", "white")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Mortar.Mortar_Sand_White.png"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Mortar( + infinite_tiling: true, + mortar_tint: color(1.000000f, 0.875138f, 0.673049f), + brightness_adjust: 0.18f, + roughness: 0.83f, + diffuse_grain: 0.0f, + bump_strength: .78f, + 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.5, + roundcorners_across_materials: true +); + + +export material Mortar_Yellow(*) +[[ + ::anno::description("Mortar material to fill grouts with."), + ::anno::display_name("Mortar Yellow"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "warm", "yellow")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Mortar.Mortar_Yellow.png"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Mortar( + infinite_tiling: true, + mortar_tint: color(1.000000f, 0.789314f, 0.470440f), + brightness_adjust: 0.22f, + roughness: 0.83f, + diffuse_grain: 0.0f, + bump_strength: .78f, + 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.5, + roundcorners_across_materials: true +); + + +export material Mortar_Clay(*) +[[ + ::anno::description("Mortar material to fill grouts with."), + ::anno::display_name("Mortar Clay"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "warm", "clay")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Mortar.Mortar_Clay.png"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Mortar( + infinite_tiling: true, + mortar_tint: color(0.941f, 0.53f, 0.41f), + brightness_adjust: 0.42f, + roughness: 0.83f, + diffuse_grain: 0.95f, + bump_strength: .78f, + 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.5, + roundcorners_across_materials: true +); + + +export material Mortar_Tan(*) +[[ + ::anno::description("Mortar material to fill grouts with."), + ::anno::display_name("Mortar Tan"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "brown", "tan")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Mortar.Mortar_Tan.png"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Mortar( + infinite_tiling: true, + mortar_tint: color(0.598942f, 0.470440f, 0.358654f), + brightness_adjust: 0.42f, + roughness: 0.83f, + diffuse_grain: 0.95f, + bump_strength: .78f, + 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.5, + roundcorners_across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered.mdl b/code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fdfe9ca5d07a8304e4e4b33cc56381ff9f7986d9 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered.mdl @@ -0,0 +1,467 @@ +/****************************************************************************** + * 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 spongy, slightly worn concrete 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 +) +{ + 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 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 uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + + +export material Spongy_Concrete_Weathered( + uniform bool infinite_tiling = true [[ + ::anno::display_name("Infinite Tiling"), + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns."), + ::anno::in_group("Appearance") + ]], + float roughness = 0.12f [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float concrete_brightness = 0.6f [[ + ::anno::display_name("Brightness"), + ::anno::description("Adjusts the lightness of the material."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float wetness = 0.0f [[ + ::anno::display_name("Wetness"), + ::anno::description("Adjusts the reflectivity of the water stains that flow down the material."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Wet Stains") + ]], + float water_darkening = 0.0 [[ + ::anno::display_name("Water Darkening"), + ::anno::description("Adjusts the brightness of the water stains that flow down the material."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Wet Stains") + ]], + float dirt_deposit_amount = 0.0 [[ + ::anno::display_name("Dirt Amount"), + ::anno::description("Adds a layer of dirt on top of the material."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Dirt Layer") + ]], + float dirt_brightness = 0.30f [[ + ::anno::display_name("Dirt Brightness"), + ::anno::description("Adjusts the lightness of the dirt layer."), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Dirt Layer") + ]], + float dirt_scale = 1.f [[ + ::anno::display_name("Dirt Scale"), + ::anno::description("Adjusts the size of the dirt layer texture."), + ::anno::in_group("Appearance", "Dirt Layer") + ]], + 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.0, 1.0)), + ::anno::in_group("Adjustments") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Weathered - Shiny"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "multimaterial", "gray")) +]] + = + let { + bool tmp0 = false; + float remap_dirt_deposit_amount = dirt_deposit_amount * 1.7; + + material_surface tmp1( + ::df::weighted_layer(histogram_range(float3(endless_texture(texture_2d("./textures/spongy_concrete_weathered_mask_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 4.f / dirt_scale, float3(0.629999995f), 8.f, true))[0], 0.980000019f, ::math::lerp(1.f, 0.672000051f, remap_dirt_deposit_amount)), ::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.197000012f, 0.699999988f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.295000017f, 0.873000026f, roughness), ::math::lerp(0.5f, 0.951000035f, roughness)) - wetness * ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.295000017f, 0.873000026f, roughness), ::math::lerp(0.5f, 0.951000035f, roughness)) - wetness * ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.295000017f, 0.873000026f, roughness), ::math::lerp(0.5f, 0.951000035f, roughness)) - wetness * ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.295000017f, 0.873000026f, roughness), ::math::lerp(0.5f, 0.951000035f, roughness)) - wetness * ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.722000003f, 0.713999987f, 0.709999979f), 8.f, true) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::lerp(0.349999994f, 0.899999976f, concrete_brightness) - ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono * ::math::lerp(0.f, 0.561000049f, water_darkening)), ::base::color_layer_multiply, 1.f).tint, 0.f, ""), ::state::normal()), ::df::diffuse_reflection_bsdf(dirt_brightness * color(0.31854701f, 0.275550991f, 0.252952009f), 0.f, ""), ::state::normal()), + 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/spongy_concrete_weathered_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : normalmap_normal(texture_2d("./textures/spongy_concrete_weathered_norm.jpg", ::tex::gamma_linear), 1.f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +// 2 +export material Spongy_Concrete_Weathered_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Weathered - Rough"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Rough.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "multimaterial", "gray")) +]] = Spongy_Concrete_Weathered ( + infinite_tiling: true, + roughness: 0.75f, + concrete_brightness: 0.6f, + wetness: 0.0f, + water_darkening: 0.0f, + dirt_deposit_amount: 0.0f, + dirt_brightness: 0.0f, + dirt_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 3 +export material Spongy_Concrete_Weathered_Dark_Dirt(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Weathered - Dark Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Dark_Dirt.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "multimaterial", "gray")) +]] = Spongy_Concrete_Weathered ( + infinite_tiling: true, + roughness: 0.55f, + concrete_brightness: 0.79f, + wetness: 0.0f, + water_darkening: 0.0f, + dirt_deposit_amount: 1.0f, + dirt_brightness: 0.2f, + dirt_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 4 +export material Spongy_Concrete_Weathered_Light_Dirt(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Weathered - Light Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Light_Dirt.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "dirt", "multimaterial", "gray")) +]] = Spongy_Concrete_Weathered ( + infinite_tiling: true, + roughness: 0.55f, + concrete_brightness: 0.55f, + wetness: 0.0f, + water_darkening: 0.0f, + dirt_deposit_amount: 1.0f, + dirt_brightness: 0.8f, + dirt_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 5 +export material Spongy_Concrete_Weathered_Wet_Flows(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Weathered - Wet Flows"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Wet_Flows.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "dirt", "multimaterial", "gray")) +]] = Spongy_Concrete_Weathered ( + infinite_tiling: true, + roughness: 0.69f, + concrete_brightness: 0.6f, + wetness: 0.8f, + water_darkening: 0.7f, + dirt_deposit_amount: 0.0f, + dirt_brightness: 0.25f, + dirt_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered_Mossy.mdl b/code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered_Mossy.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6c0f4b1cd39098c27c957f91e4bbd3ca59531a9d --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered_Mossy.mdl @@ -0,0 +1,393 @@ +/****************************************************************************** + * 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 spongy concrete material with a worn, mossy appearance."; + +::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 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 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 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 Spongy_Concrete_Weathered_Mossy( + float roughness = 0.12f [[ + ::anno::description("Adjusts the roughness of the material."), + ::anno::display_name("Roughness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float brightness = 0.6f [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float bump_factor = 1.f [[ + ::anno::description("Drives the intensity of the surface bump."), + ::anno::display_name("Bump Factor"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float dirt_amount = 0.f [[ + ::anno::description("Adds a thin layer of dirt on top of the material."), + ::anno::display_name("Dirt Amount"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Dirt Layer") + ]], + float dirt_brightness = 0.0f [[ + ::anno::description("Adjusts the brightness of the dirt layer."), + ::anno::display_name("Dirt Brightness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Dirt Layer") + ]], + float dirt_scale = 1.f [[ + ::anno::description("Scales the size of the dirt layer."), + ::anno::display_name("Dirt Scale"), + ::anno::in_group("Appearance", "Dirt Layer") + ]], + 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::soft_range(0.0f, 360.0f), + ::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.0, 1.0)), + ::anno::in_group("Adjustments") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use the selected texture space."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Spongy Weathered Mossy - Shiny"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "construction", "architecture", "multimaterial", "exterior", "weathered", "aged", "mossy", "gray")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::weighted_layer(histogram_range(float3(endless_texture(texture_2d("./textures/spongy_concrete_dirt_mask.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.f / dirt_scale, float3(0.629999995f), 8.f, true))[0], 0.980000019f, ::math::lerp(1.f, 0.672000051f, dirt_amount)), ::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.178000003f, 0.338000029f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.611000001f, ::math::lerp(0.443000019f, 0.275000006f, roughness)), 1.f, ::math::lerp(0.638999999f, 0.75f, roughness)) * histogram_range(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.611000001f, ::math::lerp(0.443000019f, 0.275000006f, roughness)), 1.f, ::math::lerp(0.638999999f, 0.75f, roughness)), histogram_range(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.611000001f, ::math::lerp(0.443000019f, 0.275000006f, roughness)), 1.f, ::math::lerp(0.638999999f, 0.75f, roughness)) * histogram_range(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.611000001f, ::math::lerp(0.443000019f, 0.275000006f, roughness)), 1.f, ::math::lerp(0.638999999f, 0.75f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(::math::lerp(0.59800005f, 0.899999976f, brightness)), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, 0.f, ""), ::state::normal()), ::df::diffuse_reflection_bsdf(dirt_brightness * color(0.31854701f, 0.275550991f, 0.252952009f), 0.f, ""), ::state::normal()), + 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, + normalmap_normal(texture_2d("./textures/spongy_concrete_weatheredMoss_norm.jpg", ::tex::gamma_linear), bump_factor, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +// 2 +export material Spongy_Concrete_Weathered_Mossy_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Spongy Weathered Mossy - Rough"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Rough.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "construction", "architecture", "multimaterial", "exterior", "weathered", "aged", "mossy", "gray")) +]] = Spongy_Concrete_Weathered_Mossy( + roughness: 0.75f, + brightness: 0.6f, + bump_factor: 1.0f, + dirt_amount: 0.0f, + dirt_brightness: 0.0f, + dirt_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 3 +export material Spongy_Concrete_Weathered_Mossy_Dark_Dirt(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Spongy Weathered Mossy - Dark Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Dark_Dirt.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "construction", "architecture", "multimaterial", "exterior", "weathered", "aged", "mossy", "dirt", "gray")) +]] = Spongy_Concrete_Weathered_Mossy( + roughness: 0.55f, + brightness: 0.79f, + bump_factor: 1.0f, + dirt_amount: 1.0f, + dirt_brightness: 0.2f, + dirt_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 4 +export material Spongy_Concrete_Weathered_Mossy_Light_Dirt(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Concrete Spongy Weathered Mossy - Light Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Light_Dirt.png"), + ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "construction", "architecture", "multimaterial", "exterior", "weathered", "aged", "mossy", "dirt", "gray")) +]] = Spongy_Concrete_Weathered_Mossy( + roughness: 0.35f, + brightness: 0.59f, + bump_factor: 1.0f, + dirt_amount: 1.0f, + dirt_brightness: 0.9f, + dirt_scale: 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/Concrete/Stone_Pores_Weathered.mdl b/code/third_party/vMaterials_2/Concrete/Stone_Pores_Weathered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f104d59788af448bbe85f115b2f68f32cda9b876 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/Stone_Pores_Weathered.mdl @@ -0,0 +1,706 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A stone wall material"; + + + +float remap(float input, float low_1, float high_1, float low_2, float high_2) +{ + return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1); +} + + +float3 transform_internal_to_tangent(float3 n) +[[ + ::anno::hidden() +]] +{ + return + n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ + n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ + n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + ::anno::hidden() +]] +{ + return ::state::texture_tangent_u(0) * n.x + + ::state::texture_tangent_v(0) * n.y + + ::state::normal() * n.z ; +} +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + + n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_small(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(0.0, 1.0 - width, position), + ::math::lerp(width, 1.0 , position)), + 0.0, + 1.0); +} + + + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +color hue_shift( + color input = color(1.0, 0.0, 0.0), + float hue_adjust = 0.0f +) +{ + float3 in_color = float3(input); + float3 kRGBToYPrime = float3 (0.299, 0.587, 0.114); + float3 kRGBToI = float3 (0.596, -0.275, -0.321); + float3 kRGBToQ = float3 (0.212, -0.523, 0.311); + + + //color converted = color(kRGBToQ); + float3 kYIQToR = float3 (1.0, 0.956, 0.621); + float3 kYIQToG = float3 (1.0, -0.272, -0.647); + float3 kYIQToB = float3 (1.0, -1.107, 1.704); + + float YPrime = ::math::dot(in_color, kRGBToYPrime); + float I = ::math::dot(in_color, kRGBToI); + float Q = ::math::dot(in_color, kRGBToQ); + float hue = ::math::atan2(Q, I); + float chroma = ::math::sqrt(I * I + Q * Q); + + hue += hue_adjust; + + Q = chroma * ::math::sin(hue); + I = chroma * ::math::cos(hue); + + float3 yIQ = float3 (YPrime, I, Q); + + return color(::math::dot (yIQ, kYIQToR),::math::dot (yIQ, kYIQToG), ::math::dot (yIQ, kYIQToB) ); +} + +// Taken from https://www.shadertoy.com/view/4tlBWB +float3 hsv2rgb(float3 c) +{ + float4 K = float4(1.0, 2.0/3.0, 1.0/3.0, 3.0); + float3 p = ::math::abs(::math::frac(float3(c.x) + float3(K.x, K.y, K.z)) * 6.0 - float3(K.w)); + return c.z * ::math::lerp(float3(K.x), ::math::clamp(p - float3(K.x), 0.0, 1.0), c.y); +} + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + + + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 + //bool srgb2rgb = false, + //bool rgb2srgb = false +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); + //return ::state::normal(); +} + +export material Stone_Pores_Weathered( + uniform bool infinite_tiling = true [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly.\t."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float stone_diffuse_brightness = 0.8f [[ + ::anno::description("Adjusts the lightness of the stones and pebbles."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Stone"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness = 1.f [[ + ::anno::description("Controls the roughness appearance. Smaller areas are highlighted."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Stone"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float stones_bump_strength = 1.f [[ + ::anno::description("Drives the bumpiness of the stones."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance", "Stone"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_brightness = 0.6f [[ + ::anno::description("Adjusts the brightness of the moss."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_saturation = 0.79f [[ + ::anno::description("Controls the saturation of the moss."), + ::anno::display_name("Saturation"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_distribution_amount = 0.f [[ + ::anno::description("A lower value makes the moss grow more unevenly across the surface."), + ::anno::display_name("Coverage"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_height_growth = 1.f [[ + ::anno::description("Controls the growth of the moss material."), + ::anno::display_name("Growth"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_weight = 1.f [[ + ::anno::description("Decreasing this parameter makes the moss layer more transparent."), + ::anno::display_name("Weight"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_moisture = 1.f [[ + ::anno::description("Makes mossy areas more reflectivy to give them a wet appearance."), + ::anno::display_name("Moisture"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float moss_bump_factor = 1.f [[ + ::anno::description("Determines the degree of bumpiness of the moss."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = float2(0.5f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.2f, 1.2f)), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = true [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 0.00200000009f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]]) +[[ + ::anno::display_name("Stone Pores Weathered"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Stone_Pores_Weathered.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.209999993f, 0.75999999f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))) * ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))), ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))) * ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::lerp(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/stone_diff.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.49019599f, 0.466666996f, 0.435294002f), 8.f, true) : ::base::file_texture(texture_2d("./textures/stone_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.5f, 0.200000003f)), ::base::color_layer_multiply, ::math::lerp(1.f, 0.f, stone_diffuse_brightness)).tint, hue_shift(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/moss_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::pow(hsv2rgb(float3(0.2214614f, ::math::lerp(0.f, 0.699999988f, moss_saturation), ::math::lerp(0.175000012f, 0.699999988f, moss_brightness))), 2.20000005f)), ::base::color_layer_overlay, 1.f).tint, 5.95100021f), moss_height_growth * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), 0.f, ""), bsdf(), add_detail_normal(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./textures/moss_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, moss_bump_factor), false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), ::math::lerp(0.f, 2.f, moss_weight) * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), infinite_tiling ? endless_normal(texture_2d("./textures/stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.498039007f, 0.501960993f, 0.882353008f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f))), add_detail_normal(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./textures/moss_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, moss_bump_factor), false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), ::math::lerp(0.f, 2.f, moss_weight) * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), infinite_tiling ? endless_normal(texture_2d("./textures/stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.498039007f, 0.501960993f, 0.882353008f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Dry_Bright_Stone(*) +[[ + ::anno::display_name("Dry Bright Stone"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "bright")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Dry_Bright_Stone.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 0.6f, + reflection_roughness: 0.7f, + stones_bump_strength: 1.f, + moss_brightness: 0.f, + moss_saturation: 0.f, + moss_distribution_amount: 0.f, + moss_height_growth: 0.f, + moss_weight: 0.f, + moss_moisture: 0.f, + moss_bump_factor: 0.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Matte_Stone(*) +[[ + ::anno::display_name("Matte Stone"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "matte")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Matte_Stone.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 0.2f, + reflection_roughness: 0.f, + stones_bump_strength: 0.8f, + moss_brightness: 0.f, + moss_saturation: 0.f, + moss_distribution_amount: 0.f, + moss_height_growth: 0.f, + moss_weight: 0.f, + moss_moisture: 0.f, + moss_bump_factor: 0.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Slightly_Grown_Moss(*) +[[ + ::anno::display_name("Slightly Grown Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "slightly", "grown")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Slightly_Grown_Moss.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 1.f, + reflection_roughness: 0.8f, + stones_bump_strength: 0.5f, + moss_brightness: 0.8f, + moss_saturation: 0.89f, + moss_distribution_amount: 1.f, + moss_height_growth: 0.55f, + moss_weight: 1.f, + moss_moisture: 0.5f, + moss_bump_factor: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Soft_Grown_Moss(*) +[[ + ::anno::display_name("Soft Grown Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "soft", "grown")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Soft_Grown_Moss.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 1.f, + reflection_roughness: 0.8f, + stones_bump_strength: 0.5f, + moss_brightness: 0.8f, + moss_saturation: 0.9f, + moss_distribution_amount: 1.f, + moss_height_growth: 0.8f, + moss_weight: 1.f, + moss_moisture: 0.7f, + moss_bump_factor: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Saturated_Green_Patches(*) +[[ + ::anno::display_name("Saturated Green Patches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "saturated", "green")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Saturated_Green_Patches.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 0.f, + reflection_roughness: 1.f, + stones_bump_strength: 1.f, + moss_brightness: 0.8f, + moss_saturation: 0.85f, + moss_distribution_amount: 0.6f, + moss_height_growth: 0.9f, + moss_weight: 1.f, + moss_moisture: .21f, + moss_bump_factor: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Fadely_Yellowish_Moss(*) +[[ + ::anno::display_name("Fadely Yellowish Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "fadely", "yellowish")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Fadely_Yellowish_Moss.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 0.f, + reflection_roughness: 0.8f, + stones_bump_strength: 0.2f, + moss_brightness: 1.f, + moss_saturation: 0.f, + moss_distribution_amount: .69f, + moss_height_growth: 1.f, + moss_weight: 0.25f, + moss_moisture: 1.f, + moss_bump_factor: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg b/code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ebe0743ebf4d449a137238ddfe75d8e39d0e2b77 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f30119a03f87bebc2746077477727a09edc61911d288604b5dcbc9406424cfa4 +size 6278524 diff --git a/code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_diff.jpg b/code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_diff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3698181d55ed8db9e8495f880b72a8590a24c412 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_diff.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:664db388d9f7f4fa6e28c29f133d89ffecd7f4acfb6cb7f58be69d2ec57e8d06 +size 1124413 diff --git a/code/third_party/vMaterials_2/Concrete/textures/moss_diff.jpg b/code/third_party/vMaterials_2/Concrete/textures/moss_diff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b1e3f847eb41d6fbd122967df2c1063672eb14d3 --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/textures/moss_diff.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f01800b456e31f6575e429a8eb9751d7a71fa0ee61d3e16effa9d7709babaf8 +size 990554 diff --git a/code/third_party/vMaterials_2/Concrete/textures/precastconcrete_diff.png b/code/third_party/vMaterials_2/Concrete/textures/precastconcrete_diff.png new file mode 100644 index 0000000000000000000000000000000000000000..b55a5d98cf9f9e019d476e590d43839fa7c2a63d --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/textures/precastconcrete_diff.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bac81f3d1b2a872a249df7137cc4e852ccb4c459cba002b6a7360bcf87c3cca3 +size 7238964 diff --git a/code/third_party/vMaterials_2/Concrete/textures/spongy_concrete_weathered_norm.jpg b/code/third_party/vMaterials_2/Concrete/textures/spongy_concrete_weathered_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..98e0a520a7fb513854cdd218dcbed079ae23654c --- /dev/null +++ b/code/third_party/vMaterials_2/Concrete/textures/spongy_concrete_weathered_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6f7efa75f2bde78bc8a7f57c835423d9b369aec29c7e442c89d9f3a0cd70429 +size 2747016 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Flaxen.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Flaxen.png new file mode 100644 index 0000000000000000000000000000000000000000..36dae236456f640fd5b306be8a769668c2808285 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Flaxen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17b5ec038061a31d907f1cbb6fc8d92c83035c1393756f30b07ee8975db4aff6 +size 97263 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mustard.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mustard.png new file mode 100644 index 0000000000000000000000000000000000000000..462600046b38322c0d3339d0e4800bffa0acbecb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mustard.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d26d208b1b7be7961a0d83b588ebc29fcab8c0efa5b211a30580e63743df959b +size 102033 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Potters_Clay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Potters_Clay.png new file mode 100644 index 0000000000000000000000000000000000000000..c887b5bfe80428dcc917e8766b2e1eb2741ad978 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Potters_Clay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:316fd5e1e7fd37ca825e627af6aaccc43515b16b0c805371d773d81db5181ec8 +size 94942 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..e77883b32d9ed41cce14f0364f030b40afb8f681 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:484c94630b4b5c6a448a84aa9d68934463257ef295b6a229c05e29c66cd49d3e +size 95193 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rosy_Peach.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rosy_Peach.png new file mode 100644 index 0000000000000000000000000000000000000000..d7e3501b3ea28da3a4d9f5433009c52cee0783e6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rosy_Peach.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09f6e6564257bcaea7524bf64240a7a7966c4fe08361ff766a31f9acd348fb60 +size 98748 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Smoke.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Smoke.png new file mode 100644 index 0000000000000000000000000000000000000000..28a0c4a8a0720a7e06b4a4d14613d6d135354983 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Smoke.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e1d226a6365b0ea0d1828fee2aa9ccd829bdd7ecfd0edd01d90a48f4ca3968c +size 88961 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Teal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..1919480a4188a3bd3b9632c76dd5573c9ebc318e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8cf66e3276595464299569f9206a121c28f35634ca08be1d46747a472608d9e +size 90335 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Independence_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Independence_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..a6a9e65c8d6fece34bb0b0d1a1387598c6e24ecb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Independence_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d6ee16f11786a3efcaa5a0a8b24a6714836a6e5acbdbe003deca9d224c489ce +size 90419 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Washed_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Washed_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..05ff59ccfda2c5d3e1965d43f44d1a94ec6dcf59 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Washed_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fad6333521c8915dbc70d536f99a04482b90c4ca92b5d7721a2831fc79f4e5b0 +size 96882 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry.png new file mode 100644 index 0000000000000000000000000000000000000000..919c8f5da2ce3181ebd6522b4842a70bffeecc27 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5213ccf164f5e4adb42004310d467d9dd0b3d50e8e472b64137268836581863d +size 98555 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..724b82b39621b5f51af99a7f05628306603dc543 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64e7491a70249528ee99491df7c274f9e91b1b4fd4617625e82ec5a7268eb047 +size 84208 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..7d9a28e77440d977fde77eadfdb52ac134d18abf --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77c0d8a36aab88f7729ec3fc731052796d610fe8cc64119706a7ac2809271b0b +size 80774 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Harbor_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Harbor_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..bc2673ec6c1a22c0887189289ebf4de40459f356 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Harbor_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41e9f7b51f3e55eba75e580f0384081849fba07337845290fc62470b12cb58f8 +size 91679 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Mid_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Mid_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..84dca20b5e7e8e0928e3590e3d4d6fa7ecd5ccd7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Mid_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adc0b2f999fbdf4053bb494c227dec6daffcfd55ff99490bfaf767b0ea98a005 +size 83996 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford.png new file mode 100644 index 0000000000000000000000000000000000000000..72192a1479c21671e0474557ba9c517e3be6a456 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4799c7f9ded72e4b2db92e6484259e1cf083304afd5263387d133b3bc730a219 +size 96004 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Coffee_Bean.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Coffee_Bean.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed8051d873b4f4d709415067c7ae3074a274047 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Coffee_Bean.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee99e24fa54493064f3ac65aff0af47ac5e549d723f0f1a52af8a45a7553b07e +size 84362 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fog.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fog.png new file mode 100644 index 0000000000000000000000000000000000000000..8439d1179d50ee8a676cc13564eadf0879899ec9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fog.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3790da0df49a4054916bffd25a80814af5d3fc98d968bb9bc7d08907f0602dd +size 98354 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd8db69a22ca92cfe34aa258fcbae368b8e680d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:863d902be0e425dba15a73fe680d455125f708e7ab5e1a978927424224c6d6bb +size 97608 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Peacock.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Peacock.png new file mode 100644 index 0000000000000000000000000000000000000000..c5111fd10b1cdef6e3bf53b0c8fc230147c48cfc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Peacock.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a51a879c9f18c9536a63cd64d4aff3e22cb9d34e180eabfc2f23a567e67187be +size 92778 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..e88a45266a04bd16817c86a40c92baeaa1467314 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ac97d1e9e000832895992f8806628f5e64df2e145502254bdf364bacf58e7f6 +size 97894 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..6c239b42d6669f9ff91b264673cf0daa750afe54 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:730717a06293f839df697db50290b591572c2e1552d63019884171e4eaef7548 +size 105851 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..5acec2c62a3c3fa85e107b35d123ab64140fad12 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a69bc4b58491ccb45e58dcdd73491a5764c69e0c4b5f988a21098fe5ec49dcbc +size 109031 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey.png new file mode 100644 index 0000000000000000000000000000000000000000..7b1566ad458ed16adafedc250b028937099acde8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:476809432f20a4c82b7447b31a3a20eaebc1c41fde908fdb3ae4e16f8e9c5348 +size 95001 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Amethyst.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Amethyst.png new file mode 100644 index 0000000000000000000000000000000000000000..8a05ff6ce2c5cdbb5306bb5401c61c59ed7bf1dc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Amethyst.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e5404857faf5a57d17ebe4edc86e83988efce37dba5cc98fbb7a01531ea162d +size 95947 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Brick_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Brick_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..8957d3b3d01a934d0d702a6d3aee8709e47a5b17 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Brick_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48156dadbf254fd28a67902d6920c96dc64f9a48bb81d75d50436ab5d9c067b8 +size 96467 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Bubblegum.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Bubblegum.png new file mode 100644 index 0000000000000000000000000000000000000000..5b028af5bfbf97c646cd39f299f9e4af8ffa2247 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Bubblegum.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e70b5304b13d66c27788961e0e49970f0ad20ffe67784e9b652250d93a8789f1 +size 100245 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Charcoal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..e6435359c9e2fc7b19d945aad9cb54a1e21c3c3e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Charcoal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed37ee07400728960fe1e49fe2cae0941da3749de70d3ce6b06d52cd7612e972 +size 82843 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Grass_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Grass_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..832da769af6be00ef7f0015f85934fea0ca1651f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Grass_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6a34395227a226b427e3ce85c6d6b8b0a60351617339098024e2ed2b70fe630 +size 98646 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..09903d8f63ac2e36e1883754bac1884f770a08c0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:204adbaef6a180fec53fb9411ea9b267da7042175f22873d54ecec1a7dfe8ade +size 86638 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Navy_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Navy_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..fe2f0531361b1f1da2b8194f99a06faf81fcc49c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Navy_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef979c00cb71b79e6e6e42497b1a0411ca041ca5f89a10fd6306015e34f986d1 +size 89326 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..6bd2b433e7da0aa9bc394dd22c8ee2359e4d6f72 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:691de691805c9599cb037396d2feb49df550b5a0dd40d8c4791bf26cdef9244e +size 101649 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..a1cac6f102c378a7cebefd69ab01ea04f1c17fea --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9bb56037f41a298428e22cbc8c2d0e6c75491289c65daec28aa443c8d2c503e3 +size 92607 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Teal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..57e3f0360cfa246f0baf58f28b3801966b654427 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5625c1501f28944be7786c7bfb14c33bbfeeeb3fe098e8a501f7c2af0219219 +size 98624 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Black_Pepper.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Black_Pepper.png new file mode 100644 index 0000000000000000000000000000000000000000..86350dbb37af45678eb9ebfc0f9483699df49aa8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Black_Pepper.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73c7fbb3ea299861b2477eda480beae91f979197208f17dbb6999025654a6bbf +size 85443 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Morning_Glory.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Morning_Glory.png new file mode 100644 index 0000000000000000000000000000000000000000..608efc422123dfd641debd3ee1d48744df15342e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Morning_Glory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0613985e599f419ecf022ce5b0f18cf15a6bea75c9d2940ba349f164fa1c250 +size 91777 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven.png new file mode 100644 index 0000000000000000000000000000000000000000..7864fdff2729b9b35108c173b536e0df90de37bf --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b64cddc516c8ceb4384c62f9fffa515ecd6da822dc6d414f26d6fd1e843589c8 +size 100867 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Cheery_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Cheery_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..2f30d8660f4bb32ed9a08077eb5dd49a9687731f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Cheery_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82901b3e0074a5ce1f639382f7bfe8c70780ec34a873ba3d6b888cb6aede69c4 +size 104486 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Petrol.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Petrol.png new file mode 100644 index 0000000000000000000000000000000000000000..17fa1f9c993674c8ac3e0b26728744d2abacfea5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Petrol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b61d14fd525e8044e6822988d7b8d1bee9bd24d69c6266f9b89bc0baef1deec +size 96804 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..d3998bd243bc230059e097ce76a5f33c14e4f1ec --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19a9c133878968615643fddcde82478e5d884943e35968e33348564751aaa57d +size 105836 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Desert_Mist.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Desert_Mist.png new file mode 100644 index 0000000000000000000000000000000000000000..739437909b28f0e097562641cab043bb3b3ceea8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Desert_Mist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1ff697c18fbb9f468ac3d385d41fdcf1440402acdd7f96983677f262c0fd4b4 +size 107284 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_French_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_French_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..0cdfe7c5d6282a6b6732b19d94f80aa4c7c65ae4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_French_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:128931b224c36b6abefbde62cf97ef8abe459c8d08e8474fe4878b3b587b5ac0 +size 107698 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Mint.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Mint.png new file mode 100644 index 0000000000000000000000000000000000000000..321ac27a43d2de302bc63ecdd2b71d987b37ba11 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Mint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab47b60385431c1fe2b5af17763ce78b229d88075fa248bafd945ebcb85e73a1 +size 111497 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Rust.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Rust.png new file mode 100644 index 0000000000000000000000000000000000000000..961d61d4cd05b2cf89dd4b88ae822013bde4c398 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Rust.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:906d5c7efe98b71f848e6c6ccd910da7fa71cd059a363fc9300aa82b4460857e +size 107697 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..230687d60f1e52d41d3720a97f57dab951a1f843 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba0778d511d1d9f8d6a27cfddeb66b96f6296a47325873aabf390030814acf86 +size 109785 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..7841f8ae885b2963bc8321baf56642c8b6b98646 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bf6ca15a504e6ec101b67d1dfa345884f51d878c4f7f388d7792a822eec81ce +size 65651 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Charcoal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..a71ff6d658e9fa98f437b3569edb23508210d6e2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Charcoal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6966a9514e6a5f975da6e1fa187ab8765c802ccac2f5de4a18f0cf097501b853 +size 68556 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Golden.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Golden.png new file mode 100644 index 0000000000000000000000000000000000000000..36a69d72ad25e81446cb6a79bd79416ad389f495 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Golden.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16c13db4f7b8a1ea3197b7e96219b22aed2e84896e6e14bf969d284ed008041c +size 81907 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Navyblue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Navyblue.png new file mode 100644 index 0000000000000000000000000000000000000000..e6c88d8efab61706db948891271f96cae7a1fa1d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Navyblue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2de8e3f662e5267c764845a1f66b94008bd870a42c59f4f69bd9e8b1880ea3f4 +size 70648 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..673ba66b96268787d696f9c57133609b0e275dd4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff43b21cc9a2b397535f57200a984b2a19d313c5e48c24ffa2422840c358b053 +size 78688 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Plain.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Plain.png new file mode 100644 index 0000000000000000000000000000000000000000..8239f2d0c67954fcf587e45cf2970c8d0e663e5d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Plain.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f4afb8ce2c988d1c41b3db6c285a9d28f274ec7fe2acd3e819f779ca381a798 +size 93237 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..2b0e9a7ad391a0b1548469dceb6d9aba3936cc4a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f3b98d5a5fb67d96c514cb7439675fcaa5345f88b37f91a328aa9f7393e4735 +size 94491 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..a2a93755f3ed8f8eee1a997959f7bc9a9dea0d77 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83a451e45568d641faf466bfce086e746124a8c18d9074ad0b839942cb3284cf +size 88508 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Dark_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Dark_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..656344f56b7599c93e0b15a0103e16ab7a13c1e9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Dark_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a15b6fff8ce42b50671b25f8c1dbb86b6f89b0e8d92714e6ccb9945dfc820550 +size 94735 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..4e3811d4b6a5920db74b3deb2deec15662d6fd08 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41c598180a8829e9881c4ceaccf9db4b9dc83464b462b076ede2d180f116e218 +size 98524 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone.png new file mode 100644 index 0000000000000000000000000000000000000000..b81ef84870f23ad5e478446fe0af96bed4e43a49 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e6d51028ff229aee4b2f6c674058e536733521cea5d59e3846d7c2b48131c8f +size 85306 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Grey.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Grey.png new file mode 100644 index 0000000000000000000000000000000000000000..7413758597745b893c5e171873dfaf0a42a4215e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Grey.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:136b6f7a02b063ef79faf9e9363f98ef8bf1cd0de7d652e18ed09b9a730e8e34 +size 99295 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..1c265a441b44f5542704ef89e88f4eeb6e22f096 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2758ecb2dc3f43584fe7abf2478507476d0dba3472b7b56978165ca44db56752 +size 89702 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse.png new file mode 100644 index 0000000000000000000000000000000000000000..da95b636c5f4c17c3ec5b1f93c94d23ff932f403 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a35a2f4c2d80737c3b0bde1547fe34dcbd91aaf3c0694d1c4d49af5961c984a3 +size 95111 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Champagne.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Champagne.png new file mode 100644 index 0000000000000000000000000000000000000000..7b1ab401a552d18a5ebf6509947fe04245a51c61 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Champagne.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e544cce6d50d4dc268589dd0a7cace2cad8fe99f888bb8ef85e24a67e2d1e77 +size 95093 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Champagne.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Champagne.png new file mode 100644 index 0000000000000000000000000000000000000000..284479797972335f24e67b3d53bec5f9c3820cd0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Champagne.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be56686bda384916e1c3d21044cbbe4327f78987d759fe6219d180a7828de640 +size 103064 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Forest_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Forest_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..d7a718dea7a3037a0be8c85fbabc2391c89af7c0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Forest_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4c826e279aa1fb8f4f576b82cb94d4e93d87da2b8976afcd192be8fffbd88a9 +size 95769 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Moss.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Moss.png new file mode 100644 index 0000000000000000000000000000000000000000..eb8ad198579e7ea251316349d88bd460549ea97f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Moss.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:513c3b49c8b33f3297abf463d95dd04aff0fa2caf8b3698b077b4c8ad3236e29 +size 97104 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..447e8bd6e882efd644a2aeda5b2a8c2d35011d43 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a57818626cf4dc96b5e216b21877909e91805bbdb1680d932945eb5e6731662d +size 100251 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..ece7fe2ca4fc808ee54dc1267a2866a3e002a35d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c1ea737e8156364f915a52ef0d26508b3cdfbdd10359432927cef1f4fa2e856 +size 98152 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette.png new file mode 100644 index 0000000000000000000000000000000000000000..a9c05514ab6bf7f4443bf5c226ab78d049c9e30c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1108a160edecbf44f576bc5dc436f740456f3409290297310fbff0df5394d832 +size 106821 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..fd979d83b9f5b957d809b766d457f0082e797a42 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d491ffcf065c46fc0530ecc25bd2b479d0ed946f7e6ea9692a18794c7ef8e7c3 +size 105126 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Lavender.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Lavender.png new file mode 100644 index 0000000000000000000000000000000000000000..7d1fc86432f450645fe3cd30d301d54e7523762a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Lavender.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a99472250e451ce898097e19c11cd24f32084a96101939cb826c73d4cfbe7108 +size 96660 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Sky_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..b5dcc2df2ec48183788ce4dc0f2dd68c2f78194f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fd284119cdc4d27c4b9b80cb2abace7a87ec084cb7c9e2045633e41de2db558 +size 108136 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Black_White.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Black_White.png new file mode 100644 index 0000000000000000000000000000000000000000..4201ffb42acacac237bc9f49d854004b8168d75e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Black_White.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0499a016a246a2c7a8c5314c1a3525012d4bae7c1adddd6ba7e5000b8331809c +size 110928 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Green_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Green_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..9a2ee38069e123641fd7f4c0803c1d1dfa95a2f7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Green_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:116d668b495ff8ced7f7d744608440badbf121d36f25f6ae52378c026bf58d73 +size 115384 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Mustard.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Mustard.png new file mode 100644 index 0000000000000000000000000000000000000000..270e0a0a500923e0e8044232e1eeb0bb814de65d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Mustard.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebd5dda1b0560be76749af34849d0d17bb40264bc91da4f8a347242712ca7ba9 +size 118914 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Olive_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Olive_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1d78a71bb36eea1fc3705c5567845e590cc76 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Olive_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d8a0a97a477da2fcb901c35c852bd03ca9e0060c610273bafeec815f77bec6e +size 107623 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Saturated_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Saturated_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..0b07fd2cf5923301ab22a400d389d93ebf761946 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Saturated_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:443651846e98a3b9c92021541deac0336f89dce1ae2366df9752ec083279bc10 +size 109955 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet.png new file mode 100644 index 0000000000000000000000000000000000000000..37291afb3b3e7b1135b940cd5f382af1503a94a3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ab70836c063900eec5aa3d58614d4ef24c12beedf22aae16b62fdbd8c6f7817 +size 98211 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..ca4fca1dd3ac8c93ca31976038476421c09686af --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:569a6e47973827c02e1d3d923fc541e1262709807a1112bc1a318e65b2c34a43 +size 96756 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..a7cf5c2dbe369a3299d125cb6f18d0cf9e6a21b3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79363cbc203166f199d335deeceef8fb35d2121a2d293f4d0163837a088703b2 +size 99306 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Dark_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..340768a79e791bba1283af053ef67cc434f96ca8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c514f94262f956d0d87d41bf567b5831c39c1addf8619aa4b6b77903217b3d49 +size 98300 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Emerald.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Emerald.png new file mode 100644 index 0000000000000000000000000000000000000000..b9128a600be4f3f8d5835154115a50d605c71f88 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Emerald.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29cf87701952c2b2b7447afa924630acb87434d4c8d46a1205484df9bae9a097 +size 94536 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Turquoise.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Turquoise.png new file mode 100644 index 0000000000000000000000000000000000000000..af045c23aef463e54fb6107e5da42208b3dba298 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Turquoise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7274974460e1feeaee5e22e42751ed8633d49c75420b28b6df38feb78a65369 +size 97607 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton.png new file mode 100644 index 0000000000000000000000000000000000000000..1f8423c4c67aec4cc3853a16affcd113e92e2102 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9871bd1f35d76c2f0f3e5061d94a9eb7435f6f45e69157263b623149048beff7 +size 99464 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Blue_Jay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Blue_Jay.png new file mode 100644 index 0000000000000000000000000000000000000000..1f55e141f6093cec015e6b3295fe6c0a16a1913d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Blue_Jay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b6d97c93c637300e58586f15150e50f9789ed7e3e2148a5d1bb32b7e90d0f0c +size 104822 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..2a00606a10aee588667d9d7c4374f5c3c1ecc27e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4170015c9c0c463a8c0c9e257cf7aca1af1c08ca5dd4b61d5a0bb7512d99b53 +size 86943 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Garnet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Garnet.png new file mode 100644 index 0000000000000000000000000000000000000000..be90cbd6e2facbdf5e1b93887bbc452a62654f83 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Garnet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:216bce60bdf7fbb09afc34f30defab896cdd8bd8ace3bdb441195b28eda821a5 +size 101090 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..232fbaed50cb6f7eb4bda7625e8d1d45f3155915 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ea6714bcd452c491a6686903904286030ca2e9ec20338a1145b87e21fc3e8e7 +size 98187 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Green_Tea.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Green_Tea.png new file mode 100644 index 0000000000000000000000000000000000000000..38004d33ebe4737107d6a2cfab409b351e8c1688 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Green_Tea.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2916e1a2a37dc8425fb17eed2500b3db00c5bd992fb9056b5bc3ce25baab84cd +size 103110 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Paprika.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Paprika.png new file mode 100644 index 0000000000000000000000000000000000000000..2a59eb4d9571e21223d89dedd4b4f0bdd00b3ac3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Paprika.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef036c7bde075c31dfb4df3e98498f445656f39ce698704954643125ebc5b9bc +size 107246 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..dc51096e5690a0bff0ded6fc8464f9982e825e84 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18e1eebf67d75be746c95ad1910edd76de4a82465ae117ce11f74a9cd4bb9192 +size 107885 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Tobacco.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Tobacco.png new file mode 100644 index 0000000000000000000000000000000000000000..53684e77e728524162b5b174978477b749d65ec6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Tobacco.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05ffe01f62074560ef36d7445ea3c4afd4c50e53d68392d531c91f1ccef9381e +size 96929 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit.png new file mode 100644 index 0000000000000000000000000000000000000000..4c066918e6cea881c4f2a1d5c69288df756945bf --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48f3da04f3e7a1e084ed348769098e2347f64b8507100511a596483b88c670f3 +size 99475 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Blue_Jay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Blue_Jay.png new file mode 100644 index 0000000000000000000000000000000000000000..7461930f2bc50a026ead983d2ef3265870f5d0a2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Blue_Jay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e4264bd8662db1c7e04bc73ab6b7b430bd9cbfddfc03a6ff201e099a3e505f2 +size 97222 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..81b50d218ac1d99d102399498bfcb1a84bd80128 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a4c8fa7c2169bf236e53f6307e26ce702a370a21533224d49d617243c18594d +size 100191 diff --git a/code/third_party/vMaterials_2/Fabric/Cashmere_Wool_Suiting.mdl b/code/third_party/vMaterials_2/Fabric/Cashmere_Wool_Suiting.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a997a89bbf6b63924a92c71d4fe97150febaa8a8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Cashmere_Wool_Suiting.mdl @@ -0,0 +1,1153 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A knitted cashmere material."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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 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)); +} + +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); +} + +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 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 histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +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; +} + +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)); +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + 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(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); +} + +::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 Cashmere_Wool_Suiting( + color fabric_color = color(0.715694f, 0.672443f, 0.630757f) [[ + ::anno::description("Sets the color of the fabric."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + 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), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float fabric_reflectivity = .83f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float fuzz_weight = 0.419999987f [[ + ::anno::description("Adds a white fuzz layer on the material which gives it a more used appearance."), + ::anno::display_name("Fuzz Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float sheen_weight = 0.709999979f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float translucency_amount = 0.f [[ + ::anno::description("A value of 0 makes the material completely opaque. Increasing the parameter value lets more light pass through the material."), + ::anno::display_name("Translucency Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + 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, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float warp_intensity = 0.f [[ + ::anno::description("Adds a little bit of distortion to break up the perfectly regular appearance of the weaving."), + ::anno::display_name("Warp Intensity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 6.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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) + ]], + 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) + ]], + 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)), + ::preview_scale(3.5f), + ::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) + ]], + 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(12) + ]], + uniform float roundcorners_radius_mm = 1.f [[ + ::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(13) + ]], + 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(14) + ]]) +[[ + ::anno::display_name("Cashmere Wool Suiting - Atrium White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "white", "light", "neutral" )) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.062; // Cashmere texture sample covers 62mm - set texture scale + + texture_2d diff_tex = texture_2d("./textures/cashmere_wool_suiting_R_diff.jpg", ::tex::gamma_linear); + texture_2d warp_tex = texture_2d("./textures/french_terry_fabric_warp.png", ::tex::gamma_linear); + texture_2d multi_tex = texture_2d("./textures/cashmere_wool_suiting_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/cashmere_wool_suiting_norm.jpg", ::tex::gamma_linear); + texture_2d fibers_tex = texture_2d("./textures/fibers.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(fabric_reflectivity * 0.0399999991f + 0.00999999978f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.699999988f, 0.48999998f), 1.33999991f), ::df::microfacet_ggx_smith_bsdf(histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.18000007f), 0.98999995f, roughness * 0.300000012f + 0.600000024f) * histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.18000007f), 0.98999995f, roughness * 0.300000012f + 0.600000024f), histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.18000007f), 0.98999995f, roughness * 0.300000012f + 0.600000024f) * histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.18000007f), 0.98999995f, roughness * 0.300000012f + 0.600000024f), 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(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.389999986f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::weighted_layer(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.75999999f, 0.25f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup(diff_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 0.479999989f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.680000007f, 0.469999999f)), ::base::color_layer_multiply, 0.229999989f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.29999995f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength))), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::weighted_layer(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.75999999f, 0.25f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup(diff_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 0.479999989f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.680000007f, 0.469999999f)), ::base::color_layer_multiply, 0.229999989f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.29999995f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), 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.001f, 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 Cashmere_Wool_Suiting_Champagne(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Champagne"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Champagne.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "champagne", "light", "warm" )) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.508881f, 0.428690f, 0.346704f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Silver(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Silver"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Silver.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "silver", "grey", "light", "neutral")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.445201f, 0.445201f, 0.456411f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Smoke(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Smoke"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Smoke.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "smoke", "gray", "neutral")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.283149f, 0.283149f, 0.283149f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Black(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Black"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Black.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "black", "dark", "neutral" )) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.029557f, 0.029557f, 0.029557f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Autumn(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Autumn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Autumn.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "autumn", "orange", "warm", "light")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.571125f, 0.381326f, 0.165132f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Flaxen(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Flaxen"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Flaxen.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "yellow", "light", "warm")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.597202f, 0.496933f, 0.296138f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Mustard(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Mustard"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mustard.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "mustard", "orange", "warm", "saturated")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.564712f, 0.341914f, 0.057805f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Chocolate(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Chocolate"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Chocolate.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "brown", "chocolate")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.238398f, 0.149960f, 0.102242f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Potters_Clay(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Potters Clay"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Potters_Clay.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "clay", "brown", "warm")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.356400f, 0.205079f, 0.130136f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Amazon_Clay(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Amazon Clay"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Amazon_Clay.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "clay", "brown", "dark")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.174647f, 0.114435f, 0.116971f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Ash_Brown(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Ash Brown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Ash_Brown.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "ash", "brown", "dark")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.114435f, 0.088656f, 0.084376f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Sky_Blue(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Sky Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Sky_Blue.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "sky", "blue", "light", "pastel", "cool")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.287441f, 0.450786f, 0.584078f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Electric(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Electric"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Electric.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "blue", "electric", "cool", "saturated")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.127438f, 0.309469f, 0.564712f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Teal(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Teal"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Teal.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", + "teal", "cool")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.162029f, 0.254152f, 0.258183f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Mint(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Mint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mint.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "mint", "green", "light", "pastel")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.366253f, 0.479320f, 0.381326f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Olive(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Olive"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Olive.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "olive", "green")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.165132f, 0.194618f, 0.119538f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Rosy_Peach(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Rosy Peach"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rosy_Peach.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "peach", "red", "warm", "light" )) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.428690f, 0.127438f, 0.099899f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Crimson(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Crimson"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Crimson.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "red", "crimson", "saturated", "warm")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.401978f, 0.028426, 0.063010f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Burgundy(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Burgundy"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Burgundy.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "red", "burgundy", "saturated", "warm")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.283149f, 0.014444f, 0.064803f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Lavender(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Lavender"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Lavender.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "lavender", "light")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.467784f, 0.417885f, 0.590619f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Rose(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Rose"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rose.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "rose", "warm", "pink", "light")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.584078f, 0.246201f, 0.491021f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Cashmere_Wool_Suiting_Purple(*) +[[ + ::anno::display_name("Cashmere Wool Suiting - Purple"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Purple.png"), + ::anno::key_words(string[]("fabric", "cashmere", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "purple", "saturated")) +]] = Cashmere_Wool_Suiting( + fabric_color: color(0.194618f, 0.046665f, 0.323143f), + roughness: 0.5f, + fabric_reflectivity: 0.83f, + fuzz_weight: 0.42, + sheen_weight: 0.52, + translucency_amount: 0.0f, + bump_strength: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + diff --git a/code/third_party/vMaterials_2/Fabric/Cotton_Denim.mdl b/code/third_party/vMaterials_2/Fabric/Cotton_Denim.mdl new file mode 100644 index 0000000000000000000000000000000000000000..391b4259e181e3f5a5165db3ff904c67deb7fb70 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Cotton_Denim.mdl @@ -0,0 +1,648 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A cotton denim material that features two adjustable colors and " + "a custom adjustable wash effect."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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 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)); +} + +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); +} + +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 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 histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +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; +} + +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)); +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + 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(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); +} + +::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 Cotton_Denim( + color fabric_color_1 = color(0.022f, 0.035f, 0.1f) [[ + ::anno::description("Adjusts the primary color of the denim material."), + ::anno::display_name("Primaray Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color fabric_color_2 = color(0.138f, 0.158f, 0.346f) [[ + ::anno::description("Adjusts the secondary color of the denim material."), + ::anno::display_name("Secondary Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float roughness = 0.61f [[ + ::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(2) + ]], + float sheen_weight = 1.f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float bump_strength = 1.00f [[ + ::anno::description("Sets the strength of the bump map."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::ui_order(4) + ]], + float warp_intensity = 0.01f [[ + ::anno::description("Warps the texture to produce a less evenly woven result."), + ::anno::display_name("Warp Intensity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float wash = 0.0f [[ + ::anno::description("The amount of wash patterns on the denim."), + ::anno::display_name("Wash"), + ::anno::in_group("Appearance", "Wash"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + color washed_tint = color(1.f, 1.f, 1.f) [[ + ::anno::description("Adjusts the tint of the wash effect."), + ::anno::display_name("Wash Tint"), + ::anno::in_group("Appearance", "Wash"), + ::anno::ui_order(7) + ]], + float wash_scale = 0.59f [[ + ::anno::description("Adjusts the size of the wash pattern."), + ::anno::display_name("Wash Scale"), + ::anno::in_group("Appearance", "Wash"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + 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(9) + ]], + 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(10) + ]], + float2 texture_scale = float2(1.0) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::in_group("Transform"), + ::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("Transform"), + ::anno::ui_order(12) + ]], + 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(13) + ]], + 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(14) + ]], + 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(15) + ]]) +[[ + ::anno::display_name("Cotton Denim - Standard Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Denim.Cotton_Denim.png"), + ::anno::key_words(string[]("fabric", "woven","cotton", "denim", "clothing", "thin", "sheen", "fashion", "new", "blue", "cool")) +]] + = + let { + bool tmp0 = false; + float remap_bump_strength = bump_strength * 1.3f; + float2 texture_rescale = texture_scale * 0.062; // Denim texture sample covers 62mm + + texture_2d warp_tex = texture_2d("./textures/denim_warp.jpg", ::tex::gamma_linear); + texture_2d multi_tex = texture_2d("./textures/denim_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d diff_mask_tex = texture_2d("./textures/denim_R_diff_G_mask.jpg", ::tex::gamma_linear); + texture_2d wear_tex = texture_2d("./textures/denim_wear.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/denim_norm.jpg", ::tex::gamma_linear); + + + material_surface tmp1(::df::custom_curve_layer(0.00999999978f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.429999977f, 0.573899984f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f, roughness) * histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f, roughness), histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f, roughness) * histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f, 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(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(nvidia::core_definitions::blend_colors(fabric_color_1, fabric_color_2, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, true).tint)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color_1, fabric_color_2, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, true).tint, color(histogram_range(float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.879999995f, 0.5f)), ::base::color_layer_overlay, 1.f, true).tint, washed_tint, ::base::color_layer_blend, histogram_range(vm_tex_infinite(wear_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(wash_scale * 20.0499992f)), float3(0.467000008f), 0.620000005f, true, 2.20000005f).x, 0.189999998f, wash * 0.0500000007f), true).tint, 0.f)), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color_1, fabric_color_2, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, true).tint, color(histogram_range(float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.879999995f, 0.5f)), ::base::color_layer_overlay, 1.f, true).tint, washed_tint, ::base::color_layer_blend, histogram_range(vm_tex_infinite(wear_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(wash_scale * 20.0499992f)), float3(0.467000008f), 0.620000005f, true, 2.20000005f).x, 0.189999998f, wash * 0.0500000007f), true).tint, 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), remap_bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), remap_bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), remap_bump_strength)), 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); + +// 2 +export material Cotton_Denim_Independence_Blue(*) +[[ + ::anno::display_name("Cotton Denim - Independence Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Denim.Cotton_Denim_Independence_Blue.png"), + ::anno::key_words(string[]("fabric", "woven","cotton", "denim", "clothing", "thin", "sheen", "fashion", "new", "blue", "cool")) +]] = Cotton_Denim( + fabric_color_1: color(0.033105f, 0.030713f, 0.078187), + fabric_color_2: color(0.155926f, 0.149960f, 0.262251), + roughness: 0.61f, + sheen_weight: 1.0f, + bump_strength: 1.00f, + warp_intensity: 0.05f, + washed_tint: color(1.0f), + wash: 0.05f, + wash_scale: 0.59f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 3 +export material Cotton_Denim_Carbon(*) +[[ + ::anno::display_name("Cotton Denim - Carbon"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Denim.Cotton_Denim_Carbon.png"), + ::anno::key_words(string[]("fabric", "woven","cotton", "denim", "clothing", "thin", "sheen", "fashion", "new", "carbon", "neutral", "dark")) +]] = Cotton_Denim( + fabric_color_1: color(0.027321f, 0.027321f, 0.043735f), + fabric_color_2: color(0.122139f, 0.135633f, 0.212231f), + roughness: 0.61f, + sheen_weight: 1.0f, + bump_strength: 1.00f, + warp_intensity: 0.05f, + washed_tint: color(1.0f), + wash: 0.05f, + wash_scale: 0.59f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 4 +export material Cotton_Denim_Black(*) +[[ + ::anno::display_name("Cotton Denim - Black"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Denim.Cotton_Denim_Black.png"), + ::anno::key_words(string[]("fabric", "woven","cotton", "denim", "clothing", "thin", "sheen", "fashion", "new", "black", "dark", "neutral")) +]] = Cotton_Denim( + fabric_color_1: color(0.014444f, 0.014444f, 0.014444f), + fabric_color_2: color(0.155926f, 0.165132f, 0.212231f), + roughness: 0.61f, + sheen_weight: 1.0f, + bump_strength: 1.00f, + warp_intensity: 0.05f, + washed_tint: color(1.0f), + wash: 0.05f, + wash_scale: 0.59f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 5 +export material Cotton_Denim_Washed_Blue(*) +[[ + ::anno::display_name("Cotton Denim - Washed Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Denim.Cotton_Denim_Washed_Blue.png"), + ::anno::key_words(string[]("fabric", "woven","cotton", "denim", "clothing", "thin", "sheen", "fashion", "washed", "blue", "cool")) +]] = Cotton_Denim( + fabric_color_1: color(0.014444f, 0.031896f, 0.040915f), + fabric_color_2: color(0.313989f, 0.341914f, 0.462077f), + roughness: 0.61f, + sheen_weight: 1.0f, + bump_strength: 1.00f, + warp_intensity: 0.05f, + washed_tint: color(1.0f), + wash: 1.0f, + wash_scale: 0.59f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 6 +export material Cotton_Denim_Light_Blue(*) +[[ + ::anno::display_name("Cotton Denim - Light Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Denim.Cotton_Denim_Light_Blue.png"), + ::anno::key_words(string[]("fabric", "woven","cotton", "denim", "clothing", "thin", "sheen", "fashion", "new", "blue", "cool", "light")) +]] = Cotton_Denim( + fabric_color_1: color(0.051269f, 0.127438f, 0.219526f), + fabric_color_2: color(0.191202f, 0.300544f, 0.479320f), + roughness: 0.61f, + sheen_weight: 1.0f, + bump_strength: 1.00f, + warp_intensity: 0.05f, + washed_tint: color(1.0f), + wash: 0.17f, + wash_scale: 0.59f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 7 +export material Cotton_Denim_Bleached_Light_Blue(*) +[[ + ::anno::display_name("Cotton Denim - Bleached Light Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Denim.Cotton_Denim_Bleached_Light_Blue.png"), + ::anno::key_words(string[]("fabric", "woven","cotton", "denim", "clothing", "thin", "sheen", "fashion", "bleached", "blue", "cool", "light")) +]] = Cotton_Denim( + fabric_color_1: color(0.361307f, 0.514918f, 0.730461f), + fabric_color_2: color(0.107023f, 0.234551f, 0.479320f), + roughness: 0.61f, + sheen_weight: 1.0f, + bump_strength: 1.00f, + warp_intensity: 0.05f, + washed_tint: color(1.0f), + wash: 0.95f, + wash_scale: 0.59f, + 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/Fabric/Cotton_French_Terry.mdl b/code/third_party/vMaterials_2/Fabric/Cotton_French_Terry.mdl new file mode 100644 index 0000000000000000000000000000000000000000..212a17c1b67e12223eed3eb6b3d1899f473eafc9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Cotton_French_Terry.mdl @@ -0,0 +1,904 @@ +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A french terry material made from cotton with adjustable color."; + +annotation preview_scale( float f); + +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 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; +} + +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 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)); +} + +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; +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + return uv_in; // Test if this causes the crash + //return uv; //The expected return +} + +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); +} + +::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(); +} + +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_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 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); +} + +export material Cotton_French_Terry( + color fabric_color = color(0.982251f, 0.791298f, 0.693872f) [[ + ::anno::description("Choose the color of the French Terry fabric."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.58f [[ + ::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 fuzz_weight = 0.12f [[ + ::anno::description("Adds a white fuzz layer on the material which gives it a more used appearance."), + ::anno::display_name("Fuzz Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float sheen_weight = 0.38f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float translucency_amount = 0.33f [[ + ::anno::description("A value of 0 makes the material completely opaque. Increasing the parameter value lets more light pass through the material."), + ::anno::display_name("Translucency Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = .95f [[ + ::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(5) + ]], + float warp_intensity = 0.f [[ + ::anno::description("Adds a little bit of distortion to break up the perfectly regular appearance of the weaving."), + ::anno::display_name("Warp Intensity"), + ::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.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)), + ::preview_scale(3.5f), + ::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("Transform"), + ::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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Oyster"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "oyster", "light", "pastel")) +]] + = + let { + bool tmp0 = false; + // One tile of the fabric texture covers is 16.5mm. Compensate for that. + // 1000mm / 16.5mm = ~60.6 + float2 texture_rescale = texture_scale/float2(60.6); + float remap_bump_strength = bump_strength * 2.0f; + + texture_2d tex_resource_01 = texture_2d("./textures/cotton_french_terry_R_diff_G_rough_B_ao_A_height.png", ::tex::gamma_linear); + texture_2d tex_resource_02 = texture_2d("./textures/french_terry_fabric_warp.png", ::tex::gamma_linear); + texture_2d tex_resource_03 = texture_2d("./textures/fibers.jpg", ::tex::gamma_linear); + texture_2d tex_resource_04 = texture_2d("./textures/cotton_french_terry_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(0.00999999978f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).tint).z, 0.429999977f, 0.681200027f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).tint).y, 0.98999995f, roughness * 0.300000012f + 0.600000024f) * histogram_range(float3(vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).tint).y, 0.98999995f, roughness * 0.300000012f + 0.600000024f), histogram_range(float3(vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).tint).y, 0.98999995f, roughness * 0.300000012f + 0.600000024f) * histogram_range(float3(vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).tint).y, 0.98999995f, roughness * 0.300000012f + 0.600000024f), 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(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).mono, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, float3(vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).tint).x, 1.f)), ::base::color_layer_multiply, 1.f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(tex_resource_03, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(7.f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.51999998f), 0.f), bsdf(), vm_tex_normal_lookup(tex_resource_04, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), remap_bump_strength)), vm_tex_normal_lookup(tex_resource_04, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), remap_bump_strength))), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).mono, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, float3(vm_tex_lookup(tex_resource_01, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), mono_a, float4(1.f)).tint).x, 1.f)), ::base::color_layer_multiply, 1.f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(tex_resource_03, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(7.f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.51999998f), 0.f), bsdf(), vm_tex_normal_lookup(tex_resource_04, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), remap_bump_strength)), vm_tex_normal_lookup(tex_resource_04, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), remap_bump_strength)), vm_tex_normal_lookup(tex_resource_04, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), remap_bump_strength)), vm_tex_normal_lookup(tex_resource_04, vm_coord_warp(vm_tex_lookup(tex_resource_02, vm_coord(float2(0.f), 0.f, texture_rescale * float2(7.77777719f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, true, true), remap_bump_strength)), 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 Cotton_French_Terry_Sand(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Sand"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Sand.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "warm", "sand", "light", "pastel")) +]] = Cotton_French_Terry( + fabric_color: color(0.745404f, 0.630757f, 0.590619f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "gray", "grey", "neutral")) +]] = Cotton_French_Terry( + fabric_color: color(0.571125f, 0.571125f, 0.571125f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Harbor_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Harbor Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Harbor_Gray.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "gray", "light", "pastel")) +]] = Cotton_French_Terry( + fabric_color: color(0.527115f, 0.584078f, 0.545724f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Brown(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Brown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Brown.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "brown", "warm")) +]] = Cotton_French_Terry( + fabric_color: color(0.391572f, 0.234551f, 0.215861f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Saffron(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Saffron"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Saffron.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "saffron", "orange", "warm", "saturated")) +]] = Cotton_French_Terry( + fabric_color: color(0.597202f, 0.283149f, 0.088656f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Terracotta(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Terracotta"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Terracotta.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "terracotta", "saturated", "warm", "red")) +]] = Cotton_French_Terry( + fabric_color: color(0.715694f, 0.219526f, 0.119538f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Petrol(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Petrol"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Petrol.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "petrol", "cool", "blue")) +]] = Cotton_French_Terry( + fabric_color: color(0.242281f, 0.417885f, 0.514918f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Electric_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Electric Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Electric_Blue.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "light", "saturated", "blue")) +]] = Cotton_French_Terry( + fabric_color: color(0.191202f, 0.552011f, 0.723055f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Mid_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Mid Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Mid_Gray.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "gray", "neutral")) +]] = Cotton_French_Terry( + fabric_color: color(0.187821f, 0.171441f, 0.181164f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Dark_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Dark Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Blue.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "dark", "blue", "cool")) +]] = Cotton_French_Terry( + fabric_color: color(0.122139f, 0.152926f, 0.254152f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Dark_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Dark Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Gray.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "dark", "gray", "neutral")) +]] = Cotton_French_Terry( + fabric_color: color(0.107023f, 0.090842f, 0.104616f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Olive_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Olive Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Olive_Green.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "green", "olive")) +]] = Cotton_French_Terry( + fabric_color: color(0.234551f, 0.208637f, 0.090842f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Burgundy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Burgundy"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Burgundy.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "red", "saturated", "warm", "burgundy")) +]] = Cotton_French_Terry( + fabric_color: color(0.309469f, 0.080220f, 0.114435f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Shrimp(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Shrimp"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Shrimp.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "light", "red", "warm", "pastel", "shrimp")) +]] = Cotton_French_Terry( + fabric_color: color(0.760525f, 0.456411f, 0.445201f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Fuchsia(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Fuchsia"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fuchsia.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "red", "warm", "fuchsia", "saturated")) +]] = Cotton_French_Terry( + fabric_color: color(0.686685f, 0.198069f, 0.304987f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + + +export material Cotton_French_Terry_Fox_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::display_name("Cotton French Terry - Fox Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fox_Red.png"), + ::anno::key_words(string[]("fabric", "woven", "terry", "cotton", "translucent", "clothing", "thin", "sheen", "fashion", "bumped", "new", "red", "saturated", "warm")) +]] = Cotton_French_Terry( + fabric_color: color(0.496933f, 0.093059f, 0.114435f), + roughness: 0.58f, + fuzz_weight: 0.12f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.95f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Fabric/Cotton_Oxford.mdl b/code/third_party/vMaterials_2/Fabric/Cotton_Oxford.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c240b17c5e98075d1756898699ec481ece7c7c14 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Cotton_Oxford.mdl @@ -0,0 +1,923 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A cotton oxford material that features two colors, translucency as well as " + "adjustable sheen when viewing the material at grazing angles."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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 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)); +} + +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); +} + +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 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 histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +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; +} + +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)); +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + 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(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); +} + +::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 Cotton_Oxford( + color fabric_color = color(0.854993f, 0.791298f, 0.658375f) [[ + ::anno::description("Choose the first color of the fabric."), + ::anno::display_name("Primary Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color fabric_color_1 = color(0.623960f, 0.577580f, 0.479320f) [[ + ::anno::description("Choose the secondary color of the fabric."), + ::anno::display_name("Secondary Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float fiber_structure = 1.f [[ + ::anno::description("Makes fibers and the weaving of the fabric appear more pronounced which darkens the appearance of the fabric in turn."), + ::anno::display_name("Fiber Structure"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = 0.89f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float fuzz_weight = 0.36f [[ + ::anno::description("Adds a white fuzz layer on the material which gives it a more used appearance."), + ::anno::display_name("Fuzz Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float sheen_weight = 0.47f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float translucency_amount = 0.34f [[ + ::anno::description("The amount of translucency on the material."), + ::anno::display_name("Translucency Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float warp_intensity = 0.f [[ + ::anno::description("Warps the texture to produce a less evenly woven result."), + ::anno::display_name("Warp Intensity"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + 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(9) + ]], + 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(10) + ]], + 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)), + ::preview_scale(3.5f), + ::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("Transform"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::display_name("Cotton Oxford - Oyster"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "oyster", "light", "warm")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.064; // Cotton Oxford covers 64mm - set texture scale to the correct + // default scale value + + texture_2d multi_tex = texture_2d("./textures/cot_ox_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d warp_tex = texture_2d("./textures/fabric_warp.jpg", ::tex::gamma_linear); + texture_2d diff_mask_tex = texture_2d("./textures/cot_ox_R_diff_G_mask.jpg", ::tex::gamma_linear); + texture_2d fibers_tex = texture_2d("./textures/fibers.jpg", ::tex::gamma_linear); + texture_2d normal_tex = texture_2d("./textures/cot_ox_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(0.00999999978f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, 0.429999977f, 0.573899984f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).x, 1.f, roughness) * histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).x, 1.f, roughness), histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).x, 1.f, roughness) * histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).x, 1.f, 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(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(translucency_amount * 0.100000001f, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint)).x, ::math::min(rgb2hsl(float3(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint)).y, ::math::pow(rgb2hsl(float3(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).x, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint, color(::math::pow(::math::lerp(1.f, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).x, fiber_structure), 1.32999992f)), ::base::color_layer_multiply, 1.f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.5f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 0.f), ::state::normal())), ::df::weighted_layer(translucency_amount * 0.100000001f, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint)).x, ::math::min(rgb2hsl(float3(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint)).y, ::math::pow(rgb2hsl(float3(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).x, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, fabric_color_1, ::base::color_layer_blend, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).y, true).tint, color(::math::pow(::math::lerp(1.f, float3(vm_tex_lookup(diff_mask_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), mono_a, float4(1.f)).tint).x, fiber_structure), 1.32999992f)), ::base::color_layer_multiply, 1.f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.5f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 0.f), ::state::normal()), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f), emission_intensity: color(0.f, 0.f, 0.f)); + material_geometry tmp5(float3(0.f), 1.f, vm_tex_normal_lookup(normal_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(1.62f, 1.52999997f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.0299999993f, false, true), bump_strength)); + 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 Cotton_Oxford_Fog(*) +[[ + ::anno::display_name("Cotton Oxford - Fog"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Fog.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "fog", "light", "neutral")) + +]] = Cotton_Oxford( + fabric_color: color(0.296138f, 0.274677f, 0.230740f), + fabric_color_1: color(0.768151f, 0.768151f, 0.768151f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 3 +export material Cotton_Oxford_Sand(*) +[[ + ::anno::display_name("Cotton Oxford - Sand"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Sand.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "sand", "light", "warm")) +]] = Cotton_Oxford( + fabric_color: color(0.462077f, 0.391572f, 0.287441f), + fabric_color_1: color(0.871367f, 0.715694f, 0.496933f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 4 +export material Cotton_Oxford_Pepper(*) +[[ + ::anno::display_name("Cotton Oxford - Pepper"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Pepper.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "pepper", "brown")) +]] = Cotton_Oxford( + fabric_color: color(0.033105f, 0.026241f, 0.018500f), + fabric_color_1: color(0.871367f, 0.715694f, 0.496933f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 5 +export material Cotton_Oxford_Tobacco(*) +[[ + ::anno::display_name("Cotton Oxford - Tobacco"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Tobacco.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "tobacco", "brown")) +]] = Cotton_Oxford( + fabric_color: color(0.132868f, 0.078187f, 0.034340f), + fabric_color_1: color(0.445201f, 0.283149f, 0.141263f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 6 +export material Cotton_Oxford_Coffee_Bean(*) +[[ + ::anno::display_name("Cotton Oxford - Coffee Bean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Coffee_Bean.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "coffee", "brown", "dark")) +]] = Cotton_Oxford( + fabric_color: color(0.107023f, 0.074214f, 0.068478f), + fabric_color_1: color(0.036889f, 0.025187f, 0.024158f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.1f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 7 +export material Cotton_Oxford_Carbon(*) +[[ + ::anno::display_name("Cotton Oxford - Carbon"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Carbon.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "carbon", "dark", "neutral")) +]] = Cotton_Oxford( + fabric_color: color(0.029557f, 0.035601f, 0.039546f), + fabric_color_1: color(0.068478f, 0.074214f, 0.088656f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.1f, + sheen_weight: 0.61f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 8 +export material Cotton_Oxford_Saffron(*) +[[ + ::anno::display_name("Cotton Oxford - Saffron"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Saffron.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "saffron", "yellow", "saturated", "warm")) +]] = Cotton_Oxford( + fabric_color: color(0.745404f, 0.318547f, 0.010960f), + fabric_color_1: color(0.775822f, 0.514918f, 0.011612f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 9 +export material Cotton_Oxford_Paprika(*) +[[ + ::anno::display_name("Cotton Oxford - Paprika"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Paprika.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "paprika", "orange", "red", "saturated", "warm")) +]] = Cotton_Oxford( + fabric_color: color(0.679542f, 0.040915f, 0.018500f), + fabric_color_1: color(0.658375f, 0.191202f, 0.061246f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 10 +export material Cotton_Oxford_Garnet(*) +[[ + ::anno::display_name("Cotton Oxford - Garnet"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Garnet.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "garnet", "red", "saturated", "warm")) +]] = Cotton_Oxford( + fabric_color: color(0.187821f, 0.012286f, 0.028426f), + fabric_color_1: color(0.391572f, 0.022174f, 0.052861f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 11 +export material Cotton_Oxford_Jungle(*) +[[ + ::anno::display_name("Cotton Oxford - Jungle"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Jungle.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "jungle", "green", "saturated")) +]] = Cotton_Oxford( + fabric_color: color(0.025187f, 0.048172f, 0.018500f), + fabric_color_1: color(0.052861f, 0.171441f, 0.051269f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 12 +export material Cotton_Oxford_Green_Tea(*) +[[ + ::anno::display_name("Cotton Oxford - Green Tea"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Green_Tea.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "tea", "green", "saturated", "light")) +]] = Cotton_Oxford( + fabric_color: color(0.158961f, 0.234551f, 0.008023f), + fabric_color_1: color(0.327778f, 0.434154f, 0.061246f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 13 +export material Cotton_Oxford_Peacock(*) +[[ + ::anno::display_name("Cotton Oxford - Peacock"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Peacock.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "peacock", "blue", "saturated", "cool", "dark")) +]] = Cotton_Oxford( + fabric_color: color(0.013702f, 0.054480f, 0.082283f), + fabric_color_1: color(0.109462f, 0.246201f, 0.283149f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 14 +export material Cotton_Oxford_Fuchsia(*) +[[ + ::anno::display_name("Cotton Oxford - Fuchsia"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Peacock.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "fuchsia", "pink", "saturated")) +]] = Cotton_Oxford( + fabric_color: color(0.223228f, 0.040915f, 0.124772f), + fabric_color_1: color(0.564712f, 0.116971f, 0.327778f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// 15 +export material Cotton_Oxford_Plum(*) +[[ + ::anno::display_name("Cotton Oxford - Plum"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Plum.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "plum", "violet", "purple", "saturated")) +]] = Cotton_Oxford( + fabric_color: color(0.070360f, 0.021219f, 0.095307f), + fabric_color_1: color(0.304987f, 0.109462f, 0.381326f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 16 +export material Cotton_Oxford_Blue_Jay(*) +[[ + ::anno::display_name("Cotton Oxford - Blue Jay"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Blue_Jay.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "blue", "saturated", "cool")) +]] = Cotton_Oxford( + fabric_color: color(0.029557f, 0.093059f, 0.274677f), + fabric_color_1: color(0.102242f, 0.219526f, 0.520996f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.36f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 17 +export material Cotton_Oxford_Ink(*) +[[ + ::anno::display_name("Cotton Oxford - Ink"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Oxford.Cotton_Oxford_Ink.png"), + ::anno::key_words(string[]("fabric", "woven","clothing", "thin", "sheen", "fashion", "new", "blue", "ink", "saturated", "cool", "dark")) +]] = Cotton_Oxford( + fabric_color: color(0.008568f, 0.026241f, 0.088656f), + fabric_color_1: color(0.026241f, 0.095307f, 0.366253f), + fiber_structure: 1.0f, + roughness: 0.89f, + fuzz_weight: 0.0f, + sheen_weight: 0.47f, + translucency_amount: 0.34f, + warp_intensity: 0.0f, + bump_strength: 1.0f, + 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/Fabric/Cotton_Roughly_Woven.mdl b/code/third_party/vMaterials_2/Fabric/Cotton_Roughly_Woven.mdl new file mode 100644 index 0000000000000000000000000000000000000000..adf18f93bc84396b9690930995337eea3996efc6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Cotton_Roughly_Woven.mdl @@ -0,0 +1,445 @@ +/****************************************************************************** + * 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"; + +annotation preview_scale( float f); + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + +export material Cotton_Roughly_Woven( + uniform bool infinite_tiling = true [[ + ::anno::display_name("Infinite Tiling"), + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns."), + ::anno::in_group("Appearance") + ]], + color fabric_color = color(0.796917f, 0.796917f, 0.796917f) [[ + ::anno::display_name("Fabric Color"), + ::anno::description("Sets the color of the fabric."), + ::anno::in_group("Appearance") + ]], + float fabric_brightness = 0.5f [[ + ::anno::display_name("Fabric Brightness"), + ::anno::description("Adjusts the brightness of the fabric."), + ::anno::hard_range(0.0, 1.0), + ::anno::in_group("Appearance") + ]], + float fabric_bump_factor = 1.f [[ + ::anno::display_name("Fabric Bump Factor"), + ::anno::description("Adjusts the bump intensity of the surface."), + ::anno::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, 1.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.0f, 1.0f)), + ::preview_scale(4.5f), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Use selected UV space for material."), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cotton Roughly Woven - Beige"), + ::anno::description("A roughly woven cotton fabric."), + ::anno::key_words(string[]("fabric", "cotton", "new", "cloth", "fashion", "organic", "rough", "woven", "design", "upholstery", "infinite tiling", "brown")), + ::anno::thumbnail("./.thumbs/Cotton_Roughly_Woven.Cotton_Roughly_Woven.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = false; + + float2 corrected_scale = 0.165 * texture_scale; + + material_surface tmp1( + ::df::custom_curve_layer(0.121000007f, 1.f, 5.f, 0.465000033f, ::df::microfacet_ggx_smith_bsdf(histogram_range(infinite_tiling ? float3(endless_texture(texture_2d("./textures/cotton_roughly_woven_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false))[0] : ::base::file_texture(texture_2d("./textures/cotton_roughly_woven_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, 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).mono, 0.195000008f, 0.823000014f) * histogram_range(infinite_tiling ? float3(endless_texture(texture_2d("./textures/cotton_roughly_woven_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false))[0] : ::base::file_texture(texture_2d("./textures/cotton_roughly_woven_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, 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).mono, 0.195000008f, 0.823000014f), histogram_range(infinite_tiling ? float3(endless_texture(texture_2d("./textures/cotton_roughly_woven_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false))[0] : ::base::file_texture(texture_2d("./textures/cotton_roughly_woven_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, 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).mono, 0.195000008f, 0.823000014f) * histogram_range(infinite_tiling ? float3(endless_texture(texture_2d("./textures/cotton_roughly_woven_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false))[0] : ::base::file_texture(texture_2d("./textures/cotton_roughly_woven_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, 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).mono, 0.195000008f, 0.823000014f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors((infinite_tiling ? endless_texture(texture_2d("./textures/cotton_roughly_woven_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, true) : ::base::file_texture(texture_2d("./textures/cotton_roughly_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, 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) * color(::math::lerp(0.649999976f, 1.f, fabric_brightness)), fabric_color, ::base::color_layer_overlay, 1.f).tint, 0.f, ""), ::state::normal()), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); + material_geometry tmp5( + float3(0.f), + 1.f, + infinite_tiling ? endless_normal(texture_2d("./textures/cotton_roughly_woven_norm.jpg", ::tex::gamma_linear), fabric_bump_factor, 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/cotton_roughly_woven_norm.jpg", ::tex::gamma_linear), fabric_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_Cotton_Roughly_Woven_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cotton Roughly Woven - Orange"), + ::anno::description("A roughly woven cotton fabric."), + ::anno::key_words(string[]("fabric", "cotton", "new", "cloth", "fashion", "organic", "rough", "woven", "design", "upholstery", "infinite tiling", "orange", "warm")), + ::anno::thumbnail("./.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Cotton_Roughly_Woven( + infinite_tiling: true, + fabric_color: color(0.673049f, 0.353741f, 0.018913f), + fabric_brightness: 0.5f, + fabric_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_Cotton_Roughly_Woven_Cheery_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cotton Roughly Woven - Cherry Red"), + ::anno::description("A roughly woven cotton fabric."), + ::anno::key_words(string[]("fabric", "cotton", "new", "cloth", "fashion", "organic", "rough", "woven", "design", "upholstery", "infinite tiling", "red", "cherry", "warm")), + ::anno::thumbnail("./.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Cheery_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Cotton_Roughly_Woven( + infinite_tiling: true, + fabric_color: color(0.659224f, 0.054592f, 0.030257f), + fabric_brightness: 0.5f, + fabric_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_Cotton_Roughly_Woven_Dark_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cotton Roughly Woven - Dark Red"), + ::anno::description("A roughly woven cotton fabric."), + ::anno::key_words(string[]("fabric", "cotton", "new", "cloth", "fashion", "organic", "rough", "woven", "design", "upholstery", "infinite tiling", "dark", "red", "warm")), + ::anno::thumbnail("./.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Cotton_Roughly_Woven( + infinite_tiling: true, + fabric_color: color(0.242796f, 0.010398f, 0.058187f), + fabric_brightness: 0.5f, + fabric_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_Cotton_Roughly_Woven_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cotton Roughly Woven - Green"), + ::anno::description("A roughly woven cotton fabric."), + ::anno::key_words(string[]("fabric", "cotton", "new", "cloth", "fashion", "organic", "rough", "woven", "design", "upholstery", "infinite tiling", "green")), + ::anno::thumbnail("./.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Cotton_Roughly_Woven( + infinite_tiling: true, + fabric_color: color(0.259027f, 0.529523f, 0.014311f), + fabric_brightness: 0.5f, + fabric_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_Cotton_Roughly_Woven_Dark_Ash(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cotton Roughly Woven - Dark Ash"), + ::anno::description("A roughly woven cotton fabric."), + ::anno::key_words(string[]("fabric", "cotton", "new", "cloth", "fashion", "organic", "rough", "woven", "design", "upholstery", "infinite tiling", "ash", "dark", "blue", "gray")), + ::anno::thumbnail("./.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Ash.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Cotton_Roughly_Woven( + infinite_tiling: true, + fabric_color: color(0.016988f, 0.038473f, 0.086901f), + fabric_brightness: 0.5f, + fabric_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/Fabric/Cotton_Single_Jersey.mdl b/code/third_party/vMaterials_2/Fabric/Cotton_Single_Jersey.mdl new file mode 100644 index 0000000000000000000000000000000000000000..920769c52959fcf29af0a9d3be32f7f6d5daf4c6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Cotton_Single_Jersey.mdl @@ -0,0 +1,1297 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A single jersey cotton material which features adjustable translucency as well as " + "a sheen effect that can be seen when viewing the material at grazing angles."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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 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)); +} + +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); +} + +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 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 histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +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; +} + +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)); +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + 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(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); +} + +::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 Cotton_Single_Jersey( + color fabric_color = color(0.84f, 0.84f, 0.84f) [[ + ::anno::description("Adjusts the color of the jersey material."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.74f [[ + ::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 fuzz_weight = 0.05f [[ + ::anno::description("Adds a white fuzz layer on the material which gives it a more used appearance."), + ::anno::display_name("Fuzz Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float sheen_weight = 0.38f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float translucency_amount = 0.33f [[ + ::anno::description("A value of 0 makes the material completely opaque. Increasing the parameter value lets more light pass through the material."), + ::anno::display_name("Translucency Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.39f [[ + ::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(5) + ]], + float warp_intensity = 0.f [[ + ::anno::description("Adds a little bit of distortion to break up the perfectly regular appearance of the weaving."), + ::anno::display_name("Warp Intensity"), + ::anno::in_group("Appearance"), + ::anno::soft_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.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)), + ::preview_scale(3.5f), + ::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("Transform"), + ::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.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(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) + ]]) +[[ + ::anno::display_name("Cotton Single Jersey - White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "white", "light", "neutral")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.05f; // texture covers 5 cm, scale up so it covers 1m per default + + texture_2d diff_texture = texture_2d("./textures/single_jersey_R_diff.jpg", ::tex::gamma_linear); + texture_2d multi_tex = texture_2d("./textures/single_jersey_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d fabric_warp_tex = texture_2d("./textures/fabric_warp.jpg", ::tex::gamma_linear); + texture_2d fibers_tex = texture_2d("./textures/fibers.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/single_jersey_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(0.0599999987f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.429999977f, 0.681200027f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.98999995f, roughness * 0.300000012f + 0.600000024f) * histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.98999995f, roughness * 0.300000012f + 0.600000024f), histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.98999995f, roughness * 0.300000012f + 0.600000024f) * histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.98999995f, roughness * 0.300000012f + 0.600000024f), 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(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::weighted_layer(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.75999999f, 0.25f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup(diff_texture, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 0.479999989f)), ::base::color_layer_multiply, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.680000007f, 0.469999999f)), ::base::color_layer_multiply, bump_strength, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.29999995f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength))), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::weighted_layer(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.75999999f, 0.25f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup(diff_texture, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 0.479999989f)), ::base::color_layer_multiply, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.680000007f, 0.469999999f)), ::base::color_layer_multiply, bump_strength, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.29999995f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), 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); + +// 2 +export material Cotton_Single_Jersey_Silver(*) +[[ + ::anno::display_name("Cotton Single Jersey - Silver"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Silver.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "silver", "gray", "light", "neutral")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.502886f, 0.502886f, 0.502886f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +// 3 +export material Cotton_Single_Jersey_Gray(*) +[[ + ::anno::display_name("Cotton Single Jersey - Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Gray.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "gray", "neutral")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.258183f, 0.258183f, 0.258183f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 4 +export material Cotton_Single_Jersey_Charcoal(*) +[[ + ::anno::display_name("Cotton Single Jersey - Charcoal"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Charcoal.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "white", "dark", "neutral")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.114435f, 0.114435f, 0.114435f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 5 +export material Cotton_Single_Jersey_Black(*) +[[ + ::anno::display_name("Cotton Single Jersey - Black"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Black.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "black", "dark", "neutral")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.033105f, 0.033105f, 0.033105f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 6 +export material Cotton_Single_Jersey_Khaki(*) +[[ + ::anno::display_name("Cotton Single Jersey - Khaki"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Khaki.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "khaki", "light", "brown")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.558340f, 0.445201f, 0.296138f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 7 +export material Cotton_Single_Jersey_Almond(*) +[[ + ::anno::display_name("Cotton Single Jersey - Almond"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Almond.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "almond", "brown")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.423268f, 0.205079f, 0.064803f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 8 +export material Cotton_Single_Jersey_Cinnamon(*) +[[ + ::anno::display_name("Cotton Single Jersey - Cinnamon"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Cinnamon.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "cinnamon", "brown", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.266356f, 0.104616f, 0.027321f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 9 +export material Cotton_Single_Jersey_Terracotta(*) +[[ + ::anno::display_name("Cotton Single Jersey - Terracotta"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Terracotta.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "terracotta", "brown", "warm", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.473531f, 0.149960f, 0.034340f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 10 +export material Cotton_Single_Jersey_Red(*) +[[ + ::anno::display_name("Cotton Single Jersey - Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Red.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "red", "saturated", "warm")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.701102f, 0.051269f, 0.051269f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 11 +export material Cotton_Single_Jersey_Brick_Red(*) +[[ + ::anno::display_name("Cotton Single Jersey - Brick Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Brick_Red.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "red", "warm", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.467784f, 0.052861f, 0.040915f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 12 +export material Cotton_Single_Jersey_Burgundy(*) +[[ + ::anno::display_name("Cotton Single Jersey - Burgundy"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "burgundy", "red", "warm", "saturated", "dark")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.287441f, 0.027321f, 0.111932f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 13 +export material Cotton_Single_Jersey_Raspberry(*) +[[ + ::anno::display_name("Cotton Single Jersey - Raspberry"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Raspberry.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "red", "raspberry", "warm", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.467784f, 0.040915f, 0.187821f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 14 +export material Cotton_Single_Jersey_Bubblegum(*) +[[ + ::anno::display_name("Cotton Single Jersey - Bubblegum"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Bubblegum.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "pink", "bubblegum", "light", "warm")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.775822f, 0.332452f, 0.571125f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 15 +export material Cotton_Single_Jersey_Shrimp(*) +[[ + ::anno::display_name("Cotton Single Jersey - Shrimp"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Shrimp.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "salmon", "shrimp", "light", "warm")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.768151f, 0.407240f, 0.386429f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 16 +export material Cotton_Single_Jersey_Lemon(*) +[[ + ::anno::display_name("Cotton Single Jersey - Lemon"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lemon.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "lemon", "yellow", "bright", "saturated", "warm")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.791298f, 0.791298f, 0.064803f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 17 +export material Cotton_Single_Jersey_Orange(*) +[[ + ::anno::display_name("Cotton Single Jersey - Orange"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Orange.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "orange", "saturated", "bright", "warm")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.715694f, 0.230740f, 0.052861f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 18 +export material Cotton_Single_Jersey_Mint(*) +[[ + ::anno::display_name("Cotton Single Jersey - Mint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Mint.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "mint", "green", "light")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.462077f, 0.752942f, 0.456411f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 19 +export material Cotton_Single_Jersey_Lime(*) +[[ + ::anno::display_name("Cotton Single Jersey - Lime"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lime.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "lime", "green", "bright", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.391572f, 0.708376f, 0.059511f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 20 +export material Cotton_Single_Jersey_Grass_Green(*) +[[ + ::anno::display_name("Cotton Single Jersey - Grass Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Grass_Green.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "green", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.052861f, 0.439657f, 0.052861f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 21 +export material Cotton_Single_Jersey_Hunter_Green(*) +[[ + ::anno::display_name("Cotton Single Jersey - Hunter Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Hunter_Green.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "green", "dark", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.013702f, 0.205079f, 0.012286f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 22 +export material Cotton_Single_Jersey_Slate(*) +[[ + ::anno::display_name("Cotton Single Jersey - Slate"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Slate.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "slate", "blue", "cool")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.242281f, 0.238398f, 0.775822f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 23 +export material Cotton_Single_Jersey_Turquoise(*) +[[ + ::anno::display_name("Cotton Single Jersey - Turquoise"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Turquoise.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "turquoise", "bright", "saturated", "cool")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.051269f, 0.597202f, 0.603827f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 24 +export material Cotton_Single_Jersey_Teal(*) +[[ + ::anno::display_name("Cotton Single Jersey - Teal"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Teal.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "teal", "bright", "blue", "cool")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.052861f, 0.346704f, 0.630757f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 25 +export material Cotton_Single_Jersey_Royal_Blue(*) +[[ + ::anno::display_name("Cotton Single Jersey - Royal Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Royal_Blue.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "blue", "saturated", "cool")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.080220f, 0.080220f, 0.630757f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 26 +export material Cotton_Single_Jersey_Navy_Blue(*) +[[ + ::anno::display_name("Cotton Single Jersey - Navy Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Navy_Blue.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "blue", "dark", "cool", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.031896f, 0.031896f, 0.304987f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 27 +export material Cotton_Single_Jersey_Purple(*) +[[ + ::anno::display_name("Cotton Single Jersey - Purple"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Purple.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "purple", "saturated", "dark")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.270498f, 0.025187f, 0.270498f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 28 +export material Cotton_Single_Jersey_Plum(*) +[[ + ::anno::display_name("Cotton Single Jersey - Plum"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Plum.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "plum", "purple", "violet", "saturated")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.564712f, 0.057805f, 0.450786f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + +// 29 +export material Cotton_Single_Jersey_Amethyst(*) +[[ + ::anno::display_name("Cotton Single Jersey - Amethyst"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Amethyst.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "shirt", "amethyst", "light", "violet")) +]] = Cotton_Single_Jersey( + fabric_color: color(0.450786f, 0.296138f, 0.644480f), + roughness: 0.74f, + fuzz_weight: 0.05f, + sheen_weight: 0.38f, + translucency_amount: 0.33f, + bump_strength: 0.5f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); diff --git a/code/third_party/vMaterials_2/Fabric/Cotton_Twill_Gabardine.mdl b/code/third_party/vMaterials_2/Fabric/Cotton_Twill_Gabardine.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a09d573328c70982ad9c8934bc03ff37fcade93f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Cotton_Twill_Gabardine.mdl @@ -0,0 +1,934 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A cotton twill gabardine material."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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 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)); +} + +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); +} + +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 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 histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +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; +} + +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)); +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + 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(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); +} + +::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 Cotton_Twill_Gabardine( + color fabric_color = color(0.223228f, 0.283149f, 0.109462f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float fabric_reflectivity = 1.f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float fuzz_weight = 0.08f [[ + ::anno::description("Adds a white fuzz layer on the material which gives it a more used appearance."), + ::anno::display_name("Fuzz Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float sheen_weight = 0.f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float translucency_amount = 0.33f [[ + ::anno::description("A value of 0 makes the material completely opaque. Increasing the parameter value lets more light pass through the material."), + ::anno::display_name("Translucency Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + 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, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float warp_intensity = 0.f [[ + ::anno::description("Adds a little bit of distortion to break up the perfectly regular appearance of the weaving."), + ::anno::display_name("Warp Intensity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 5.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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) + ]], + 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) + ]], + float2 texture_scale = float2(1.0f, 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)), + ::preview_scale(float(3.5f)), + ::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) + ]], + 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(12) + ]], + 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(13) + ]], + 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(14) + ]]) +[[ + ::anno::display_name("Cotton Twill Gabardine - Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "green")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.055; // texture covers 5.5 cm, scale up so it covers 1m per default + texture_2d multi_tex = texture_2d("./textures/twill_gabardine_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d warp_tex = texture_2d("./textures/twill_gabardine_fabric_warp.png", ::tex::gamma_linear); + texture_2d diff_tex = texture_2d("./textures/twill_gabardine_R_diff.jpg", ::tex::gamma_srgb); + texture_2d norm_tex = texture_2d("./textures/twill_gabardine_norm.jpg", ::tex::gamma_linear); + texture_2d fibers_tex = texture_2d("./textures/fibers.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(fabric_reflectivity * 0.0500000007f + 0.00999999978f, 1.f, 2.65999985f, ::math::pow(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.429999977f, 0.588699996f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.779999971f, roughness * 0.300000012f + 0.600000024f) * histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.779999971f, roughness * 0.300000012f + 0.600000024f), histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.779999971f, roughness * 0.300000012f + 0.600000024f) * histogram_range(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 0.779999971f, roughness * 0.300000012f + 0.600000024f), color(1.f, 1.f, 1.f), hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.74000001f, 1.f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::weighted_layer(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.75999999f, 0.25f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(histogram_range(vm_tex_lookup(diff_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 1.f, 0.799999952f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.469999999f, 0.109999999f)), ::base::color_layer_multiply, bump_strength, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.29999995f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength))), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::weighted_layer(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.75999999f, 0.25f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(histogram_range(vm_tex_lookup(diff_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 1.f, 0.799999952f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.469999999f, 0.109999999f)), ::base::color_layer_multiply, bump_strength, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.29999995f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), 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); + +// 2 +export material Cotton_Twill_Gabardine_Oyster(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Oyster"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Oyster.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "white", "oyster", "light", "neutral")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.651406f, 0.603827f, 0.502886f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 3 +export material Cotton_Twill_Gabardine_Sand(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Sand"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Sand.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "sand", "warm", "light")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.564712f, 0.467784f, 0.341914f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 4 +export material Cotton_Twill_Gabardine_Black_Pepper(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Black Pepper"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Black_Pepper.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "papper", "dark", "brown", "black", "neutral")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.09989872825f, 0.08650046204f, 0.0703600957f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 5 +export material Cotton_Twill_Gabardine_Tobacco(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Tobacco"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Tobacco.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "tobacco", "brown", "saturated")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.2345505822f, 0.1356333297f, 0.05612849005f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 6 +export material Cotton_Twill_Gabardine_Carbon(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Carbon"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Carbon.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "carbon", "dark", "black")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.02315336618f, 0.02732089164f, 0.03189603307f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 7 +export material Cotton_Twill_Gabardine_Charcoal(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Charcoal"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Charcoal.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "white", "light", "neutral")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.1221387722f, 0.1301364767f, 0.138431615f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 8 +export material Cotton_Twill_Gabardine_Fog(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Fog"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fog.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "white", "light", "fog", "neutral")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.4564110232f, 0.4286904966f, 0.4019777798f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 9 +export material Cotton_Twill_Gabardine_Saffron(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Saffron"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Saffron.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "saffron", "orange", "warm", "saturated")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.6104955708f, 0.2622506575f, 0.009134058702f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 10 +export material Cotton_Twill_Gabardine_Paprika(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Paprika"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Paprika.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "orange", "red", "saturated", "warm")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.479320f, 0.099899f, 0.054480f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 11 +export material Cotton_Twill_Gabardine_Garnet(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Garnet"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Garnet.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "white", "light")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.2158605001f, 0.01370208305f, 0.03071344373f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 12 +export material Cotton_Twill_Gabardine_Jungle(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Jungle"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Jungle.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "green", "jungle", "dark")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.02518685963f, 0.04666508634f, 0.02028856306f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 13 +export material Cotton_Twill_Gabardine_Fuchsia(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Fuchsia"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fuchsia.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "fuchsia", "purple", "saturated", "magenta", "violet")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.3864294338f, 0.05612849005f, 0.1946178304f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 14 +export material Cotton_Twill_Gabardine_Aubergine(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Aubergine"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Aubergine.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "purple", "dark", "violet")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.06847816984f, 0.01938236096f, 0.08021982031f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 15 +export material Cotton_Twill_Gabardine_Morning_Glory(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Morning Glory"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Morning_Glory.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "blue", "cool")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.1094617108f, 0.1144353738f, 0.3049873141f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 16 +export material Cotton_Twill_Gabardine_Blue_Jay(*) +[[ + ::anno::display_name("Cotton Twill Gabardine - Blue Jay"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Blue_Jay.png"), + ::anno::key_words(string[]("fabric", "woven", "cotton", "clothing", "thin", "sheen", "fashion", "new", "twill", "gabardine", "blue", "cool")) +]] = Cotton_Twill_Gabardine( + fabric_color: color(0.07227185068f, 0.1844749945f, 0.4793201831f), + roughness: 0.6f, + fabric_reflectivity: 1.0f, + fuzz_weight: 0.08f, + sheen_weight: 0.0f, + translucency_amount: 0.33f, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); diff --git a/code/third_party/vMaterials_2/Fabric/Fabric_Cotton_Fine_Woven.mdl b/code/third_party/vMaterials_2/Fabric/Fabric_Cotton_Fine_Woven.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7651c787dd73089a61deba0df5ef603aa0b49ced --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Fabric_Cotton_Fine_Woven.mdl @@ -0,0 +1,519 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.4; + + +import ::base::*; +import ::anno::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +const string DESCRITPION = +"A fine woven cotton material with tweakable reflectivity and infinite tiling"; + +annotation preview_scale( float f); + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + +export material Fabric_Cotton_Fine_Woven( + uniform bool infinite_tiling = false [[ + ::anno::display_name("Infinite Tiling"), + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns."), + ::anno::in_group("Appearance") + ]], + color fabric_color = color(0.851252f, 0.851252f, 0.851252f) [[ + ::anno::display_name("Fabric Color"), + ::anno::description("Sets the color of the fabric."), + ::anno::in_group("Appearance") + ]], + float fabric_brightness = 0.5f [[ + ::anno::display_name("Fabric Brightness"), + ::anno::description("Adjusts the brightness of the fabric."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fabric_reflectivity = 0.5f [[ + ::anno::display_name("Fabric Reflectivity"), + ::anno::description("Adjusts the amount of light that the fabric is reflecting."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fabric_bump_factor = 1.f [[ + ::anno::display_name("Fabric Bump Factor"), + ::anno::description("Adjusts the bump intensity of the surface."), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance") + ]], + uniform float2 texture_translate = 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::display_name("Rotate"), + ::anno::description("Rotates the material."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2(1.0f) [[ + ::anno::display_name("Scale"), + ::anno::description("Scales the material."), + ::nvidia::core_definitions::dimension(float2(.5f, .5f)), + ::preview_scale(4.5f), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Use selected UV space for material."), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Light Gray"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural" )) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.11f; // texture covers 11 cm, scale up so it covers 1m per default + + + material_surface tmp1( + ::df::custom_curve_layer(0.121000007f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.944000065f, ::math::lerp(0.850000024f, 0.600000024f, fabric_reflectivity)), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.195000008f, 0.823000014f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.195000008f, 0.823000014f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.195000008f, 0.823000014f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.195000008f, 0.823000014f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors((infinite_tiling ? endless_texture(texture_2d("./textures/fine_woven_cotton_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.474999994f, 0.463f, 0.486000001f), 4.f, true) : ::base::file_texture(texture_2d("./textures/fine_woven_cotton_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.649999976f, 1.f, fabric_brightness)), fabric_color, ::base::color_layer_overlay, 1.f).tint, 0.f, ""), ::state::normal()), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); + material_geometry tmp5( + float3(0.f), + 1.f, + infinite_tiling ? endless_normal(texture_2d("./textures/fine_woven_cotton_norm.jpg", ::tex::gamma_linear), fabric_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.5f, 0.5f, 1.f), 4.f) : normalmap_normal(texture_2d("./textures/fine_woven_cotton_norm.jpg", ::tex::gamma_linear), fabric_bump_factor, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +// 2 +export material Fabric_Cotton_Fine_Woven_Yellow(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Yellow"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Yellow.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "yellow", "warm" )) +]] + = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.673049f, 0.409826f, 0.005028f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 3 +export material Fabric_Cotton_Fine_Woven_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Orange"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Orange.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "orange", "warm" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.673049f, 0.227137f, 0.018913), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 4 +export material Fabric_Cotton_Fine_Woven_Cheery_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Cherry Red"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Cheery_Red.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "red", "cherry", "warm" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.659224f, 0.054592f, 0.030257f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 5 +export material Fabric_Cotton_Fine_Woven_Dark_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Dark Red"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Red.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "dark", "red", "warm" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.242796f, 0.010398f, 0.026549f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 6 +export material Fabric_Cotton_Fine_Woven_Dark_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Dark Green"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Green.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "dark", "green" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.071761f, 0.151058f, 0.001963), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 7 +export material Fabric_Cotton_Fine_Woven_Petrol(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Petrol"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Petrol.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "petrol", "blue", "cool" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.133209f, 0.238828f, 0.442323f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 8 +export material Fabric_Cotton_Fine_Woven_Light_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Light Blue"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Light_Blue.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "light", "blue", "cool" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.091518f, 0.453456f, 0.827726f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Fabric/Fabric_Cotton_Pique_Weave.mdl b/code/third_party/vMaterials_2/Fabric/Fabric_Cotton_Pique_Weave.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bc00d5b8dcc269d2a7b403e0c52d162ead404777 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Fabric_Cotton_Pique_Weave.mdl @@ -0,0 +1,577 @@ +/****************************************************************************** + * 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 woven fabric material."; + +annotation preview_scale( float f); + + +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); +} + + +::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 1 + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization + */ + + // 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 Fabric_Cotton_Pique_Weave( + color fabric_tint = color(0.829883f, 0.443634f, 0.153424f) [[ + ::anno::description("Tints the fabric."), + ::anno::display_name("Fabric_Tint"), + ::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 weave_airyness = 0.85f [[ + ::anno::description("Specifies the density of the woven material. An airier weave makes light shine through the fabric."), + ::anno::display_name("Weave Airyness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float bump_strength = 1.f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 3.f) + ]], + 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.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(1.00f, 1.00f)), + ::preview_scale(5.f), + ::anno::in_group("Transform") + ]], + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Cotton Pique Weave - Marigold"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "orange", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.11f; // texture covers 11 cm, scale up so it covers 1m per default + + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[1], 0.5f, 0.647476017f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[0], 1.f, ::math::lerp(0.479999989f, 0.899999976f, roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[0], 1.f, ::math::lerp(0.479999989f, 0.899999976f, roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[0], 1.f, ::math::lerp(0.479999989f, 0.899999976f, roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[0], 1.f, ::math::lerp(0.479999989f, 0.899999976f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[1], 0.531000018f, 0.349999994f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/pique_weave_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[1], 4.4000001f)), ::base::color_layer_multiply, 0.f).tint, fabric_tint, ::base::color_layer_overlay, 1.f).tint), ::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/pique_weave_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[1], 4.4000001f)), ::base::color_layer_multiply, 0.f).tint, fabric_tint, ::base::color_layer_overlay, 1.f).tint, 0.f), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./textures/pique_weave_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, 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, 1.f, 0.f)), ::base::tangent_space_normal_texture(texture_2d("./textures/pique_weave_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, 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, 1.f, 0.f)), ::base::tangent_space_normal_texture(texture_2d("./textures/pique_weave_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, 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, 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), histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_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)[2], 0.493000031f, ::math::lerp(0.200000003f, 0.409999996f, weave_airyness)), round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + +// 2 +export material Fabric_Cotton_Pique_Weave_Carulean(*) +[[ + ::anno::display_name("Cotton Pique Weave - Carulean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Carulean.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "blue", "cool")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.360016f, 0.459865f, 0.596528f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 3 +export material Fabric_Cotton_Pique_Weave_Rust(*) +[[ + ::anno::display_name("Cotton Pique Weave - Rust"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Rust.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "rust", "orange", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.463972f, 0.186721f, 0.125669), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +// 4 +export material Fabric_Cotton_Pique_Weave_Yellow(*) +[[ + ::anno::display_name("Cotton Pique Weave - Yellow"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Yellow.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "yellow", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.768958f, 0.664642f, 0.144562f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 5 +export material Fabric_Cotton_Pique_Weave_French_Blue(*) +[[ + ::anno::display_name("Cotton Pique Weave - French Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_French_Blue.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "blue", "cool")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.463972f, 0.186721f, 0.125669), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 6 +export material Fabric_Cotton_Pique_Weave_Green_Ash(*) +[[ + ::anno::display_name("Cotton Pique Weave - Green Ash"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Green_Ash.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "pastel", "green")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.385591f, 0.644771f, 0.439627f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 7 +export material Fabric_Cotton_Pique_Weave_Burnt_Coral(*) +[[ + ::anno::display_name("Cotton Pique Weave - Burnt Coral"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Burnt_Coral.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "coral", "pink", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.731504f, 0.315048f, 0.288993f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 8 +export material Fabric_Cotton_Pique_Weave_Mint(*) +[[ + ::anno::display_name("Cotton Pique Weave - Mint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Mint.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "mint", "green")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.027755f, 0.451710f, 0.258142f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 9 +export material Fabric_Cotton_Pique_Weave_Amethyst(*) +[[ + ::anno::display_name("Cotton Pique Weave - Amethyst"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Amethyst.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.342333f, 0.212702f, 0.419884f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 10 +export material Fabric_Cotton_Pique_Weave_Raspberry(*) +[[ + ::anno::display_name("Cotton Pique Weave - Raspberry"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Raspberry.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "raspberry", "red", "pink", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.577802f, 0.138104f, 0.252200f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 11 +export material Fabric_Cotton_Pique_Weave_Inkwell(*) +[[ + ::anno::display_name("Cotton Pique Weave - Inkwell"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Inkwell.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.123658f, 0.133888f, 0.155684f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 12 +export material Fabric_Cotton_Pique_Weave_Gray(*) +[[ + ::anno::display_name("Cotton Pique Weave - Ultimate Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Gray.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "gray", "neutral")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.352885f, 0.363611f, 0.370860f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 13 +export material Fabric_Cotton_Pique_Weave_Buttercream(*) +[[ + ::anno::display_name("Cotton Pique Weave - Buttercream"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Buttercream.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "pastel", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.463972f, 0.186721f, 0.125669), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +// 14 +export material Fabric_Cotton_Pique_Weave_Desert_Mist(*) +[[ + ::anno::display_name("Cotton Pique Weave - Desert Mist"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Desert_Mist.png"), + ::anno::key_words(string[]("fabric", "woven", "rough", "thin", "new", "desert", "sand", "orange", "warm")), + ::anno::author("NVIDIA vMaterials") +]] + = Fabric_Cotton_Pique_Weave +( + fabric_tint: color(0.669661f, 0.472246f, 0.308419f), + roughness: 0.5f, + weave_airyness: 0.9f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + diff --git a/code/third_party/vMaterials_2/Fabric/Felt_Plain.mdl b/code/third_party/vMaterials_2/Fabric/Felt_Plain.mdl new file mode 100644 index 0000000000000000000000000000000000000000..50cea9823ad2c2212a839cf299106cd62c7dcbf3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Felt_Plain.mdl @@ -0,0 +1,1480 @@ +/****************************************************************************** + * 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 ::anno::*; +import ::math::*; +import ::tex::*; +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"; + +annotation preview_scale( float f); + +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; +} + + + +export material Felt_Plain ( + color base_color = color(0.034230f, 0.373615f, 0.058187f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0f + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15f + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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 texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(1.8f), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Tournament Green"), + ::anno::description("Felt template material from which all the other presets are derived."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "red", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Plain.png"), + ::anno::hidden(), + ::anno::copyright_notice(COPYRIGHT) +]] = let +{ + // Felt Texture, the texture of the felt material + uniform texture_2d felt_texture = texture_2d("./textures/felt_white_diff.jpg", ::tex::gamma_srgb); + + // Fuzz Texture + uniform texture_2d felt_fuzz_texture = texture_2d("./textures/felt_fuzz_mask.jpg", ::tex::gamma_srgb); + + + + ::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(8.f/texture_scale.x, 8.f/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_return felt_texture_return = ::base::file_texture( + texture: felt_texture, + mono_source: ::base::mono_alpha, + uvw: transformed_uvw + ); + + ::base::texture_return fuzz_texture_return = ::base::file_texture( + texture: felt_fuzz_texture, + color_scale: color(fuzz_opacity * 0.5), + mono_source: ::base::mono_average, + uvw: transformed_uvw + ); + + ::base::texture_return tinted_felt_color = nvidia::core_definitions::blend_colors( + color_1: felt_texture_return.tint, + color_2: base_color, + mode: ::base::color_layer_multiply, + weight: 1.0 + ); + + + color felt_color = ::math::max(tinted_felt_color.tint, color((1.0-fill_dark_gaps) * 0.3) * base_color); + + + ::base::texture_return final_color = nvidia::core_definitions::blend_colors( + color_1: felt_color, + color_2: color(1.0, 1.0, 1.0), + mode: ::base::color_layer_blend, + weight: fuzz_texture_return.mono + ); + + + + float3 bump = ::nvidia::core_definitions::file_bump_texture( + texture: felt_texture, + bump_source: ::base::mono_average, + scaling: float2 ((8.f/texture_scale.x), (8.f/ texture_scale.y)), + translation: texture_translate, + rotation: texture_rotate, + clip: false, + factor: bump_strength, + texture_space: uv_space_index + ); + + bsdf diffuse = ::df::diffuse_reflection_bsdf ( + tint: final_color.tint + + ); + + bsdf base = ::df::custom_curve_layer( + weight: felt_texture_return.mono * .15f, + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + base: diffuse, + layer: ::df::simple_glossy_bsdf( + roughness_u: .85, + tint: color(1.0, 1.0, 1.0) + ) + ); + + +} in material ( + surface: material_surface ( + scattering: base + ), + geometry: material_geometry( + normal: bump + ) +); + + + + +// Red +export material Felt_Mat_Red ( + color base_color = color(0.535642f, 0.007155f, 0.007155f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + + 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 texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Red"), + ::anno::description("Felt template material from which all the other presets are derived."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "red", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + + +// Burgundy +export material Felt_Mat_Burgundy ( + color base_color = color(0.464741f, 0.014311f, 0.038473f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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 texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Burgundy"), + ::anno::description("Felt template material from which all the other presets are derived."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "burgundy", "red", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Burgundy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + + +// Brick +export material Felt_Mat_Brick ( + color base_color = color(0.554227f, 0.061907f, 0.042987f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Brick"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "burgundy", "red", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Brick.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + +// Brown +export material Felt_Mat_Brown ( + color base_color = color(0.250840f, 0.071761f, 0.026549f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Brown"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "burgundy", "brown")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Brown.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + +// Taupe +export material Felt_Mat_Taupe ( + color base_color = color(0.197516f, 0.116576f, 0.091518) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Taupe"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "taupe", "brown")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Taupe.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + +// Golden +export material Felt_Mat_Golden ( + color base_color = color(0.701170f, 0.431340f, 0.091518f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Golden"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "golden", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Golden.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + + + +// Khaki +export material Felt_Mat_Khaki ( + color base_color = color(0.487765f, 0.399293f, 0.242796f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Khaki"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "khaki", "brown")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Khaki.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + + + + + +// Steel Gray +export material Felt_Mat_Steelgray ( + color base_color = color(0.271577f, 0.302125f, 0.311180f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Steel Gray"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "neutral", "gray", "steel")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Steelgray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + + +// Navy Blue +export material Felt_Mat_Navyblue ( + color base_color = color(0.008373f, 0.023104f, 0.119264f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Navy Blue"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "navy", "blue", "dark", "cool")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Navyblue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + +export material Felt_Mat_Charcoal ( + color base_color = color(0.035614f, 0.039947f, 0.041452f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Charcoal"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "charcoal", "dark")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Charcoal.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + + + +// Euro Blue +export material Felt_Mat_Euroblue ( + color base_color = color(0.011881f, 0.084642f, 0.632043f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Euro Blue"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "euro", "union", "cool", "blue", "saturated", "intense")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Euroblue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + + + +export material Felt_Mat_Electricblue ( + color base_color = color(0.089194f, 0.325037f, 0.875138f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Electric Blue"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "electric", "blue", "cool")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Electricblue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + + + + +// Academy Blue +export material Felt_Mat_Academyblue ( + color base_color = color(0.007155f, 0.133209f, 0.535642f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Academy Blue"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "academy", "blue", "cool", "dark")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Academyblue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + +// Black +export material Felt_Mat_Black ( + color base_color = color(0.08f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Black"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "black", "neutral", "dark")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Black.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + +// Dark Green +export material Felt_Mat_Darkgreen ( + color base_color = color(0.004560f, 0.106156f, 0.016068f) + [[ + ::anno::display_name("Base color"), + ::anno::description("The base color of the material."), + ::anno::in_group("Appearance") + ]], + float fill_dark_gaps = 1.0 + [[ + ::anno::display_name("Felt Contrast"), + ::anno::description("Specifies how string the strong the occlusion in the texture shows through."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fuzz_opacity = 0.15 + [[ + ::anno::display_name("Fuzz Opacity"), + ::anno::soft_range(0.0, 1.0), + ::anno::description("The amount of fuzz visible on the felt material."), + ::anno::in_group("Appearance") + ]], + + /* Transform */ + 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::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2 ( 1.f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + /* Advanced */ + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::hard_range(0,3), + ::anno::in_group("Advanced") + ]], + + uniform float bump_strength = 4.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::soft_range(0.0f, 5.0f), + ::anno::description("Controls the amount of the bump mapping effect."), + ::anno::in_group("Appearance") + ]] +) [[ + ::anno::display_name("Felt Dark Green"), + ::anno::description("A soft felt material that can have fuzz on top."), + ::anno::key_words (string[]("aec", "fabric", "felt", "fashion", "textile", "soft", "design", "fuzz", "green", "dark")), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Felt_Plain.Felt_Mat_Darkgreen.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Felt_Plain( + base_color: base_color, + fill_dark_gaps: fill_dark_gaps, + fuzz_opacity: fuzz_opacity, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + bump_strength: bump_strength +); + + diff --git a/code/third_party/vMaterials_2/Fabric/Polyester_Charmeuse.mdl b/code/third_party/vMaterials_2/Fabric/Polyester_Charmeuse.mdl new file mode 100644 index 0000000000000000000000000000000000000000..22fe3ff24f80264c9530b2eaa37a29a3232ec2fb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Polyester_Charmeuse.mdl @@ -0,0 +1,1034 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +annotation preview_scale( float f); + +// 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)); +} + +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); +} + +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))); +} + +float4 rand_tile_id_lookup( + ::base::texture_coordinate_info uvw = ::base::coordinate_source(::base::texture_coordinate_uvw, 0), + uniform texture_2d id_offset_tex = texture_2d() // map containing the ID in r channel + //and the cell offset in g channel. + ) +[[ + ::anno::noinline() +]] +{ + float4 ret_val; + int offset_x, offset_y; + + // the rand tiles texture must be sampled exactly, so texel lookup is the function we will be using here + int2 texel_coord = int2(int(::math::frac(uvw.position.x) * ::tex::width(id_offset_tex)), + int(::math::frac(uvw.position.y) * ::tex::height(id_offset_tex))); + float3 id_offset_map_2 = ::tex::texel_float3(id_offset_tex, texel_coord); + + float offset_id = id_offset_map_2.y; + int rand_id = int(id_offset_map_2.x * 254.f); // the more logical value of 255 causes sometimes rendering artifacts + // with the random number generator. Setting it to 254 apparently fixes it + + // Offset of overlapping tiles stored in G-channel + // [0 - 0.25[ : ( 0/ 0) Grayscale value: 0.1 + // [0.25 - 0.5 [ : (-1/ 0) Grayscale value: 0.37 + // [0.5 - 0.75[ : (-1/-1) Grayscale value: 0.62 + // [0.75 - 1.0 [ : ( 0/-1) Grayscale value: 0.87 + + offset_x = offset_id < 0.25f ? 0 : (offset_id < .75f) ? 1 : 0; + offset_y = offset_id < 0.5 ? 0 : 1; + + int2 cell_id = int2(int(::math::floor(uvw.position.x) - offset_x), int(::math::floor(uvw.position.y) - offset_y)); + + int rand_val_1 = lowbias32(rand_id + lowbias32(cell_id.x + lowbias32(cell_id.y))); + int rand_val_2 = lowbias32(rand_val_1); + int rand_val_3 = lowbias32(rand_val_2); + int rand_val_4 = lowbias32(rand_val_3); + ret_val = float4(uint2float(rand_val_1), + uint2float(rand_val_2), + uint2float(rand_val_3), + uint2float(rand_val_4)); + + return float4(ret_val/4294967296.f); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(1.0f) +) +{ + return ::base::texture_coordinate_info( + position: float3(uvw.position.x / scale.x, + uvw.position.y / scale.y, + uvw.position.z / scale.x), + 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; +} + +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)); +} + + + +// +// flake noise utilities +// +// constants for numerical fitted curve to observed flake noise density behavior +// 1. no jitter, maximum flake diameter +const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f); +const float2 EF = float2(-101.42634862f, 118.45082288f); +// 2. jitter scale of 0.5f, maximum flake diameter +const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f); +const float2 EF_J = float2(-3.11456809f, 2.63430594f); + +float density_to_probability( + float4 abcd, + float2 ef, + float x) +{ + float xx = x * x; + return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y); +} + + +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return ::math::abs(float(seed) * 4.6566e-10f); +} + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = ::math::PI * 2.0f * xi.x; + float phi = ::math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = ::math::sqrt(z); + float[2] sp_cp = ::math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = ::math::sqrt(2.0f - z); + + float[2] st_ct = ::math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +struct flake_noise_value { + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + // Stores values from the functions (once normal, another time the color) + // current pseudo random number generator seed + int rnd_seed; + float4 carrier; +}; + +// flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f) +{ + float3 base_pos = ::math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0, float4(0.0)); + + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int k = -1; k < 2; ++k) { + + int seed = rnd_init(base_pos_i + int3(i, j, k)); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (math::abs(p.x) <= flake_diameter && + ::math::abs(p.y) <= flake_diameter && + ::math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + +flake_noise_value flake_noise( + float3 position, + float density = 0.5f, + bool jittered = false) // jittered: slightly slower and slightly less uniform +{ + float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, ::math::saturate(density)); + + return flake_noise(pos: position, jitter_scale: jittered ? 0.5f : 0.0f, flake_diameter: (jittered ? 1.25f : 1.5f) / ::math::sqrt(3.0f), flake_probability: probability); +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +flake_noise_value flake_normal( + flake_noise_value val, + float spread) +{ + if (val.priority <= 0.0f) + { + val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0); + return val; + } + + // int seed0 = rnd_next(val.rnd_seed); + // float xi0 = rnd_value(seed0); + // float xi1 = rnd_value(rnd_next(seed0)); + + int seed = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed); + seed = rnd_next(seed); + float xi1 = rnd_value(seed); + + float phi = ::math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1)); + float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta); + float costheta = ::math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = ::math::sincos(phi); + + val.rnd_seed = seed; + + // return + // ::state::texture_tangent_u(0) * scphi[1] * sintheta + + // ::state::texture_tangent_v(0) * scphi[0] * sintheta + + // ::state::normal() * costheta; + float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta + + ::state::texture_tangent_v(0) * scphi[0] * sintheta + + ::state::normal() * costheta; + + val.carrier = float4(normal.x, normal.y, normal.z, 1.0); + + + return val; +} + + + + + +export material Polyester_Charmeuse( + color fabric_color = color(0.98f, 0.98f, 0.98f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float color_deviation = 0.f [[ + ::anno::description("Adds a variation to the reflection colors of the fabric. Higher values lead to more drastical color changes."), + ::anno::display_name("Color Deviation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float highlight_saturation = 0.79f [[ + ::anno::description("Higher values cause reflected light to be tinted in the color of the material."), + ::anno::display_name("Highlight Saturation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float diffuse_weight = 0.0f [[ + ::anno::description("Increasing the diffuse contribution make the material appear more flat and takes away some of its shininess."), + ::anno::display_name("Diffuse Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float transmissive_weight = 0.16f [[ + ::anno::description("Lets light pass through the material and illuminate it from the other side."), + ::anno::display_name("Translucency"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.71f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 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)), + ::preview_scale(2.5f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]] + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - White"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "white", "light", "neutral")) +]] + = + let { + // These parameters could be exposed globally, however, they are set as constants in the material + float weft_deviation = 0.41f; // note that a stronger deviation will lead to clipping behavior of the + // bsdfs when viewing them at grazing angles + float warp_to_weft = 0.26f; + float middle_lobe_weight = 0.26f; + + + // The next parameters control the width of the highlight + float warp_roughness = 0.1f; // Width of the warp roughness + float weft_roughness = 0.09f; // Width of the weft roughness + float warpweft_noise_amount = 1.0f; // we use noise to introduce irregularities in the appearance of the + // BDSF across the material surface + + texture_2d weave_normal_texture = texture_2d("./textures/charmeuse_weaving_02_norm.png", ::tex::gamma_linear); + texture_2d weave_random_texture = texture_2d("./textures/charmeuse_weaving_02_R_id_G_offs.png", ::tex::gamma_linear); + texture_2d glizz_texture = texture_2d("./textures/fabric_noise_multi_R_noise1_G_noise_2.png", ::tex::gamma_linear); + + // preparing fabric colors + // We will be deriving all colors of the fabric from a single color which requires some amount of remapping + // the values in HSL space and then converting them back to RGB + float3 fabric_hsl_color = rgb2hsl(float3(fabric_color)); + + color diffuse_transmission_color = hsl2rgb( + float3( fabric_hsl_color.x, + fabric_hsl_color.y * ::math::pow(fabric_hsl_color.z, 0.26f), + 0.76f + ) + ); + + float remap_thread_brightness = fabric_hsl_color.z * 0.85 + 0.15; + + color warp_color = hsl2rgb( + float3( fabric_hsl_color.x - (color_deviation * 0.3), // - Shifting color by color deviation + ::math::lerp(0.0f, highlight_saturation, fabric_hsl_color.y * 0.85f), //scaling the max saturation down by 15% + remap_thread_brightness) // remapping brightness for weft highlight + ); + + color weft_color = hsl2rgb( + float3( fabric_hsl_color.x + (color_deviation * 0.3), // + Shifting color by color deviation + ::math::lerp(0.0f, highlight_saturation, fabric_hsl_color.y * 0.85f), + remap_thread_brightness + ) + ); + + // Prepare UV coordinates for texture and noise lookups + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale * 0.4f, // scale to fit default size of 1m for UV 0...1 + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + ::base::texture_coordinate_info uvw_post = vmat_transform_post_scale(uvw: uvw, scale: float2(0.004f)); + + // Flake normal + flake_noise_value flake_noise_val = flake_noise( + position: float3(uvw.position * 2500.0f), + density: 0.72f, + jittered: true + ); + + flake_noise_value flake_noise_val2 = flake_normal( + val: flake_noise_val, + spread: 0.38f // controllable from outside + ); + + float3 flake_normal = float3(flake_noise_val2.carrier.x, flake_noise_val2.carrier.y, flake_noise_val2.carrier.z); + + // TEXTURES + // Glizz noise textures + float3 glizz_lookup = tex::lookup_float3( + glizz_texture, + float2(uvw.position.x,uvw.position.y) + ); + + + // Weave normal + float4 rand_val = rand_tile_id_lookup( + uvw: uvw_post, // we use the downscaled small UV cordinates here + id_offset_tex: weave_random_texture // special texture that allows us to randomize the height of the single weaves + ); + + float3 weave_normal = normalmap_normal( + texture: weave_normal_texture, + factor: ::math::lerp(bump_strength* 0.4f, bump_strength * 0.86f, rand_val.x), // lerping the random values and scaling by bump_strength + uvw: uvw_post // we use the downscaled small UV cordinates here + ); + + // BSDFs + // (single) Warp BSDF + bsdf warp_bsdf = ::df::simple_glossy_bsdf( + roughness_u: 0.88f, + roughness_v: histogram_range(glizz_lookup.x, warpweft_noise_amount, warp_roughness), // adjusting noise texture to show some glizzening effect + tint: warp_color, + tangent_u: uvw.tangent_u, // required to rotate the anisotropic highlight correctly + mode: ::df::scatter_reflect + ); + + // (triple) Weft BSDF + bsdf weft_bsdf = ::df::microfacet_ggx_smith_bsdf( + roughness_u: histogram_range(glizz_lookup.y, warpweft_noise_amount, weft_roughness), // adjusting noise texture to show some glizzening effect + roughness_v: 0.58f, + tint: weft_color, + multiscatter_tint: weft_color, + tangent_u: uvw.tangent_u // required to rotate the anisotropic highlight correctly + ); + + float3 weft_left_normal = ::math::normalize(::state::normal() - uvw.tangent_u * weft_deviation); + float3 weft_right_normal = ::math::normalize(::state::normal() + uvw.tangent_u * weft_deviation); + + //adding flake detail normals + float3 weft_left_detail_normal = add_detail_normal( + n: weft_left_normal, // left-shifted normal + nd: flake_normal + ); + + float3 weft_right_detail_normal = add_detail_normal( + n: weft_right_normal, // right-shifted normal + nd: flake_normal + ); + + // Left lobe with detail normal + bsdf left_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: weft_left_detail_normal + ); + + // Right lobe with detail normal + bsdf right_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: weft_right_detail_normal + ); + + // Middle lobe + bsdf middle_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: flake_normal + ); + + + bsdf left_right_lobe_bsdf = ::df::weighted_layer( + base: left_lobe_bsdf, + layer: right_lobe_bsdf, + weight: 0.5f + ); + + bsdf left_right_middle_lobe_bsdf = ::df::weighted_layer( + base: left_right_lobe_bsdf, + layer: middle_lobe_bsdf, + weight: middle_lobe_weight + ); + + // Warp and Weft BSDF combined and weighted via custom curve layer + bsdf warp_weft_combined_bsdf = ::df::custom_curve_layer( + base: df::weighted_layer( + layer: warp_bsdf, + base: left_right_middle_lobe_bsdf, + weight: warp_to_weft > 1.0f ? 1.0 - 1.0f / warp_to_weft : warp_to_weft + ), + layer: bsdf(), + normal_reflectivity: 0.11f, + grazing_reflectivity: 1.0f, + exponent: 3.63f, + weight: 1.0f + ); + + + // Diffuse Transmission BSDF + bsdf diff_transmission_bsdf = ::df::diffuse_transmission_bsdf( + tint: diffuse_transmission_color + ); + + // Diffuse Reflection BSDF + bsdf diff_reflection_bsdf = ::df::diffuse_reflection_bsdf( + tint: fabric_color + ); + + + // Computing weight contributions for the BSDF components dc_3, dc_2 and dc_1 for final mix + ::df::bsdf_component dc_3( + weight: (2.0f - transmissive_weight * 0.68f - diffuse_weight * 0.68f), + component: warp_weft_combined_bsdf + ); + + ::df::bsdf_component dc_2( + weight: transmissive_weight * 0.68f, + component: diff_transmission_bsdf + ); + + ::df::bsdf_component dc_1( + weight: diffuse_weight * 0.68f, + component: diff_reflection_bsdf + ); + + // Final Mix + bsdf final_bsdf = ::df::normalized_mix( + components: ::df::bsdf_component[](dc_3, dc_2, dc_1) + ); + + } in + material( + thin_walled: true, + surface: material_surface( + scattering: final_bsdf + ), + ior: color(1.0f), + geometry: material_geometry( + normal: weave_normal + ) +); + + +// 2 +export material Polyester_Charmeuse_Silver(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Silver"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Silver.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "silver", "light", "neutral")) +]] = Polyester_Charmeuse( + fabric_color: color(0.571125f, 0.571125f, 0.672443f), + color_deviation: 0.09f, + highlight_saturation: 0.79f, + diffuse_weight: 0.05f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 3 +export material Polyester_Charmeuse_Gold(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Gold"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Gold.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "gold", "warm", "saturated")) +]] = Polyester_Charmeuse( + fabric_color: color(0.571125f, 0.309469f, 0.031896f), + color_deviation: 0.09f, + highlight_saturation: 0.93f, + diffuse_weight: 0.05f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 4 +export material Polyester_Charmeuse_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Red"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Red.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "red", "saturated", "warm")) +]] = Polyester_Charmeuse( + fabric_color: color(0.445201f, 0.003035f, 0.003035f), + color_deviation: 0.00f, + highlight_saturation: 0.98f, + diffuse_weight: 0.05f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 5 +export material Polyester_Charmeuse_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Orange"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Orange.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "orange", "warm", "saturated")) +]] = Polyester_Charmeuse( + fabric_color: color(0.672443f, 0.223228f, 0.003035f), + color_deviation: 0.0f, + highlight_saturation: 0.98f, + diffuse_weight: 0.06f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 6 +export material Polyester_Charmeuse_Purple(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Purple"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Purple.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "purple", "saturated")) +]] = Polyester_Charmeuse( + fabric_color: color(0.337164f, 0.022174f, 0.198069f), + color_deviation: 0.0f, + highlight_saturation: 0.98f, + diffuse_weight: 0.05f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 7 +export material Polyester_Charmeuse_Aqua_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Aqua Blue"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Aqua_Blue.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "aqua", "blue", "saturated", "cool")) +]] = Polyester_Charmeuse( + fabric_color: color(0.006512f, 0.168269f, 0.278894f), + color_deviation: 0.1f, + highlight_saturation: 0.98f, + diffuse_weight: 0.05f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 8 +export material Polyester_Charmeuse_Black(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Black"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Black.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "black", "dark", "neutral")) +]] = Polyester_Charmeuse( + fabric_color: color(0.001821f, 0.001821f, 0.001821f), + color_deviation: 0.00f, + highlight_saturation: 0.49f, + diffuse_weight: 0.93f, + transmissive_weight: 0.21f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 9 +export material Polyester_Charmeuse_Lime_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Lime Green"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lime_Green.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "lime", "green", "saturated")) +]] = Polyester_Charmeuse( + fabric_color: color(0.212231f, 0.337164f, 0.006049f), + color_deviation: 0.09f, + highlight_saturation: 0.99f, + diffuse_weight: 0.05f, + transmissive_weight: 0.21f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 10 +export material Polyester_Charmeuse_Lemon(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Lemon"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lemon.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "lemon", "yellow", "warm", "light", "saturated")) +]] = Polyester_Charmeuse( + fabric_color: color(0.715694f, 0.693872f, 0.004025f), + color_deviation: 0.09f, + highlight_saturation: 0.99f, + diffuse_weight: 0.05f, + transmissive_weight: 0.21f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 11 +export material Polyester_Charmeuse_Teal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Charmeuse - Teal"), + ::anno::description("A polyester material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Teal.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "synthetic", "woven", "charmeuse", "iridescent", "fashion", "design", "dark", "teal", "blue", "saturated", "cool")) +]] = Polyester_Charmeuse( + fabric_color: color(0.003035f, 0.033105f, 0.070360f), + color_deviation: 0.09f, + highlight_saturation: 0.99f, + diffuse_weight: 0.05f, + transmissive_weight: 0.21f, + bump_strength: 0.70f, + 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/Fabric/Polyester_Crepe_de_Chine.mdl b/code/third_party/vMaterials_2/Fabric/Polyester_Crepe_de_Chine.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cb10d9b2f41da6d9f7435f70875d53eef455bb5e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Polyester_Crepe_de_Chine.mdl @@ -0,0 +1,1014 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +annotation preview_scale( float f); + +color vmat_file_texture( + uniform texture_2d texture, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info(), + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0), + uniform tex::wrap_mode wrap_u = tex::wrap_repeat, + uniform tex::wrap_mode wrap_v = tex::wrap_repeat +) +{ + return color(tex::lookup_float3(texture, float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v)); +} + +// 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)); +} + +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); +} + + + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + state::normal() * (lookup.z + (1.0 - factor))); +} + + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(1.0f) +) +{ + return ::base::texture_coordinate_info( + position: float3(uvw.position.x / scale.x, + uvw.position.y / scale.y, + uvw.position.z / scale.x), + 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; +} + +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)); +} + + + +// +// flake noise utilities +// +// constants for numerical fitted curve to observed flake noise density behavior +// 1. no jitter, maximum flake diameter +const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f); +const float2 EF = float2(-101.42634862f, 118.45082288f); +// 2. jitter scale of 0.5f, maximum flake diameter +const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f); +const float2 EF_J = float2(-3.11456809f, 2.63430594f); + +float density_to_probability( + float4 abcd, + float2 ef, + float x) +{ + float xx = x * x; + return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y); +} + + +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return ::math::abs(float(seed) * 4.6566e-10f); +} + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = ::math::PI * 2.0f * xi.x; + float phi = ::math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = ::math::sqrt(z); + float[2] sp_cp = ::math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = ::math::sqrt(2.0f - z); + + float[2] st_ct = ::math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +struct flake_noise_value { + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + // Stores values from the functions (once normal, another time the color) + // current pseudo random number generator seed + int rnd_seed; + float4 carrier; +}; + +// flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f) +{ + float3 base_pos = ::math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0, float4(0.0)); + + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int k = -1; k < 2; ++k) { + + int seed = rnd_init(base_pos_i + int3(i, j, k)); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (math::abs(p.x) <= flake_diameter && + ::math::abs(p.y) <= flake_diameter && + ::math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + +flake_noise_value flake_noise( + float3 position, + float density = 0.5f, + bool jittered = false) // jittered: slightly slower and slightly less uniform +{ + float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, ::math::saturate(density)); + + return flake_noise(pos: position, jitter_scale: jittered ? 0.5f : 0.0f, flake_diameter: (jittered ? 1.25f : 1.5f) / ::math::sqrt(3.0f), flake_probability: probability); +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +flake_noise_value flake_normal( + flake_noise_value val, + float spread) +{ + if (val.priority <= 0.0f) + { + val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0); + return val; + } + + int seed = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed); + seed = rnd_next(seed); + float xi1 = rnd_value(seed); + + float phi = ::math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1)); + float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta); + float costheta = ::math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = ::math::sincos(phi); + + val.rnd_seed = seed; + + float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta + + ::state::texture_tangent_v(0) * scphi[0] * sintheta + + ::state::normal() * costheta; + + val.carrier = float4(normal.x, normal.y, normal.z, 1.0); + + + return val; +} + + + + + +export material Polyester_Crepe_de_Chine( + color fabric_color = color(0.799103f, 0.799103f, 0.799103f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float color_deviation = 0.f [[ + ::anno::description("Adds a variation to the reflection colors of the fabric. Higher values lead to more drastical color changes."), + ::anno::display_name("Color Deviation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float highlight_saturation = 0.9f [[ + ::anno::description("Higher values cause reflected light to be tinted in the color of the material."), + ::anno::display_name("Highlight Saturation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float diffuse_weight = 0.21f [[ + ::anno::description("Increasing the diffuse contribution make the material appear more flat and takes away some of its shininess."), + ::anno::display_name("Diffuse Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float transmissive_weight = 0.16f [[ + ::anno::description("Lets light pass through the material and illuminate it from the other side."), + ::anno::display_name("Translucency"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.70f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 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)), + ::preview_scale(2.5f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]] + + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - White"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "white", "light", "neutral")) +]] + = + let { + // These parameters could be exposed globally, however, they are set as constants in the material + float weft_deviation = 0.41f; // note that a stronger deviation will lead to clipping behavior of the + // bsdfs when viewing them at grazing angles + float warp_to_weft = 0.22f; + float warp_weft_power = 2.7f; // controls the contrast of the mixing of the warp and weft with the AO texture + + + // The next parameters control the width of the highlight + float warp_roughness = 0.2f; // Width of the warp roughness + float weft_roughness = 0.14f; // Width of the weft roughness + float warpweft_noise_amount = 1.0f; // we use noise to introduce irregularities in the appearance of the + // BDSF across the material surface + + texture_2d weave_normal_texture = texture_2d("./textures/crepe_de_chine_norm.jpg", ::tex::gamma_linear); + texture_2d weave_var_texture = texture_2d("./textures/crepe_de_chine_var.jpg", ::tex::gamma_linear); + texture_2d glizz_texture = texture_2d("./textures/fabric_noise_multi_R_noise1_G_noise_2.png", ::tex::gamma_linear); + + // preparing fabric colors + // We will be deriving all colors of the fabric from a single color which requires some amount of remapping + // the values in HSL space and then converting them back to RGB + float3 fabric_hsl_color = rgb2hsl(float3(fabric_color)); + + color diffuse_transmission_color = hsl2rgb( + float3( fabric_hsl_color.x, + fabric_hsl_color.y * ::math::pow(fabric_hsl_color.z, 0.26f), + 0.76f + ) + ); + + float remap_thread_brightness = fabric_hsl_color.z * 0.85 + 0.15; + + color warp_color = hsl2rgb( + float3( fabric_hsl_color.x - (color_deviation * 0.3), // - Shifting color by color deviation + ::math::lerp(0.0f, highlight_saturation, fabric_hsl_color.y * 0.85f), //scaling the max saturation down by 15% + remap_thread_brightness) // remapping brightness for weft highlight + ); + + color weft_color = hsl2rgb( + float3( fabric_hsl_color.x + (color_deviation * 0.3), // + Shifting color by color deviation + ::math::lerp(0.0f, highlight_saturation, fabric_hsl_color.y * 0.85f), + remap_thread_brightness + ) + ); + + // Prepare UV coordinates for texture and noise lookups + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale * 0.4f, // scale to fit default size of 1m for UV 0...1, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + ::base::texture_coordinate_info uvw_post = vmat_transform_post_scale(uvw: uvw, scale: float2(0.2f)); + + // Flake normal + flake_noise_value flake_noise_val = flake_noise( + position: float3(uvw.position * 2500.0f), + density: 0.72f, + jittered: true + ); + + flake_noise_value flake_noise_val2 = flake_normal( + val: flake_noise_val, + spread: 0.38f // controllable from outside + ); + + float3 flake_normal = float3(flake_noise_val2.carrier.x, flake_noise_val2.carrier.y, flake_noise_val2.carrier.z); + + // TEXTURES + // Glizz noise textures + float3 glizz_lookup = tex::lookup_float3( + glizz_texture, + float2(uvw.position.x,uvw.position.y) + ); + + + // Weave AO/brightness variation + float var_val = float3(vmat_file_texture( + texture: weave_var_texture, + uvw: uvw_post + )).x; + + float var_val_pow = ::math::pow(var_val, warp_weft_power); // the power values controls the contrast of the lookup + // and later in the code the mixing of the warp and weft lobe + + float3 weave_normal = normalmap_normal( + texture: weave_normal_texture, + factor: bump_strength, + uvw: uvw_post // we use the downscaled small UV cordinates here + ); + + // BSDFs + // (single) Warp BSDF + bsdf warp_bsdf = ::df::simple_glossy_bsdf( + roughness_u: 0.88f, + roughness_v: histogram_range(glizz_lookup.x, warpweft_noise_amount, warp_roughness), // adjusting noise texture to show some glizzening effect + tint: warp_color, + tangent_u: uvw.tangent_u, // required to rotate the anisotropic highlight correctly + mode: ::df::scatter_reflect + ); + + // (double) Weft BSDF + bsdf weft_bsdf = ::df::microfacet_ggx_smith_bsdf( + roughness_u: histogram_range(glizz_lookup.y, warpweft_noise_amount, weft_roughness), // adjusting noise texture to show some glizzening effect + roughness_v: 0.58f, + tint: weft_color, + multiscatter_tint: weft_color, + tangent_u: uvw.tangent_u // required to rotate the anisotropic highlight correctly + ); + + float3 weft_left_normal = ::math::normalize(::state::normal() - uvw.tangent_u * weft_deviation); + float3 weft_right_normal = ::math::normalize(::state::normal() + uvw.tangent_u * weft_deviation); + + //adding flake detail normals + float3 weft_left_detail_normal = add_detail_normal( + n: weft_left_normal, // left-shifted normal + nd: flake_normal + ); + + float3 weft_right_detail_normal = add_detail_normal( + n: weft_right_normal, // right-shifted normal + nd: flake_normal + ); + + + // Left lobe with detail normal + bsdf left_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: weft_left_detail_normal + ); + + // Right lobe with detail normal + bsdf right_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: weft_right_detail_normal + ); + + + bsdf left_right_lobe_bsdf = ::df::weighted_layer( + base: left_lobe_bsdf, + layer: right_lobe_bsdf, + weight: 0.5f + ); + + // Warp and Weft BSDF combined and weighted via custom curve layer + bsdf warp_weft_combined_bsdf = ::df::custom_curve_layer( + base: df::weighted_layer( + layer: warp_bsdf, + base: left_right_lobe_bsdf, + weight: var_val_pow * (warp_to_weft > 1.0f ? 1.0 - 1.0f / warp_to_weft : warp_to_weft) + ), + layer: bsdf(), + normal_reflectivity: 0.11f, + grazing_reflectivity: 1.0f, + exponent: 3.63f, + weight: 1.0f + ); + + + // Diffuse Transmission BSDF + bsdf diff_transmission_bsdf = ::df::diffuse_transmission_bsdf( + tint: diffuse_transmission_color + ); + + // Diffuse Reflection BSDF + bsdf diff_reflection_bsdf = ::df::diffuse_reflection_bsdf( + tint: fabric_color + ); + + // Computing weight contributions for the BSDF components dc_3, dc_2 and dc_1 for final mix + ::df::bsdf_component dc_3( + weight: (2.0f - transmissive_weight * 0.68f - diffuse_weight * 0.68f), + component: warp_weft_combined_bsdf + ); + + ::df::bsdf_component dc_2( + weight: transmissive_weight * 0.68f, + component: diff_transmission_bsdf + ); + + ::df::bsdf_component dc_1( + weight: diffuse_weight * 0.68f, + component: diff_reflection_bsdf + ); + + // Final Mix + bsdf final_bsdf = ::df::normalized_mix( + components: ::df::bsdf_component[](dc_3, dc_2, dc_1) + ); + + /* + bsdf transmission_warp_weft_mix = ::df::weighted_layer( + base: warp_weft_combined_bsdf, + layer: diff_transmission_bsdf, + weight: transmissive_weight * 0.68f + ); + + bsdf diffuse_warp_weft_mix = ::df::weighted_layer( + base: warp_weft_combined_bsdf, + layer: diff_reflection_bsdf, + weight: diffuse_weight * 0.68f + ); + + bsdf final_bsdf = ::df::weighted_layer( + base: transmission_warp_weft_mix, + layer: diffuse_warp_weft_mix, + weight: 0.5f + ); + */ + + } in + material( + thin_walled: true, + surface: material_surface( + scattering: final_bsdf + ), + ior: color(1.0f), + geometry: material_geometry( + normal: weave_normal + ) +); + + +// 2 +export material Polyester_Crepe_de_Chine_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Red"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Red.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "red", "warm", "saturated")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.361307f, 0.004777f, 0.004777f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.3f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 3 +export material Polyester_Crepe_de_Chine_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Orange"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Orange.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "orange", "warm", "saturated")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.830770f, 0.132868f, 0.003035f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 4 +export material Polyester_Crepe_de_Chine_Pink(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Pink"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Pink.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "pink", "saturated")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.838799f, 0.027321f, 0.147027f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 5 +export material Polyester_Crepe_de_Chine_Rose(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Rose"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Rose.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "rose", "warm")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.686685f, 0.168269f, 0.278894f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 6 +export material Polyester_Crepe_de_Chine_Purple(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Purple"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Purple.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "purple", "saturated")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.246201f, 0.025187f, 0.177888f), + color_deviation: 0.05f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 7 +export material Polyester_Crepe_de_Chine_Sky_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Sky Blue"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Sky_Blue.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "sky", "blue", "cool")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.080220f, 0.230740f, 0.558340f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 8 +export material Polyester_Crepe_de_Chine_Anthracite(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Anthracite"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Anthracite.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "anthracite", "gray", "dark", "neutral")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.034340f, 0.049707f, 0.052861f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 9 +export material Polyester_Crepe_de_Chine_Petrol(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Petrol"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Petrol.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "petrol", "cool", "saturated")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.003035f, 0.130136f, 0.152926f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 10 +export material Polyester_Crepe_de_Chine_Black(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Black"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Black.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "black", "dark", "neutral")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.003035f, 0.003035f, 0.003035f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 11 +export material Polyester_Crepe_de_Chine_Dark_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Dark Green"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Dark_Green.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "dark", "green", "saturated")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.015996f, 0.109462f, 0.015996f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 12 +export material Polyester_Crepe_de_Chine_Lime_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Polyester Crepe de Chine - Lime Green"), + ::anno::description("A polyester material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Lime_Green.png"), + ::anno::key_words(string[]("fabric", "translucent", "polyester", "woven", "crepe", "chine", "iridescent", "fashion", "design", "synthetic", "lime", "green", "saturated")) +]] = Polyester_Crepe_de_Chine( + fabric_color: color(0.184475f, 0.597202f, 0.031896f), + color_deviation: 0.0f, + highlight_saturation: 0.93f, + diffuse_weight: 0.21f, + transmissive_weight: 0.16f, + bump_strength: 0.70f, + 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/Fabric/Polyester_Herringbone.mdl b/code/third_party/vMaterials_2/Fabric/Polyester_Herringbone.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3b6312c82d99e490f3d287223a8cebf683b0ba49 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Polyester_Herringbone.mdl @@ -0,0 +1,710 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A synthetic fabric material."; + +annotation preview_scale( float f); + + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +::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); + //Hack: 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)); +} + + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} +export material Polyester_Herringbone( + color color_1 = color(0.0318959989f, 0.0382039994f, 0.0451860018f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.3f [[ + ::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(1) + ]], + 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(2) + ]], + float variation_scale = 2.f [[ + ::anno::description("Larger numbers decrease the size of the roughness variation."), + ::anno::display_name("Variation Scale"), + ::anno::in_group("Appearance"), + ::anno::ui_order(3) + ]], + uniform float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(1.8f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], + 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(9) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + 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(11) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Dark Grey"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "grey", "dark", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_big(float3(endless_texture(texture_2d("./textures/polyester_herringbone_multi_R_diff_G_rough_B_dirt.jpg", ::tex::gamma_linear), base::coordinate_source(base::texture_coordinate_uvw, 0), variation_scale, float3(0.600000024f, 0.631372988f, 0.439215988f), 3.f, false))[2], 1.f, math::lerp(0.f, 0.219999999f, math::pow(roughness_variation, 0.349999994f))), 1.49000001f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_herringbone_multi_R_diff_G_rough_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, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1], 1.f, math::lerp(0.400000006f, 1.f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_herringbone_multi_R_diff_G_rough_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, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1], 1.f, math::lerp(0.400000006f, 1.f, roughness)), histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_herringbone_multi_R_diff_G_rough_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, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1], 1.f, math::lerp(0.400000006f, 1.f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_herringbone_multi_R_diff_G_rough_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, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1], 1.f, math::lerp(0.400000006f, 1.f, roughness)), color(1.f, 1.f, 1.f), nvidia::core_definitions::blend_colors(color_1, color(histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_herringbone_multi_R_diff_G_rough_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, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 1.f, 0.300000012f)), base::color_layer_multiply, 0.859999955f, true).tint, state::texture_tangent_u(0), df::scatter_reflect), df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_1, color(histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_herringbone_multi_R_diff_G_rough_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, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 1.f, 0.300000012f)), base::color_layer_multiply, 0.859999955f, true).tint, 0.f), base::tangent_space_normal_texture(texture_2d("./textures/polyester_herringbone_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, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? state::rounded_corner_normal(radius, across_materials, 1.f) : state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + + +export material Polyester_Herringbone_Light_Grey(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Light Grey"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "grey", "bright", "light", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Grey.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.577580f, 0.012983f, 0.127438f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Silver(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Silver"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "silver", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Silver.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.304987f, 0.304987f, 0.304987f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Tan(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Tan"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "tan", "orange", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Tan.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.012983f, 0.351533f, 0.545724f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "dark", "brown", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.132868f, 0.072272f, 0.052861f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Light_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Light Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "warm", "light", "brown", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.361307f, 0.194618f, 0.102242f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Beige(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Beige"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "warm", "beige", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Beige.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.502886f, 0.396755f, 0.300544f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Burgundy(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Burgundy"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "warm", "burgundy", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Burgundy.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.181164f, 0.012983f, 0.031896f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Maroon(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Maroon"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "warm", "maroon", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Maroon.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.122139f, 0.012983f, 0.012983f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Pastel_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Pastel Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "cold", "pastel", "blue", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Pastel_Blue.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.337164f, 0.386429f, 0.527115f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Royal_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Royal Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "cold", "royal", "blue", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Royal_Blue.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.f, 0.012983f, 0.205079f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Orange(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Orange"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "warm", "orange", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Orange.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.715694f, 0.177888f, 0.004025f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Green(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "cold", "green", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Green.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.040915f, 0.130136f, 0.068478f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Herringbone_Yellow(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Herringbone Yellow"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "warm", "yellow", "dielectric", "automotive", "polyester", "herringbone", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Herringbone.Polyester_Herringbone_Yellow.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Herringbone +( + color_1: color(0.896269f, 0.617207f, 0.012983f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Fabric/Polyester_Twill.mdl b/code/third_party/vMaterials_2/Fabric/Polyester_Twill.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1e4c073138cc6b4ca49e4e2bf730d0672cae9fe5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Polyester_Twill.mdl @@ -0,0 +1,523 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A synthetic fabric material."; + +annotation preview_scale( float f); + + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +::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); + //Hack: try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +export material Polyester_Twill( + color color_1 = color(0.031896f, 0.038204f, 0.045186f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.3f [[ + ::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(1) + ]], + float roughness_variation = 0.25f [[ + ::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 variation_scale = 2.f [[ + ::anno::description("Larger numbers decrease the size of the roughness variation."), + ::anno::display_name("Variation Scale"), + ::anno::in_group("Appearance"), + ::anno::ui_order(3) + ]], + uniform float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], + 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(9) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + 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(11) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Twill Dark Grey"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "grey", "dark", "dielectric", "automotive", "polyester", "twill", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Twill.Polyester_Twill.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.42f; + + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_big(float3(endless_texture(texture_2d("./textures/polyester_twill_multi_R_diff_G_rough_B_dirt.jpg", ::tex::gamma_linear), base::coordinate_source(base::texture_coordinate_uvw, 0), variation_scale, float3(0.592157006f, 0.698038995f, 0.678430974f), 13.f, false))[2], 1.f, math::lerp(0.f, 0.449999988f, math::pow(roughness_variation, 0.349999994f))), 1.49000001f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_twill_multi_R_diff_G_rough_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_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)[1], 1.f, math::lerp(0.400000006f, 1.f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_twill_multi_R_diff_G_rough_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_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)[1], 1.f, math::lerp(0.400000006f, 1.f, roughness)), histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_twill_multi_R_diff_G_rough_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_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)[1], 1.f, math::lerp(0.400000006f, 1.f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_twill_multi_R_diff_G_rough_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_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)[1], 1.f, math::lerp(0.400000006f, 1.f, roughness)), color(1.f, 1.f, 1.f), nvidia::core_definitions::blend_colors(color_1, color(histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_twill_multi_R_diff_G_rough_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_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)[0], 1.f, 0.300000012f)), base::color_layer_multiply, 0.859999955f, true).tint, state::texture_tangent_u(0), df::scatter_reflect), df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_1, color(histogram_range(float3(base::file_texture(texture_2d("./textures/polyester_twill_multi_R_diff_G_rough_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_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)[0], 1.f, 0.300000012f)), base::color_layer_multiply, 0.859999955f, true).tint, 0.f), base::tangent_space_normal_texture(texture_2d("./textures/polyester_twill_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, 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, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? state::rounded_corner_normal(radius, across_materials, 1.f) : state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Polyester_Twill_Light_Grey(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Twill Light Grey"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "grey", "bright", "light", "dielectric", "automotive", "polyester", "twill", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Twill.Polyester_Twill_Light_Grey.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Twill +( + color_1: color(0.577580f, 0.012983f, 0.127438f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Twill_Silver(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Twill Silver"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "silver", "dielectric", "automotive", "polyester", "twill", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Twill.Polyester_Twill_Silver.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Twill +( + color_1: color(0.304987f, 0.304987f, 0.304987f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Twill_Tan(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Twill Tan"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "tan", "orange", "dielectric", "automotive", "polyester", "twill", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Twill.Polyester_Twill_Tan.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Twill +( + color_1: color(0.012983f, 0.351533f, 0.545724f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Twill_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Twill Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "dark", "brown", "dielectric", "automotive", "polyester", "twill", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Twill.Polyester_Twill_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Twill +( + color_1: color(0.132868f, 0.072272f, 0.052861f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Twill_Light_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Twill Light Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "warm", "light", "brown", "dielectric", "automotive", "polyester", "twill", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Twill.Polyester_Twill_Light_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Twill +( + color_1: color(0.361307f, 0.194618f, 0.102242f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material Polyester_Twill_Beige(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Polyester Twill Beige"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]( "warm", "beige", "dielectric", "automotive", "polyester", "twill", "belts", "car", "artifical", "fabric", "soft", "cloth")), + ::anno::thumbnail("./.thumbs/Polyester_Twill.Polyester_Twill_Beige.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Polyester_Twill +( + color_1: color(0.502886f, 0.396755f, 0.300544f), + roughness: .3f, + roughness_variation: .25f, + variation_scale: 2.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Fabric/Silk_Charmeuse.mdl b/code/third_party/vMaterials_2/Fabric/Silk_Charmeuse.mdl new file mode 100644 index 0000000000000000000000000000000000000000..944643ad6f258cee8af8b452800df0ed5b19c70c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Silk_Charmeuse.mdl @@ -0,0 +1,1090 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +annotation preview_scale( float f); + +// 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)); +} + +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); +} + +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))); +} + +float4 rand_tile_id_lookup( + ::base::texture_coordinate_info uvw = ::base::coordinate_source(::base::texture_coordinate_uvw, 0), + uniform texture_2d id_offset_tex = texture_2d() // map containing the ID in r channel + //and the cell offset in g channel. + ) +[[ + ::anno::noinline() +]] +{ + float4 ret_val; + int offset_x, offset_y; + + // the rand tiles texture must be sampled exactly, so texel lookup is the function we will be using here + int2 texel_coord = int2(int(::math::frac(uvw.position.x) * ::tex::width(id_offset_tex)), + int(::math::frac(uvw.position.y) * ::tex::height(id_offset_tex))); + float3 id_offset_map_2 = ::tex::texel_float3(id_offset_tex, texel_coord); + + float offset_id = id_offset_map_2.y; + int rand_id = int(id_offset_map_2.x * 254.f); // the more logical value of 255 causes sometimes rendering artifacts + // with the random number generator. Setting it to 254 apparently fixes it + + // Offset of overlapping tiles stored in G-channel + // [0 - 0.25[ : ( 0/ 0) Grayscale value: 0.1 + // [0.25 - 0.5 [ : (-1/ 0) Grayscale value: 0.37 + // [0.5 - 0.75[ : (-1/-1) Grayscale value: 0.62 + // [0.75 - 1.0 [ : ( 0/-1) Grayscale value: 0.87 + + offset_x = offset_id < 0.25f ? 0 : (offset_id < .75f) ? 1 : 0; + offset_y = offset_id < 0.5 ? 0 : 1; + + int2 cell_id = int2(int(::math::floor(uvw.position.x) - offset_x), int(::math::floor(uvw.position.y) - offset_y)); + + int rand_val_1 = lowbias32(rand_id + lowbias32(cell_id.x + lowbias32(cell_id.y))); + int rand_val_2 = lowbias32(rand_val_1); + int rand_val_3 = lowbias32(rand_val_2); + int rand_val_4 = lowbias32(rand_val_3); + ret_val = float4(uint2float(rand_val_1), + uint2float(rand_val_2), + uint2float(rand_val_3), + uint2float(rand_val_4)); + + return float4(ret_val/4294967296.f); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(1.0f) +) +{ + return ::base::texture_coordinate_info( + position: float3(uvw.position.x / scale.x, + uvw.position.y / scale.y, + uvw.position.z / scale.x), + 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; +} + +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)); +} + + + +// +// flake noise utilities +// +// constants for numerical fitted curve to observed flake noise density behavior +// 1. no jitter, maximum flake diameter +const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f); +const float2 EF = float2(-101.42634862f, 118.45082288f); +// 2. jitter scale of 0.5f, maximum flake diameter +const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f); +const float2 EF_J = float2(-3.11456809f, 2.63430594f); + +float density_to_probability( + float4 abcd, + float2 ef, + float x) +{ + float xx = x * x; + return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y); +} + + +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return ::math::abs(float(seed) * 4.6566e-10f); +} + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = ::math::PI * 2.0f * xi.x; + float phi = ::math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = ::math::sqrt(z); + float[2] sp_cp = ::math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = ::math::sqrt(2.0f - z); + + float[2] st_ct = ::math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +struct flake_noise_value { + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + // Stores values from the functions (once normal, another time the color) + // current pseudo random number generator seed + int rnd_seed; + float4 carrier; +}; + +// flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f) +{ + float3 base_pos = ::math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0, float4(0.0)); + + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int k = -1; k < 2; ++k) { + + int seed = rnd_init(base_pos_i + int3(i, j, k)); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (math::abs(p.x) <= flake_diameter && + ::math::abs(p.y) <= flake_diameter && + ::math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + +flake_noise_value flake_noise( + float3 position, + float density = 0.5f, + bool jittered = false) // jittered: slightly slower and slightly less uniform +{ + float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, ::math::saturate(density)); + + return flake_noise(pos: position, jitter_scale: jittered ? 0.5f : 0.0f, flake_diameter: (jittered ? 1.25f : 1.5f) / ::math::sqrt(3.0f), flake_probability: probability); +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +flake_noise_value flake_normal( + flake_noise_value val, + float spread) +{ + if (val.priority <= 0.0f) + { + val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0); + return val; + } + + // int seed0 = rnd_next(val.rnd_seed); + // float xi0 = rnd_value(seed0); + // float xi1 = rnd_value(rnd_next(seed0)); + + int seed = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed); + seed = rnd_next(seed); + float xi1 = rnd_value(seed); + + float phi = ::math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1)); + float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta); + float costheta = ::math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = ::math::sincos(phi); + + val.rnd_seed = seed; + + // return + // ::state::texture_tangent_u(0) * scphi[1] * sintheta + + // ::state::texture_tangent_v(0) * scphi[0] * sintheta + + // ::state::normal() * costheta; + float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta + + ::state::texture_tangent_v(0) * scphi[0] * sintheta + + ::state::normal() * costheta; + + val.carrier = float4(normal.x, normal.y, normal.z, 1.0); + + + return val; +} + + + + + +export material Silk_Charmeuse( + color fabric_color = color(0.846873f, 0.846873f, 0.846873f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float color_deviation = 0.f [[ + ::anno::description("Adds a variation to the reflection colors of the fabric. Higher values lead to more drastical color changes."), + ::anno::display_name("Color Deviation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float highlight_saturation = 0.79f [[ + ::anno::description("Higher values cause reflected light to be tinted in the color of the material."), + ::anno::display_name("Highlight Saturation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float diffuse_weight = 0.18f [[ + ::anno::description("Increasing the diffuse contribution make the material appear more flat and takes away some of its shininess."), + ::anno::display_name("Diffuse Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float transmissive_weight = 0.19f [[ + ::anno::description("Lets light pass through the material and illuminate it from the other side."), + ::anno::display_name("Translucency"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.71f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 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)), + ::preview_scale(2.5f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]] + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - White"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "white", "light", "neutral")) +]] + = + let { + // These parameters could be exposed globally, however, they are set as constants in the material + float weft_deviation = 0.41f; // note that a stronger deviation will lead to clipping behavior of the + // bsdfs when viewing them at grazing angles + float warp_to_weft = 0.22f; + float middle_lobe_weight = 0.26f; + + + // The next parameters control the width of the highlight + float warp_roughness = 0.2f; // Width of the warp roughness + float weft_roughness = 0.14f; // Width of the weft roughness + float warpweft_noise_amount = 1.0f; // we use noise to introduce irregularities in the appearance of the + // BDSF across the material surface + + texture_2d weave_normal_texture = texture_2d("./textures/charmeuse_weaving_02_norm.png", ::tex::gamma_linear); + texture_2d weave_random_texture = texture_2d("./textures/charmeuse_weaving_02_R_id_G_offs.png", ::tex::gamma_linear); + texture_2d glizz_texture = texture_2d("./textures/fabric_noise_multi_R_noise1_G_noise_2.png", ::tex::gamma_linear); + + // preparing fabric colors + // We will be deriving all colors of the fabric from a single color which requires some amount of remapping + // the values in HSL space and then converting them back to RGB + float3 fabric_hsl_color = rgb2hsl(float3(fabric_color)); + + color diffuse_transmission_color = hsl2rgb( + float3( fabric_hsl_color.x, + fabric_hsl_color.y * ::math::pow(fabric_hsl_color.z, 0.26f), + 0.76f + ) + ); + + float remap_thread_brightness = fabric_hsl_color.z * 0.85 + 0.15; + + color warp_color = hsl2rgb( + float3( fabric_hsl_color.x - (color_deviation * 0.3), // - Shifting color by color deviation + ::math::lerp(0.0f, highlight_saturation, fabric_hsl_color.y * 0.85f), //scaling the max saturation down by 15% + remap_thread_brightness) // remapping brightness for weft highlight + ); + + color weft_color = hsl2rgb( + float3( fabric_hsl_color.x + (color_deviation * 0.3), // + Shifting color by color deviation + ::math::lerp(0.0f, highlight_saturation, fabric_hsl_color.y * 0.85f), + remap_thread_brightness + ) + ); + + // Prepare UV coordinates for texture and noise lookups + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale * .4f, // scale to fit default size of 1m for UV 0...1, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + ::base::texture_coordinate_info uvw_post = vmat_transform_post_scale(uvw: uvw, scale: float2(0.004f)); + + // Flake normal + flake_noise_value flake_noise_val = flake_noise( + position: float3(uvw.position * 2500.0f), + density: 0.72f, + jittered: true + ); + + flake_noise_value flake_noise_val2 = flake_normal( + val: flake_noise_val, + spread: 0.38f // controllable from outside + ); + + float3 flake_normal = float3(flake_noise_val2.carrier.x, flake_noise_val2.carrier.y, flake_noise_val2.carrier.z); + + // TEXTURES + // Glizz noise textures + float3 glizz_lookup = tex::lookup_float3( + glizz_texture, + float2(uvw.position.x,uvw.position.y) + ); + + + // Weave normal + float4 rand_val = rand_tile_id_lookup( + uvw: uvw_post, // we use the downscaled small UV cordinates here + id_offset_tex: weave_random_texture // special texture that allows us to randomize the height of the single weaves + ); + + float3 weave_normal = normalmap_normal( + texture: weave_normal_texture, + factor: ::math::lerp(bump_strength* 0.4f, bump_strength * 0.86f, rand_val.x), // lerping the random values and scaling by bump_strength + uvw: uvw_post // we use the downscaled small UV cordinates here + ); + + // BSDFs + // (single) Warp BSDF + bsdf warp_bsdf = ::df::simple_glossy_bsdf( + roughness_u: 0.88f, + roughness_v: histogram_range(glizz_lookup.x, warpweft_noise_amount, warp_roughness), // adjusting noise texture to show some glizzening effect + tint: warp_color, + tangent_u: uvw.tangent_u, // required to rotate the anisotropic highlight correctly + mode: ::df::scatter_reflect + ); + + // (triple) Weft BSDF + bsdf weft_bsdf = ::df::microfacet_ggx_smith_bsdf( + roughness_u: histogram_range(glizz_lookup.y, warpweft_noise_amount, weft_roughness), // adjusting noise texture to show some glizzening effect + roughness_v: 0.58f, + tint: weft_color, + multiscatter_tint: weft_color, + tangent_u: uvw.tangent_u // required to rotate the anisotropic highlight correctly + ); + + float3 weft_left_normal = ::math::normalize(::state::normal() - uvw.tangent_u * weft_deviation); + float3 weft_right_normal = ::math::normalize(::state::normal() + uvw.tangent_u * weft_deviation); + + //adding flake detail normals + float3 weft_left_detail_normal = add_detail_normal( + n: weft_left_normal, // left-shifted normal + nd: flake_normal + ); + + float3 weft_right_detail_normal = add_detail_normal( + n: weft_right_normal, // right-shifted normal + nd: flake_normal + ); + + // Left lobe with detail normal + bsdf left_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: weft_left_detail_normal + ); + + // Right lobe with detail normal + bsdf right_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: weft_right_detail_normal + ); + + // Middle lobe + bsdf middle_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: flake_normal + ); + + + bsdf left_right_lobe_bsdf = ::df::weighted_layer( + base: left_lobe_bsdf, + layer: right_lobe_bsdf, + weight: 0.5f + ); + + bsdf left_right_middle_lobe_bsdf = ::df::weighted_layer( + base: left_right_lobe_bsdf, + layer: middle_lobe_bsdf, + weight: middle_lobe_weight + ); + + /* + // Left BSDF component + ::df::bsdf_component weft_left_bsdf( + weight: 1.0, + component: left_lobe_bsdf + ); + + // Middle BSDF component + ::df::bsdf_component weft_middle_bsdf( + weight: 1.0, + component: middle_lobe_bsdf + ); + + // Right BSDF component + ::df::bsdf_component weft_right_bsdf( + weight: 1.0, + component: right_lobe_bsdf + ); + + // Weft BSDFs + bsdf left_right_middle_lobe_bsdf = df::normalized_mix( + components: df::bsdf_component[]( + weft_left_bsdf, + weft_middle_bsdf, + weft_right_bsdf + )); + */ + + // Warp and Weft BSDF combined and weighted via custom curve layer + bsdf warp_weft_combined_bsdf = ::df::custom_curve_layer( + base: df::weighted_layer( + layer: warp_bsdf, + base: left_right_middle_lobe_bsdf, + weight: warp_to_weft > 1.0f ? 1.0 - 1.0f / warp_to_weft : warp_to_weft + ), + layer: bsdf(), + normal_reflectivity: 0.11f, + grazing_reflectivity: 1.0f, + exponent: 3.63f, + weight: 1.0f + ); + + + // Diffuse Transmission BSDF + bsdf diff_transmission_bsdf = ::df::diffuse_transmission_bsdf( + tint: diffuse_transmission_color + ); + + // Diffuse Reflection BSDF + bsdf diff_reflection_bsdf = ::df::diffuse_reflection_bsdf( + tint: fabric_color + ); + + + // Computing weight contributions for the BSDF components for final mix + + // Diffuse Transmission Component + ::df::bsdf_component diffuse_transmission_component( + weight: transmissive_weight * 0.68f, + component: diff_transmission_bsdf + ); + + // Diffuse Reflection Component + ::df::bsdf_component diffuse_reflection_component( + weight: diffuse_weight * 0.68f, + component: diff_reflection_bsdf + ); + + // Mixed Glossy Lobes Component + ::df::bsdf_component warp_weft_combine_component( + weight: 2.0f - 0.68 * (transmissive_weight + diffuse_weight), + component: warp_weft_combined_bsdf + ); + + // Final Mix + bsdf final_bsdf = ::df::normalized_mix( + components: df::bsdf_component[]( + diffuse_transmission_component, + diffuse_reflection_component, + warp_weft_combine_component + )); + + /* + bsdf transmission_warp_weft_mix = ::df::weighted_layer( + base: warp_weft_combined_bsdf, + layer: diff_transmission_bsdf, + weight: transmissive_weight * 0.68f + ); + + bsdf diffuse_warp_weft_mix = ::df::weighted_layer( + base: warp_weft_combined_bsdf, + layer: diff_reflection_bsdf, + weight: diffuse_weight * 0.68f + ); + + bsdf final_bsdf = ::df::weighted_layer( + base: transmission_warp_weft_mix, + layer: diffuse_warp_weft_mix, + weight: 0.5f + ); + */ + + } in + material( + thin_walled: true, + surface: material_surface( + scattering: final_bsdf + ), + ior: color(1.0f), + geometry: material_geometry( + normal: weave_normal + ) +); + + +// 2 +export material Silk_Charmeuse_Silver(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Silver"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Silver.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "silver", "light", "neutral")) +]] = Silk_Charmeuse( + fabric_color: color(0.564712f, 0.564712f, 0.708376f), + color_deviation: 0.08f, + highlight_saturation: 0.95f, + diffuse_weight: 0.1f, + transmissive_weight: 0.19f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 3 +export material Silk_Charmeuse_Natural(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Natural"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Natural.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "natural", "white", "light")) +]] = Silk_Charmeuse( + fabric_color: color(0.955973f, 0.879622f, 0.644480f), + color_deviation: 0.0f, + highlight_saturation: 0.79f, + diffuse_weight: 0.14f, + transmissive_weight: 0.2f, + bump_strength: .70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 4 +export material Silk_Charmeuse_Champagne(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Champagne"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Champagne.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "champagne", "light", "warm")) +]] = Silk_Charmeuse( + fabric_color: color(0.775822f, 0.651406f, 0.401978f), + color_deviation: 0.0f, + highlight_saturation: 0.79f, + diffuse_weight: 0.1f, + transmissive_weight: 0.19f, + bump_strength: 0.7f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 5 +export material Silk_Charmeuse_Rose(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Rose"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Rose.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "rose", "warm", "light")) +]] = Silk_Charmeuse( + fabric_color: color(0.846873f, 0.386429f, 0.332452f), + color_deviation: 0.0f, + highlight_saturation: 0.75f, + diffuse_weight: 0.1f, + transmissive_weight: 0.2f, + bump_strength: 0.7f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 6 +export material Silk_Charmeuse_Lavender(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Lavender"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Lavender.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "lavender", "purple", "light")) +]] = Silk_Charmeuse( + fabric_color: color(0.401978f, 0.187821f, 0.502886f), + color_deviation: 0.0f, + highlight_saturation: 0.87f, + diffuse_weight: 0.1f, + transmissive_weight: 0.2f, + bump_strength: .71f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 7 +export material Silk_Charmeuse_Purple(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Purple"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Purple.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "purple", "saturated")) +]] = Silk_Charmeuse( + fabric_color: color(0.270498f, 0.003035f, 0.132868f), + color_deviation: 0.08f, + highlight_saturation: 0.95f, + diffuse_weight: 0.1f, + transmissive_weight: 0.2f, + bump_strength: 0.71f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 8 +export material Silk_Charmeuse_Sand(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Sand"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Sand.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "sand", "brown")) +]] = Silk_Charmeuse( + fabric_color: color(0.496933f, 0.371238f, 0.201556f), + color_deviation: 0.08f, + highlight_saturation: 0.95f, + diffuse_weight: 0.1f, + transmissive_weight: 0.2f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 9 +export material Silk_Charmeuse_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Orange"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Orange.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "orange", "saturated", "warm")) +]] = Silk_Charmeuse( + fabric_color: color(0.799103f, 0.258183f, 0.002428f), + color_deviation: 0.08f, + highlight_saturation: 0.99f, + diffuse_weight: 0.12f, + transmissive_weight: 0.2f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 10 +export material Silk_Charmeuse_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Blue"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Blue.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "blue", "cool", "saturated")) +]] = Silk_Charmeuse( + fabric_color: color(0.003347f, 0.130136f, 0.381326f), + color_deviation: 0.08f, + highlight_saturation: 0.99f, + diffuse_weight: 0.12f, + transmissive_weight: 0.2f, + bump_strength: 0.7f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// 11 +export material Silk_Charmeuse_Light_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Charmeuse - Light Blue"), + ::anno::description("A silk material woven using a satin weave. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Charmeuse.Silk_Charmeuse_Light_Blue.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "charmeuse", "iridescent", "fashion", "design", "light", "blue", "cool")) +]] = Silk_Charmeuse( + fabric_color: color(0.184475f, 0.485150f, 0.879622f), + color_deviation: 0.08f, + highlight_saturation: 0.99f, + diffuse_weight: 0.12f, + transmissive_weight: 0.19f, + bump_strength: 0.7f, + 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/Fabric/Silk_Crepe_Back_Satin.mdl b/code/third_party/vMaterials_2/Fabric/Silk_Crepe_Back_Satin.mdl new file mode 100644 index 0000000000000000000000000000000000000000..57479f7c99e84aae8b460c2baac9e8e10f3f12a4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Silk_Crepe_Back_Satin.mdl @@ -0,0 +1,831 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A Silk material with a crepe appearance."; + +annotation preview_scale( float f); + + +struct vm_3float{ + float x; + float y; + float z; +}; + +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 +}; + +// Generates simple 2d coordinates which are used for subsequent lookups. +// Any rotation that is happening is stored in the 'rotation' variable which +// is used when normalmap lookups e.g. in 'vm_normal_lookup' are performed +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); +} + +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; +} + +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 +) +{ + 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(); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +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 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 remap(float input, float low_1, float high_1, float low_2, float high_2) +{ + return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 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 Silk_Crepe_Back_Satin( + color fabric_color = color(0.991102f, 0.991102f, 0.991102f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float color_shimmer = 0.21f [[ + ::anno::description("Adds a variation to the reflection colors of the fabric. Higher values lead to more drastical color changes."), + ::anno::display_name("Color Shimmer"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float highlight_saturation = 0.14f [[ + ::anno::description("Higher values cause reflected light to be tinted in the color of the material."), + ::anno::display_name("Highlight Saturation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float diffuse_weight = 0.5f [[ + ::anno::description("Increasing the diffuse contribution make the material appear more flat and takes away some of its shininess."), + ::anno::display_name("Diffuse Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float transmissive_weight = .24f [[ + ::anno::description("Lets light pass through the material and illuminate it from the other side."), + ::anno::display_name("Translucency"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float fabric_bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the fabric bump."), + ::anno::display_name("Fabric Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float crepe_strength = 0.6f [[ + ::anno::description("Specifies how strong the bumps of the crepe effect appear."), + ::anno::display_name("Crepe Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::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.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)), + ::preview_scale(3.5f), + ::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("Transform"), + ::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) + ]]) +[[ + ::anno::display_name("Silk Crepe Back Satin - White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "white", "light", "neutral" )) +]] + = + let { + bool tmp0 = false; + + float2 texture_rescale = texture_scale * 0.052; // + + texture_2d multi_tex = texture_2d("./textures/silk_crepe_satin_R_rough_G_diff_B_height.jpg", ::tex::gamma_linear); + texture_2d sparkle_mask_tex = texture_2d("./textures/sparkle_mask.jpg", ::tex::gamma_linear); + texture_2d norm_tex2 = texture_2d("./textures/crepe_norm_2.jpg", ::tex::gamma_linear); + texture_2d fabric_norm_tex = texture_2d("./textures/silk_crepe_satin_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(histogram_scan_big(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).z, 0.239999995f, 0.75f), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::df::weighted_layer(transmissive_weight * 0.140000001f, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, rgb2hsl(float3(fabric_color)).y * ::math::pow(::math::clamp(rgb2hsl(float3(fabric_color)).z, 0.f, 1.f), 0.25999999f), 0.550000012f)), color(::math::pow(histogram_scan_big(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).y, 0.560000002f, 0.219999999f), 2.f)), ::base::color_layer_multiply, 1.f, true).tint, color(histogram_scan_big(1.f - vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).z, 0.560000002f, 0.f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::weighted_layer(diffuse_weight * 0.629999995f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(fabric_color, color(::math::pow(histogram_scan_big(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).y, 0.560000002f, 0.219999999f), 2.f)), ::base::color_layer_multiply, 1.f, true).tint, 0.f), ::df::weighted_layer(0.219999999f, ::df::simple_glossy_bsdf(0.25f, 0.359999985f, hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x - color_shimmer * 0.300000012f, ::math::lerp(0.f, highlight_saturation, rgb2hsl(float3(fabric_color)).y * 0.850000024f), ::math::lerp(0.149999991f, 1.f, rgb2hsl(float3(fabric_color)).z))), color(0.f, 0.f, 0.f), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), ::df::weighted_layer(0.25999999f, ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).x, 1.f, 0.280000001f) * histogram_range(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).x, 1.f, 0.280000001f), 0.0700000003f, float3(vm_tex_lookup(sparkle_mask_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x), ::math::lerp(0.719999969f, 0.119999997f, float3(vm_tex_lookup(sparkle_mask_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x), nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x + color_shimmer * 0.300000012f, ::math::lerp(0.f, highlight_saturation, rgb2hsl(float3(fabric_color)).y * 0.850000024f), ::math::lerp(0.149999991f, 1.f, rgb2hsl(float3(fabric_color)).z))), color(histogram_range(::math::pow(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).y, 1.49000001f), 1.f, 0.620000005f)), ::base::color_layer_multiply, 1.f, true).tint, nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x + color_shimmer * 0.300000012f, ::math::lerp(0.f, highlight_saturation, rgb2hsl(float3(fabric_color)).y * 0.850000024f), ::math::lerp(0.149999991f, 1.f, rgb2hsl(float3(fabric_color)).z))), color(histogram_range(::math::pow(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).y, 1.49000001f), 1.f, 0.620000005f)), ::base::color_layer_multiply, 1.f, true).tint, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), bsdf(), vm_tex_normal_lookup_2x(fabric_norm_tex, norm_tex2, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float2(2.f)), fabric_bump_strength, crepe_strength, false)), ::df::weighted_layer(0.5f, ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).x, 1.f, 0.280000001f) * histogram_range(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).x, 1.f, 0.280000001f), 0.0700000003f, float3(vm_tex_lookup(sparkle_mask_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x), ::math::lerp(0.719999969f, 0.119999997f, float3(vm_tex_lookup(sparkle_mask_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x), nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x + color_shimmer * 0.300000012f, ::math::lerp(0.f, highlight_saturation, rgb2hsl(float3(fabric_color)).y * 0.850000024f), ::math::lerp(0.149999991f, 1.f, rgb2hsl(float3(fabric_color)).z))), color(histogram_range(::math::pow(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).y, 1.49000001f), 1.f, 0.620000005f)), ::base::color_layer_multiply, 1.f, true).tint, nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x + color_shimmer * 0.300000012f, ::math::lerp(0.f, highlight_saturation, rgb2hsl(float3(fabric_color)).y * 0.850000024f), ::math::lerp(0.149999991f, 1.f, rgb2hsl(float3(fabric_color)).z))), color(histogram_range(::math::pow(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).y, 1.49000001f), 1.f, 0.620000005f)), ::base::color_layer_multiply, 1.f, true).tint, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), bsdf(), add_detail_normal(vm_tex_normal_lookup_2x(fabric_norm_tex, norm_tex2, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float2(2.f)), fabric_bump_strength, crepe_strength, false), ::math::normalize(::state::normal() + vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index).tangent_u * -0.409999996f))), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).x, 1.f, 0.280000001f) * histogram_range(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).x, 1.f, 0.280000001f), 0.0700000003f, float3(vm_tex_lookup(sparkle_mask_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x), ::math::lerp(0.719999969f, 0.119999997f, float3(vm_tex_lookup(sparkle_mask_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x), nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x + color_shimmer * 0.300000012f, ::math::lerp(0.f, highlight_saturation, rgb2hsl(float3(fabric_color)).y * 0.850000024f), ::math::lerp(0.149999991f, 1.f, rgb2hsl(float3(fabric_color)).z))), color(histogram_range(::math::pow(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).y, 1.49000001f), 1.f, 0.620000005f)), ::base::color_layer_multiply, 1.f, true).tint, nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x + color_shimmer * 0.300000012f, ::math::lerp(0.f, highlight_saturation, rgb2hsl(float3(fabric_color)).y * 0.850000024f), ::math::lerp(0.149999991f, 1.f, rgb2hsl(float3(fabric_color)).z))), color(histogram_range(::math::pow(vm_tex_lookup_3float(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float3(1.f)).y, 1.49000001f), 1.f, 0.620000005f)), ::base::color_layer_multiply, 1.f, true).tint, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), bsdf(), add_detail_normal(vm_tex_normal_lookup_2x(fabric_norm_tex, norm_tex2, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float2(2.f)), fabric_bump_strength, crepe_strength, false), ::math::normalize(::state::normal() + vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index).tangent_u * 0.409999996f))), ::state::normal()), ::state::normal()), vm_tex_normal_lookup_2x(fabric_norm_tex, norm_tex2, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float2(2.f)), fabric_bump_strength, crepe_strength, false)), vm_tex_normal_lookup_2x(fabric_norm_tex, norm_tex2, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float2(2.f)), fabric_bump_strength, crepe_strength, false)), vm_tex_normal_lookup_2x(fabric_norm_tex, norm_tex2, vm_coord(texture_translate, texture_rotate, texture_rescale, 0), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, 0), float2(2.f)), fabric_bump_strength, crepe_strength, false)), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f), emission_intensity: color(0.f, 0.f, 0.f)); + material_geometry tmp5(float3(0.f), 1.f, 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 Silk_Crepe_Back_Satin_Natural(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Natural"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Natural.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "natural", "light", "pastel", "warm")) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(1.000000f, 0.921582f, 0.644480f), + color_shimmer: 0.21f, + highlight_saturation: 0.51f, + diffuse_weight: 0.93, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Champagne(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Champagne"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Champagne.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "champagne", "light", "pastel", "warm")) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.964686f, 0.745404f, 0.496933f), + color_shimmer: 0.21f, + highlight_saturation: 0.51f, + diffuse_weight: 0.8f, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Rose(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Rose"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Rose.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "rose", "light", "pastel", "warm")) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(1.000000f, 0.491021f, 0.332452f), + color_shimmer: 0.21f, + highlight_saturation: 0.51f, + diffuse_weight: 0.56f, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Pink(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Pink"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Pink.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "pink", "light", "warm" )) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.822786f, 0.102242f, 0.144128f), + color_shimmer: 0.21f, + highlight_saturation: 0.6f, + diffuse_weight: 0.5f, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Shiny_Moss(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Shiny Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Shiny_Moss.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "green", "saturated")) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.158961f, 0.318547f, 0.045186f), + color_shimmer: 0.21f, + highlight_saturation: 0.92f, + diffuse_weight: 0.0f, + transmissive_weight: 0.36f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Purple(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Purple"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Purple.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "purple", "saturated")) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.428690f, 0.057805f, 0.730461f), + color_shimmer: 0.21f, + highlight_saturation: 0.7f, + diffuse_weight: 0.22f, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Electric_Blue(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Electric Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Electric_Blue.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "blue", "cool")) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.004777f, 0.238398f, 0.708376f), + color_shimmer: 0.28f, + highlight_saturation: 0.51f, + diffuse_weight: 0.19f, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Royal_Blue(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Royal Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Royal_Blue.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "blue", "dark", "cool", "saturated")) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.033105f, 0.033105f, 0.381326f), + color_shimmer: 0.15f, + highlight_saturation: 0.95f, + diffuse_weight: 0.37f, + transmissive_weight: 0.15f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Red(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Red.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "red", "warm", "saturated" )) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.783538f, 0.043735f, 0.025187f), + color_shimmer: 0.21f, + highlight_saturation: 0.95f, + diffuse_weight: 0.31f, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Yellow(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Yellow"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Yellow.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "yellow", "light", "warm" )) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.955973f, 0.610496f, 0.003347f), + color_shimmer: 0.21f, + highlight_saturation: 0.5f, + diffuse_weight: 0.36f, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + + +export material Silk_Crepe_Back_Satin_Forest_Green(*) +[[ + ::anno::display_name("Silk Crepe Back Satin - Forest Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Forest_Green.png"), + ::anno::key_words(string[]("fabric", "silk", "crepe", "clothing", "shimmer", "fashion", "new", "green", "dark", "saturated" )) +]] = Silk_Crepe_Back_Satin( + fabric_color: color(0.001821f, 0.135633f, 0.051269f), + color_shimmer: 0.21f, + highlight_saturation: 0.5f, + diffuse_weight: 0.19f, + transmissive_weight: 0.31f, + fabric_bump_strength: 1.0f, + crepe_strength: 0.6f, + 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.0f, + roundcorners_across_materials: false +); + diff --git a/code/third_party/vMaterials_2/Fabric/Silk_Crepe_de_Chine.mdl b/code/third_party/vMaterials_2/Fabric/Silk_Crepe_de_Chine.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a50519cf13ee885e672477230b2aa3ad674a24ba --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Silk_Crepe_de_Chine.mdl @@ -0,0 +1,1032 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +annotation preview_scale( float f); + +color vmat_file_texture( + uniform texture_2d texture, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info(), + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0), + uniform tex::wrap_mode wrap_u = tex::wrap_repeat, + uniform tex::wrap_mode wrap_v = tex::wrap_repeat +) +{ + return color(tex::lookup_float3(texture, float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v)); +} + +// 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)); +} + +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); +} + + + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + state::normal() * (lookup.z + (1.0 - factor))); +} + + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(1.0f) +) +{ + return ::base::texture_coordinate_info( + position: float3(uvw.position.x / scale.x, + uvw.position.y / scale.y, + uvw.position.z / scale.x), + 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; +} + +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)); +} + + + +// +// flake noise utilities +// +// constants for numerical fitted curve to observed flake noise density behavior +// 1. no jitter, maximum flake diameter +const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f); +const float2 EF = float2(-101.42634862f, 118.45082288f); +// 2. jitter scale of 0.5f, maximum flake diameter +const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f); +const float2 EF_J = float2(-3.11456809f, 2.63430594f); + +float density_to_probability( + float4 abcd, + float2 ef, + float x) +{ + float xx = x * x; + return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y); +} + + +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return ::math::abs(float(seed) * 4.6566e-10f); +} + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = ::math::PI * 2.0f * xi.x; + float phi = ::math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = ::math::sqrt(z); + float[2] sp_cp = ::math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = ::math::sqrt(2.0f - z); + + float[2] st_ct = ::math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +struct flake_noise_value { + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + // Stores values from the functions (once normal, another time the color) + // current pseudo random number generator seed + int rnd_seed; + float4 carrier; +}; + +// flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f) +{ + float3 base_pos = ::math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0, float4(0.0)); + + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int k = -1; k < 2; ++k) { + + int seed = rnd_init(base_pos_i + int3(i, j, k)); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (math::abs(p.x) <= flake_diameter && + ::math::abs(p.y) <= flake_diameter && + ::math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + +flake_noise_value flake_noise( + float3 position, + float density = 0.5f, + bool jittered = false) // jittered: slightly slower and slightly less uniform +{ + float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, ::math::saturate(density)); + + return flake_noise(pos: position, jitter_scale: jittered ? 0.5f : 0.0f, flake_diameter: (jittered ? 1.25f : 1.5f) / ::math::sqrt(3.0f), flake_probability: probability); +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +flake_noise_value flake_normal( + flake_noise_value val, + float spread) +{ + if (val.priority <= 0.0f) + { + val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0); + return val; + } + + int seed = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed); + seed = rnd_next(seed); + float xi1 = rnd_value(seed); + + float phi = ::math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1)); + float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta); + float costheta = ::math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = ::math::sincos(phi); + + val.rnd_seed = seed; + + float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta + + ::state::texture_tangent_v(0) * scphi[0] * sintheta + + ::state::normal() * costheta; + + val.carrier = float4(normal.x, normal.y, normal.z, 1.0); + + + return val; +} + + + + + +export material Silk_Crepe_de_Chine( + color fabric_color = color(0.982251f, 0.982251f, 0.982251f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float color_deviation = 0.f [[ + ::anno::description("Adds a variation to the reflection colors of the fabric. Higher values lead to more drastical color changes."), + ::anno::display_name("Color Deviation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float highlight_saturation = 0.79f [[ + ::anno::description("Higher values cause reflected light to be tinted in the color of the material."), + ::anno::display_name("Highlight Saturation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float diffuse_weight = 0.19f [[ + ::anno::description("Increasing the diffuse contribution make the material appear more flat and takes away some of its shininess."), + ::anno::display_name("Diffuse Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float transmissive_weight = 0.24f [[ + ::anno::description("Lets light pass through the material and illuminate it from the other side."), + ::anno::display_name("Translucency"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.70f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 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)), + ::preview_scale(4.0f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]] + + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - White"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "white", "light", "neutral")) +]] + = + let { + // These parameters could be exposed globally, however, they are set as constants in the material + float weft_deviation = 0.41f; // note that a stronger deviation will lead to clipping behavior of the + // bsdfs when viewing them at grazing angles + float warp_to_weft = 0.22f; + float warp_weft_power = 2.7f; // controls the contrast of the mixing of the warp and weft with the AO texture + + + // The next parameters control the width of the highlight + float warp_roughness = 0.2f; // Width of the warp roughness + float weft_roughness = 0.14f; // Width of the weft roughness + float warpweft_noise_amount = 1.0f; // we use noise to introduce irregularities in the appearance of the + // BDSF across the material surface + + texture_2d weave_normal_texture = texture_2d("./textures/crepe_de_chine_norm.jpg", ::tex::gamma_linear); + texture_2d weave_var_texture = texture_2d("./textures/crepe_de_chine_var.jpg", ::tex::gamma_linear); + texture_2d glizz_texture = texture_2d("./textures/fabric_noise_multi_R_noise1_G_noise_2.png", ::tex::gamma_linear); + + // preparing fabric colors + // We will be deriving all colors of the fabric from a single color which requires some amount of remapping + // the values in HSL space and then converting them back to RGB + float3 fabric_hsl_color = rgb2hsl(float3(fabric_color)); + + color diffuse_transmission_color = hsl2rgb( + float3( fabric_hsl_color.x, + fabric_hsl_color.y * ::math::pow(fabric_hsl_color.z, 0.26f), + 0.76f + ) + ); + + float remap_thread_brightness = fabric_hsl_color.z * 0.85 + 0.15; + + color warp_color = hsl2rgb( + float3( fabric_hsl_color.x - (color_deviation * 0.3), // - Shifting color by color deviation + ::math::lerp(0.0f, highlight_saturation, fabric_hsl_color.y * 0.85f), //scaling the max saturation down by 15% + remap_thread_brightness) // remapping brightness for weft highlight + ); + + color weft_color = hsl2rgb( + float3( fabric_hsl_color.x + (color_deviation * 0.3), // + Shifting color by color deviation + ::math::lerp(0.0f, highlight_saturation, fabric_hsl_color.y * 0.85f), + remap_thread_brightness + ) + ); + + // Prepare UV coordinates for texture and noise lookups + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale * 0.4f, // scale to fit default size of 1m for UV 0...1, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + ::base::texture_coordinate_info uvw_post = vmat_transform_post_scale(uvw: uvw, scale: float2(0.2f)); + + // Flake normal + flake_noise_value flake_noise_val = flake_noise( + position: float3(uvw.position * 2500.0f), + density: 0.72f, + jittered: true + ); + + flake_noise_value flake_noise_val2 = flake_normal( + val: flake_noise_val, + spread: 0.38f // controllable from outside + ); + + float3 flake_normal = float3(flake_noise_val2.carrier.x, flake_noise_val2.carrier.y, flake_noise_val2.carrier.z); + + // TEXTURES + // Glizz noise textures + float3 glizz_lookup = tex::lookup_float3( + glizz_texture, + float2(uvw.position.x,uvw.position.y) + ); + + + // Weave AO/brightness variation + float var_val = float3(vmat_file_texture( + texture: weave_var_texture, + uvw: uvw_post + )).x; + + float var_val_pow = ::math::pow(var_val, warp_weft_power); // the power values controls the contrast of the lookup + // and later in the code the mixing of the warp and weft lobe + + float3 weave_normal = normalmap_normal( + texture: weave_normal_texture, + factor: bump_strength, + uvw: uvw_post // we use the downscaled small UV cordinates here + ); + + // BSDFs + // (single) Warp BSDF + bsdf warp_bsdf = ::df::simple_glossy_bsdf( + roughness_u: 0.88f, + roughness_v: histogram_range(glizz_lookup.x, warpweft_noise_amount, warp_roughness), // adjusting noise texture to show some glizzening effect + tint: warp_color, + tangent_u: uvw.tangent_u, // required to rotate the anisotropic highlight correctly + mode: ::df::scatter_reflect + ); + + // (double) Weft BSDF + bsdf weft_bsdf = ::df::microfacet_ggx_smith_bsdf( + roughness_u: histogram_range(glizz_lookup.y, warpweft_noise_amount, weft_roughness), // adjusting noise texture to show some glizzening effect + roughness_v: 0.58f, + tint: weft_color, + multiscatter_tint: weft_color, + tangent_u: uvw.tangent_u // required to rotate the anisotropic highlight correctly + ); + + float3 weft_left_normal = ::math::normalize(::state::normal() - uvw.tangent_u * weft_deviation); + float3 weft_right_normal = ::math::normalize(::state::normal() + uvw.tangent_u * weft_deviation); + + //adding flake detail normals + float3 weft_left_detail_normal = add_detail_normal( + n: weft_left_normal, // left-shifted normal + nd: flake_normal + ); + + float3 weft_right_detail_normal = add_detail_normal( + n: weft_right_normal, // right-shifted normal + nd: flake_normal + ); + + + // Left lobe with detail normal + bsdf left_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: weft_left_detail_normal + ); + + // Right lobe with detail normal + bsdf right_lobe_bsdf = ::df::weighted_layer( + weight: 1.0f, + layer: weft_bsdf, + base: bsdf(), + normal: weft_right_detail_normal + ); + + + bsdf left_right_lobe_bsdf = ::df::weighted_layer( + base: left_lobe_bsdf, + layer: right_lobe_bsdf, + weight: 0.5f + ); + + // Warp and Weft BSDF combined and weighted via custom curve layer + bsdf warp_weft_combined_bsdf = ::df::custom_curve_layer( + base: df::weighted_layer( + layer: warp_bsdf, + base: left_right_lobe_bsdf, + weight: var_val_pow * (warp_to_weft > 1.0f ? 1.0 - 1.0f / warp_to_weft : warp_to_weft) + ), + layer: bsdf(), + normal_reflectivity: 0.11f, + grazing_reflectivity: 1.0f, + exponent: 3.63f, + weight: 1.0f + ); + + + // Diffuse Transmission BSDF + bsdf diff_transmission_bsdf = ::df::diffuse_transmission_bsdf( + tint: diffuse_transmission_color + ); + + // Diffuse Reflection BSDF + bsdf diff_reflection_bsdf = ::df::diffuse_reflection_bsdf( + tint: fabric_color + ); + + + // Computing weight contributions for the BSDF components for final mix + + // Diffuse Transmission Component + ::df::bsdf_component diffuse_transmission_component( + weight: transmissive_weight * 0.68f, + component: diff_transmission_bsdf + ); + + // Diffuse Reflection Component + ::df::bsdf_component diffuse_reflection_component( + weight: diffuse_weight * 0.68f, + component: diff_reflection_bsdf + ); + + // Mixed Glossy Lobes Component + ::df::bsdf_component warp_weft_combine_component( + weight: 2.0f - 0.68 * (transmissive_weight + diffuse_weight), + component: warp_weft_combined_bsdf + ); + + // Final Mix + bsdf final_bsdf = ::df::normalized_mix( + components: df::bsdf_component[]( + diffuse_transmission_component, + diffuse_reflection_component, + warp_weft_combine_component + )); + + /* + bsdf transmission_warp_weft_mix = ::df::weighted_layer( + base: warp_weft_combined_bsdf, + layer: diff_transmission_bsdf, + weight: transmissive_weight * 0.68f + ); + + bsdf diffuse_warp_weft_mix = ::df::weighted_layer( + base: warp_weft_combined_bsdf, + layer: diff_reflection_bsdf, + weight: diffuse_weight * 0.68f + ); + + bsdf final_bsdf = ::df::weighted_layer( + base: transmission_warp_weft_mix, + layer: diffuse_warp_weft_mix, + weight: 0.5f + ); + */ + + } in + material( + thin_walled: true, + surface: material_surface( + scattering: final_bsdf + ), + ior: color(1.0f), + geometry: material_geometry( + normal: weave_normal + ) +); + + +// 2 +export material Silk_Crepe_de_Chine_Natural(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Natural"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Natural.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "natural", "light", "warm", "white")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(1.000000f, 0.921582f, 0.644480f), + color_deviation: 0.0f, + highlight_saturation: 0.79f, + diffuse_weight: 0.19f, + transmissive_weight: 0.24f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 3 +export material Silk_Crepe_de_Chine_Champagne(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Champagne"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Champagne.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "light", "white", "champagne", "pastel", "warm")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.871367f, 0.672443f, 0.450786f), + color_deviation: 0.08f, + highlight_saturation: 0.79f, + diffuse_weight: 0.19f, + transmissive_weight: 0.24f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 4 +export material Silk_Crepe_de_Chine_Rose(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Rose"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Rose.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "rose", "light", "warm", "pastel")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(1.000000f, 0.491021f, 0.332452f), + color_deviation: 0.08f, + highlight_saturation: 0.95f, + diffuse_weight: 0.1f, + transmissive_weight: 0.24f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 5 +export material Silk_Crepe_de_Chine_Pink(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Pink"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Pink.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "pink", "warm", "red")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.822786f, 0.102242f, 0.144128f), + color_deviation: 0.0f, + highlight_saturation: 0.79f, + diffuse_weight: 0.19f, + transmissive_weight: 0.24f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 6 +export material Silk_Crepe_de_Chine_Moss(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Moss"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Moss.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "green", "moss", "light")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.158961f, 0.318547f, 0.045186f), + color_deviation: 0.0f, + highlight_saturation: 0.92f, + diffuse_weight: 0.0f, + transmissive_weight: 0.34f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 7 +export material Silk_Crepe_de_Chine_Purple(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Purple"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Purple.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "purple", "saturated")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.287441f, 0.006995f, 0.584078f), + color_deviation: 0.0f, + highlight_saturation: 0.79f, + diffuse_weight: 0.19f, + transmissive_weight: 0.24f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 8 +export material Silk_Crepe_de_Chine_Sky_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Sky Blue"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Sky_Blue.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "blue", "sky", "cool")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.000911f, 0.238398f, 0.708376f), + color_deviation: 0.0f, + highlight_saturation: 0.79f, + diffuse_weight: 0.19f, + transmissive_weight: 0.24f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 9 +export material Silk_Crepe_de_Chine_Royal_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Royal Blue"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Royal_Blue.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "blue", "royal", "saturated", "cool")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.004777f, 0.004777f, 0.381326f), + color_deviation: 0.0f, + highlight_saturation: 0.95f, + diffuse_weight: 0.06f, + transmissive_weight: 0.11f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 10 +export material Silk_Crepe_de_Chine_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Red"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Red.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "red", "saturated", "warm")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.496933f, 0.005182f, 0.000000f), + color_deviation: 0.0f, + highlight_saturation: 0.95f, + diffuse_weight: 0.06f, + transmissive_weight: 0.11f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 11 +export material Silk_Crepe_de_Chine_Yellow(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Yellow"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Yellow.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "yellow", "light", "warm", "saturated")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.708376f, 0.456411f, 0.003035f), + color_deviation: 0.0f, + highlight_saturation: 0.99f, + diffuse_weight: 0.19f, + transmissive_weight: 0.24f, + bump_strength: 0.70f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +// 12 +export material Silk_Crepe_de_Chine_Forest_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Crepe de Chine - Forest Green"), + ::anno::description("A silk material woven in a Crepe de Chine fashion. It features color deviation to simulate color shifting in the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Forest_Green.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "crepe", "chine", "iridescent", "fashion", "design", "forest", "green", "saturated", "dark")) +]] = Silk_Crepe_de_Chine( + fabric_color: color(0.001214f, 0.063010f, 0.025187f), + color_deviation: 0.0f, + highlight_saturation: 0.79f, + diffuse_weight: 0.19f, + transmissive_weight: 0.24f, + bump_strength: 0.70f, + 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/Fabric/Silk_Georgette.mdl b/code/third_party/vMaterials_2/Fabric/Silk_Georgette.mdl new file mode 100644 index 0000000000000000000000000000000000000000..af7b1f7af3cd78b8bb86ab9fccf1ec8631c11661 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Silk_Georgette.mdl @@ -0,0 +1,856 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A lightly woven silk georgette material that is quite transparent."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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 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)); +} + +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); +} + +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 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 histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +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; +} + +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)); +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + 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(); +} + +struct vm_3float{ + float x; + float y; + float z; +}; + +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; +} + +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); +} + + +export material Silk_Georgette( + color fabric_color = color(0.955973f, 0.955973f, 0.955973f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.67f [[ + ::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.23f [[ + ::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 fuzz_weight = 0.37f [[ + ::anno::description("Adds a white fuzz layer on the material which gives it a more used appearance."), + ::anno::display_name("Fuzz Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float sheen_weight = 1.f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.83f [[ + ::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(5) + ]], + float warp_intensity = 0.f [[ + ::anno::description("Adds a little bit of distortion to break up the perfectly regular appearance of the weaving."), + ::anno::display_name("Warp Intensity"), + ::anno::in_group("Appearance"), + ::anno::soft_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.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)), + ::preview_scale(float(3.5f)), + ::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("Transform"), + ::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.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(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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "white", "light", "neutral")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.053f; // texture covers 53 mm, scale up so it covers 1m in default 1...0 UV range + + texture_2d multi_tex1 = texture_2d("./textures/silk_georgette_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d diff_opacity_tex = texture_2d("./textures/silk_georgette_R_diff_G_opacity.jpg", ::tex::gamma_linear); + texture_2d warp_tex = texture_2d("./textures/french_terry_fabric_warp.png", ::tex::gamma_linear); + texture_2d roughvar_tex = texture_2d("./textures/silk_georgette_roughvar.jpg", ::tex::gamma_linear); + texture_2d fibers_tex = texture_2d("./textures/fibers.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/silk_georgette_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(0.0599999987f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(vm_tex_lookup(multi_tex1, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.429999977f, 0.507300019f), 0.979999959f), ::df::microfacet_ggx_smith_bsdf(((vm_tex_infinite(roughvar_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(10.f)), float3(0.49000001f), 1.f, false, 2.20000005f).x - 0.5f) * roughness_variation + histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex1, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.55999994f), 1.f, roughness * 0.300000012f + 0.600000024f)) * ((vm_tex_infinite(roughvar_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(10.f)), float3(0.49000001f), 1.f, false, 2.20000005f).x - 0.5f) * roughness_variation + histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex1, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.55999994f), 1.f, roughness * 0.300000012f + 0.600000024f)), ((vm_tex_infinite(roughvar_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(10.f)), float3(0.49000001f), 1.f, false, 2.20000005f).x - 0.5f) * roughness_variation + histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex1, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.55999994f), 1.f, roughness * 0.300000012f + 0.600000024f)) * ((vm_tex_infinite(roughvar_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(10.f)), float3(0.49000001f), 1.f, false, 2.20000005f).x - 0.5f) * roughness_variation + histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex1, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.55999994f), 1.f, roughness * 0.300000012f + 0.600000024f)), 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(sheen_weight, ::df::sheen_bsdf(0.280000001f, hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(0.319999993f, ::df::diffuse_transmission_bsdf(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.269999981f)), rgb2hsl(float3(fabric_color)).z))), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup_3float(diff_opacity_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float3(1.f)).x, 1.f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex1, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.680000007f, 0.539999962f)), ::base::color_layer_multiply, 0.0199999996f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.29999995f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength))), ::df::weighted_layer(0.319999993f, ::df::diffuse_transmission_bsdf(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.269999981f)), rgb2hsl(float3(fabric_color)).z))), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup_3float(diff_opacity_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float3(1.f)).x, 1.f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex1, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.680000007f, 0.539999962f)), ::base::color_layer_multiply, 0.0199999996f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.29999995f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), 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), vm_tex_lookup_3float(diff_opacity_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float3(1.f)).y, 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 Silk_Georgette_Beige(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Beige"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Beige.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "beige", "light", "warm", "pastel")) +]] = Silk_Georgette( + fabric_color: color(0.545724f, 0.445201f, 0.381326f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Silver(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Silver"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Silver.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "silver", "neutral")) +]] = Silk_Georgette( + fabric_color: color(0.323143f, 0.304987f, 0.327778f), + roughness: 0.42f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Turquoise(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Turquoise"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Turquoise.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "turquoise", "saturated", "cool")) +]] = Silk_Georgette( + fabric_color: color(0.021219f, 0.462077f, 0.445201f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Lavender(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Lavender"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Lavender.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "lavender", "violet", "cool")) +]] = Silk_Georgette( + fabric_color: color(0.198069f, 0.135633f, 0.341914f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Rose(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Rose"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Rose.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "rose", "light", "pastel", "red", "warm")) +]] = Silk_Georgette( + fabric_color: color(0.637597f, 0.300544f, 0.327778f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Fuchsia(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Fuchsia"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Fuchsia.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "pink", "red", "fuchsia", "warm")) +]] = Silk_Georgette( + fabric_color: color(0.558340f, 0.104616, 0.266356f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Purple(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Purple"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Purple.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "purple", "violet", "saturated")) +]] = Silk_Georgette( + fabric_color: color(0.122139f, 0.021219f, 0.300544f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Red.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "red", "saturated", "warm")) +]] = Silk_Georgette( + fabric_color: color(0.564712f, 0.027321f, 0.052861f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Yellow(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Yellow"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Yellow.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "yellow", "light", "warm", "saturated")) +]] = Silk_Georgette( + fabric_color: color(0.752942f, 0.590619f, 0.061246f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Orange"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Orange.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "orange", "warm", "saturated")) +]] = Silk_Georgette( + fabric_color: color(0.863157f, 0.242281f, 0.024158f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Electric_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Electric Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Electric_Blue.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "blue", "saturated", "cool")) +]] = Silk_Georgette( + fabric_color: color(0.022174f, 0.234551f, 0.637597f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Sky_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Sky Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Sky_Blue.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "blue", "light", "pastel", "cool")) +]] = Silk_Georgette( + fabric_color: color(0.266356f, 0.502886f, 0.814847f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Green.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "green", "saturated")) +]] = Silk_Georgette( + fabric_color: color(0.026241f, 0.439657f, 0.033105f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Georgette_Mint_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Georgette - Mint Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Georgette.Silk_Georgette_Mint_Green.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "georgette", "transparent", "translucent", "fashion", "design", "green", "light", "mint", "pastel", "light")) +]] = Silk_Georgette( + fabric_color: color(0.351533f, 0.830770f, 0.610496f), + roughness: 0.67f, + roughness_variation: 0.23f, + fuzz_weight: 0.37f, + sheen_weight: 1.0f, + bump_strength: 0.85f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + diff --git a/code/third_party/vMaterials_2/Fabric/Silk_Plain_Chiffon.mdl b/code/third_party/vMaterials_2/Fabric/Silk_Plain_Chiffon.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0eda41c933f53a93b2ffd8ccc25e6077dfad9ce6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Silk_Plain_Chiffon.mdl @@ -0,0 +1,569 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A plain chiffon silk material with creases."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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 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)); +} + +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); +} + +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 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 histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +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; +} + +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)); +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + 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(); +} + +// 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)); +} + + +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(); +} + +export material Silk_Plain_Chiffon( + color fabric_color = color(0.830770f, 0.830770f, 0.830770f) [[ + ::anno::description("Sets the color of the fabric."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.32f [[ + ::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 fabric_reflection = 0.6f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float sheen_weight = 0.95f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float translucency_amount = 0.4f [[ + ::anno::description("A value of 0 makes the material completely opaque. Increasing the parameter value lets more light pass through the material."), + ::anno::display_name("Translucency Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float fabric_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, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float secondary_bump_size = 0.5f [[ + ::anno::description("The strength of the wrinkles bump map."), + ::anno::display_name("Wrinkles Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float wrinkles_bump_scale = 1.0f [[ + ::anno::description("Controls the size of the wrinkles that appear on the fabric surface."), + ::anno::display_name("Wrinkles Bump Scale"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(7) + ]], + float warp_intensity = 0.f [[ + ::anno::description("Adds a little bit of distortion to break up the perfectly regular appearance of the weaving."), + ::anno::display_name("Warp Intensity"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + 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(9) + ]], + 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(10) + ]], + 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)), + ::preview_scale(float(3.5f)), + ::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("Transform"), + ::anno::ui_order(12) + ]], + 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(13) + ]], + uniform float roundcorners_radius_mm = 1.f [[ + ::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(14) + ]], + 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(15) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Plain Chiffon - White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "chiffon", "transparent", "translucent", "fashion", "design", "white", "light", "neutral")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.11f; // texture covers 11 cm, scale up so it covers 1m per default + + texture_2d multi_tex = texture_2d("./textures/silk_plain_chiffon_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d warp_tex = texture_2d("./textures/french_terry_fabric_warp.png", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/silk_plain_chiffon_norm.jpg", ::tex::gamma_linear); + texture_2d diff_tex = texture_2d("./textures/silk_plain_chiffon_R_diff.jpg", ::tex::gamma_linear); + texture_2d norm2_tex = texture_2d("./textures/silk_plain_chiffon_norm2.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(0.179999992f, 1.f, 3.01999998f, fabric_reflection * 0.3f, ::df::microfacet_ggx_smith_bsdf(histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f), 0.98999995f, roughness * 0.300000012f + 0.600000024f) * histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f), 0.98999995f, roughness * 0.300000012f + 0.600000024f), histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f), 0.98999995f, roughness * 0.300000012f + 0.600000024f) * histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f), 0.98999995f, roughness * 0.300000012f + 0.600000024f), 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(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), rgb2hsl(float3(fabric_color)).z)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup(diff_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 0.479999989f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.680000007f, 0.229999989f)), ::base::color_layer_multiply, fabric_bump_strength, true).tint, 1.86000001f), 0.f), bsdf(), add_detail_normal(vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), fabric_bump_strength), vm_tex_infinite_normal(norm2_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(wrinkles_bump_scale * 3.f + 0.300000012f)), float3(0.5f, 0.5f, 1.f), 3.f, secondary_bump_size * 2.5f))), add_detail_normal(vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), fabric_bump_strength), vm_tex_infinite_normal(norm2_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(wrinkles_bump_scale * 3.f + 0.300000012f)), float3(0.5f, 0.5f, 1.f), 3.f, secondary_bump_size * 2.5f)))), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), rgb2hsl(float3(fabric_color)).z)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup(diff_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 0.479999989f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.680000007f, 0.229999989f)), ::base::color_layer_multiply, fabric_bump_strength, true).tint, 1.86000001f), 0.f), bsdf(), add_detail_normal(vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), fabric_bump_strength), vm_tex_infinite_normal(norm2_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(wrinkles_bump_scale * 3.f + 0.300000012f)), float3(0.5f, 0.5f, 1.f), 3.f, secondary_bump_size * 2.5f))), add_detail_normal(vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), fabric_bump_strength), vm_tex_infinite_normal(norm2_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(wrinkles_bump_scale * 3.f + 0.300000012f)), float3(0.5f, 0.5f, 1.f), 3.f, secondary_bump_size * 2.5f))), add_detail_normal(vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), fabric_bump_strength), vm_tex_infinite_normal(norm2_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.1f, false, true), float2(wrinkles_bump_scale * 3.f + 0.3f)), float3(0.5f, 0.5f, 1.f), 3.f, secondary_bump_size * 2.5f))), add_detail_normal(vm_tex_normal_lookup(norm_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.1f, false, true), fabric_bump_strength), vm_tex_infinite_normal(norm2_tex, vm_coord_post_scale(vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), float2(wrinkles_bump_scale * 3.f + 0.300000012f)), float3(0.5f, 0.5f, 1.f), 3.f, secondary_bump_size * 2.5f))), 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), histogram_scan_big(::math::pow(vm_tex_lookup(diff_tex, vm_coord_warp(vm_tex_lookup(warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 2.f), 0.14f, 0.18f), roundcorners_enable ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.001f, 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 Silk_Plain_Chiffon_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Plain Chiffon - Shiny"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Shiny.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "chiffon", "architecture", "translucent", "fashion", "design", "shiny", "white", "light", "neutral")) +]] = Silk_Plain_Chiffon( + fabric_color: color(0.830770f, 0.830770f, 0.830770f), + roughness: 0.01f, + fabric_reflection: 0.98f, + sheen_weight: 0.75f, + translucency_amount: 0.12f, + fabric_bump_strength: 1.0f, + secondary_bump_size: 0.19f, + wrinkles_bump_scale: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); + + +export material Silk_Plain_Chiffon_Natural(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Silk Plain Chiffon - Natural"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Natural.png"), + ::anno::key_words(string[]("fabric", "translucent", "silk", "woven", "chiffon", "architecture", "translucent", "fashion", "design", "natural", "white", "light", "warm")) +]] = Silk_Plain_Chiffon( + fabric_color: color(0.830770f, 0.830770f, 0.830770f), + roughness: 0.01f, + fabric_reflection: 0.98f, + sheen_weight: 0.75f, + translucency_amount: 0.12f, + fabric_bump_strength: 1.0f, + secondary_bump_size: 0.19f, + wrinkles_bump_scale: 1.0f, + warp_intensity: 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: 1.0f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Fabric/Tweed_Herringbone.mdl b/code/third_party/vMaterials_2/Fabric/Tweed_Herringbone.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9e5c0aec09a3bd34772cce47f6cf23252b21cc02 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Tweed_Herringbone.mdl @@ -0,0 +1,621 @@ +/****************************************************************************** + * 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 ::tex::*; +import ::math::*; +import ::base::*; +import ::anno::*; +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); + +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 multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = float(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_multiply + )), + base: color_1 + ); +} + + +::base::texture_return blend_colors( + color color_1 = color(1.0f, 0.0f, 0.0f), + color color_2 = color(0.0f, 1.0f, 0.0f), + float blend = 0.5f +) +[[ + ::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 + ); +} + + + + +// Iteration of the tweed material to be more flexible and advanced +export material Tweed_Herringbone( + color tweed_color_1 = color(0.6f, 0.1f, 0.1f) + [[ + ::anno::display_name("Tweed Color A"), + ::anno::description("The first color of the two colored tweed pattern."), + ::anno::in_group("Appearance") + ]], + color tweed_color_2 = color(0.7f) + [[ + ::anno::display_name("Tweed Color B"), + ::anno::description("The second color of the two colored tweed pattern."), + ::anno::in_group("Appearance") + ]], + float diffuse_AO_contribution = 1.0f + [[ + ::anno::display_name("Diffuse AO Weight"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::description("Controls how much precomputed AO is weighted into the fabric."), + ::anno::in_group("Appearance") + ]], + float fuzz_weight = 0.1f + [[ + ::anno::display_name("Fuzz Weight"), + ::anno::soft_range(0.0f, 0.3), + ::anno::hard_range(0.0f, 0.3), + ::anno::description("The intensity of the fuzz map on the material."), + ::anno::in_group("Appearance") + ]], + uniform float reflection_weight = 1.0f + [[ + ::anno::display_name("Reflection Weight"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::description("The weight of the reflection of the material. General Reflectivity for this " + "material is set intentionally lower to avoid unrealistic looks."), + ::anno::in_group("Appearance") + ]], + uniform float bump_amount = .5f + [[ + ::anno::display_name("Bump Amount"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::description("Specifies the strength of the bump map."), + ::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(2.0f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(2.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 vMaterials"), + ::anno::display_name("Tweed - Default"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "multicolored", "contrast")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() +]] = let{ + + // * Tweed Fibers texture ^/ + // * Tweed Mask texture ^/ + // * Tweed Normal texture ^/ + // * Tweed Fuzz texture ^/ + // * Tweed AO Texture + // * Tweed Color 1 + // * Tweed Color 2 + // * Fuzz (Dust) Fibers Amount + // * Fuzz AO to diffuse + // * Bump Amount + + // Simple diffuse layer with bump + // Colors get blended via Mask texture + // Then multiplied with the fibers + // Then multiplied with the AO + // Fuzz: Another diffuse layer on top, no bump. Let's see how this works out + // Maybe make the fuzz with a falloff layer, so it is stronger at grazing angles + // + + texture_2d tweed_fibers_diff_texture = texture_2d("./textures/tweed_fibers_diff.jpg" , ::tex::gamma_srgb); + texture_2d tweed_mask_texture = texture_2d("./textures/tweed_mask.png" , ::tex::gamma_srgb); + texture_2d tweed_fuzz_texture = texture_2d("./textures/tweed_fuzz_diff.png" , ::tex::gamma_srgb); + texture_2d tweed_AO_texture = texture_2d("./textures/tweed_AO.jpg" , ::tex::gamma_srgb); + texture_2d tweed_normal_texture = texture_2d("./textures/tweed_norm.jpg" , ::tex::gamma_linear); + + float material_ior = float(1.8); + float roughness = 0.5; + + ::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(7.5f/texture_scale.x, 7.5f/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_return fibers_diffuse = ::base::file_texture( + texture: tweed_fibers_diff_texture, + color_scale: color(1.0), + uvw: transformed_uvw + ); + + ::base::texture_return tweed_mask = ::base::file_texture( + texture: tweed_mask_texture, + 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 + ); + + ::base::texture_return tweed_AO_map = ::base::file_texture( + texture: tweed_AO_texture, + 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 + ); + + ::base::texture_return tweed_fuzz_map = ::base::file_texture( + texture: tweed_fuzz_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: ::base::mono_alpha, + uvw: transformed_uvw + ); + + + + // Blending the two tweed colors via the colors mask + ::base::texture_return tweed_color_blend = blend_colors(tweed_color_1, tweed_color_2, tweed_mask.mono); + + // Blending the fibers + ::base::texture_return tweed_color_fiber_blend = multiply_colors(tweed_color_blend.tint, fibers_diffuse.tint); + + // Blending in AO + ::base::texture_return tweed_color_fiber_AO_blend = multiply_colors(tweed_color_fiber_blend.tint, tweed_AO_map.tint, diffuse_AO_contribution); + + + bsdf glossy_bsdf = ::df::simple_glossy_bsdf( + mode: ::df::scatter_reflect, + tint: color(1.0f), + roughness_u: roughness + ); + + bsdf diffuse_bsdf = ::df::diffuse_reflection_bsdf( + tint: tweed_color_fiber_AO_blend.tint + ); + + bsdf diffuse_fuzz_bsdf = ::df::diffuse_reflection_bsdf( + tint: tweed_fuzz_map.tint + ); + + bsdf final_bsdf = ::df::weighted_layer( + base: diffuse_bsdf, + weight: tweed_fuzz_map.mono * fuzz_weight, + layer: diffuse_fuzz_bsdf + ); + + float3 bump = ::base::tangent_space_normal_texture( + texture: tweed_normal_texture, + factor: bump_amount, + uvw: transformed_uvw + ); + + +} in material( + surface: material_surface( + scattering: ::df::fresnel_layer( + ior: material_ior, + weight: reflection_weight * 0.15, + layer: glossy_bsdf, + base: final_bsdf + ) + ), + geometry: material_geometry( + normal: bump + ) +); + +// 2 +export material Tweed_Herringbone_Dark_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Dark Blue"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "multicolored", "contrast", "blue", "gray", "cool")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.001202f, 0.039947f, 0.101145f), + tweed_color_2: color(0.554227f, 0.511398f, 0.487765f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 3 +export material Tweed_Herringbone_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Gray"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "neutral", "gray")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.082414f, 0.082414f, 0.082414f), + tweed_color_2: color(0.409826f, 0.409826f, 0.409826f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + + +// 4 +export material Tweed_Herringbone_Black_White(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Black White"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "contrast", "multicolored", "neutral", "black", "white")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Black_White.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.673049f, 0.673049f, 0.673049f), + tweed_color_2: color(0.031551f, 0.031551f, 0.031551f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 5 +export material Tweed_Herringbone_Brown(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Brown"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "brown")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Brown.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.547994f, 0.409826f, 0.212044f), + tweed_color_2: color(0.160444f, 0.080219f, 0.026549f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 6 +export material Tweed_Herringbone_Mustard(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Mustard"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "mustard", "orange", "warm")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Mustard.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.673049f, 0.535642f, 0.431340f), + tweed_color_2: color(0.592438f, 0.234895f, 0.039947f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 7 +export material Tweed_Herringbone_Blue_Khaki(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Blue Khaki"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "blue", "khaki", "light")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Blue_Khaki.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.054592f, 0.193972f, 0.267358f), + tweed_color_2: color(0.499505f, 0.447871f, 0.315763f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 8 +export material Tweed_Herringbone_Dark_Brown(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Dark Brown"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "brown", "contrast")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Brown.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.101145f, 0.051122f, 0.037029f), + tweed_color_2: color(0.796917f, 0.722672f, 0.523443f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 9 +export material Tweed_Herringbone_Red_Vanilla(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Red Vanilla"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "multicolored", "contrast", "red", "vanilla")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Red_Vanilla.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.932277f, 0.851252f, 0.638779f), + tweed_color_2: color(0.353741f, 0.011881f, 0.009696f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 10 +export material Tweed_Herringbone_Olive_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Olive Green"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "green")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Olive_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.075926f, 0.227137f, 0.060032f), + tweed_color_2: color(0.280124f, 0.487765f, 0.190463f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 11 +export material Tweed_Herringbone_Saturated_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Saturated Green"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "green", "saturated")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Saturated_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.012664f, 0.069727f, 0.014311f), + tweed_color_2: color(0.130352f, 0.404541f, 0.096266f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 12 +export material Tweed_Herringbone_Purple_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Purple Orange"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "saturated", "multicolored", "orange", "purple")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Purple_Orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.751895f, 0.151058f, 0.069727f), + tweed_color_2: color(0.130352f, 0.018913f, 0.284452f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); + +// 13 +export material Tweed_Herringbone_Green_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tweed - Green Blue"), + ::anno::description("A tweed material with a layer of fuzz on top."), + ::anno::key_words(string[]("design", "fabric", "tweed", "garment", "weave", "herringbone", "multicolored", "green", "blue")), + ::anno::thumbnail("./.thumbs/Tweed_Herringbone.Tweed_Herringbone_Green_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tweed_Herringbone( + tweed_color_1: color(0.230998f, 0.547994f, 0.163641f), + tweed_color_2: color(0.009696f, 0.204710f, 0.186989f), + + diffuse_AO_contribution: .75f, + fuzz_weight: 0.1f, + reflection_weight: 1.0f, + bump_amount: 0.5f, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f) +); diff --git a/code/third_party/vMaterials_2/Fabric/Velvet.mdl b/code/third_party/vMaterials_2/Fabric/Velvet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..50b6c8c07741cc497fafc05455bbe167c71f37f1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Velvet.mdl @@ -0,0 +1,770 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + + +::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 + ); +} + +::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)); +} + + +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 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)); +} + + +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; +} + + +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); +} + + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + + + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + + +// 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 + )); +} + + + + +export material Velvet( + color velvet_color = color(0.401978f, 0.007499f, 0.027321f) [[ + ::anno::description("Sets the color of the fabric."), + ::anno::display_name("Velvet Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness_variation = 0.5f [[ + ::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 sheen_falloff = 0.09f [[ + ::anno::description("Low values give a stronger whitish sheen gloss on the material while higher values make the effect only visible when viewing the material at grazing angles."), + ::anno::display_name("Sheen Falloff"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float sheen_saturation = 0.69f [[ + ::anno::description("When set to zero, the sheen color is white. When increased, the color of the sheen fades towards the color of the fabric. Can be used to create intensely tinted sheen reflections."), + ::anno::display_name("Sheen Saturation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float sheen_brightness = 0.52f [[ + ::anno::description("Controls the brightness of the sheen."), + ::anno::display_name("Sheen Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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 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(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 = 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(11) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Royal Red"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(1.f, ::df::sheen_bsdf(::math::pow(::math::lerp(0.680000007f, 0.149999991f, histogram_range(float3(endless_texture(texture_2d("./textures/velvet_imperfections.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.252999991f), 4.f, false)).x * roughness_variation, roughness_variation, ::math::lerp((sheen_falloff * 0.5f + 0.5f) * 0.800000012f, (sheen_falloff * 0.5f + 0.5f) * 0.949999988f, roughness_variation))), 3.78999996f), hsl2rgb(float3(rgb2hsl(float3(velvet_color)).x, sheen_saturation, ::math::lerp(0.200000003f, 0.610000014f, sheen_brightness))), color(1.f, 1.f, 1.f), ::df::custom_curve_layer(0.0299999993f, 0.359999985f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(0.313600004f, 0.739599943f, color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(velvet_color)).x, rgb2hsl(float3(velvet_color)).y * 0.920000017f, rgb2hsl(float3(velvet_color)).z * 0.800000012f)), color(::math::pow(::base::file_texture(texture_2d("./textures/velvet_diff.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.159999996f)), float2(0.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, 1.50999999f)), ::base::color_layer_overlay, 1.f, true).tint, color(1.f - float3(endless_texture(texture_2d("./textures/velvet_imperfections.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.252999991f), 4.f, false)).x * roughness_variation), ::base::color_layer_multiply, roughness_variation * 0.5f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/velvet_imperfections.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.252999991f), 4.f, false)).x * roughness_variation, roughness_variation, 0.519999981f)), normalmap_normal(texture_2d("./textures/velvet_norm.jpg", ::tex::gamma_linear), 1.f, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.159999996f))))), bsdf(), normalmap_normal(texture_2d("./textures/velvet_norm.jpg", ::tex::gamma_linear), 1.f, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.159999996f)))), 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); + +// 2 +export material Velvet_Bordeaux(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Bordeaux"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Bordeaux.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "bordeaux", "red", "dark", "warm")) +]] = Velvet( + velvet_color: color(0.147027f, 0.006512f, 0.033105f), + roughness_variation: 0.5f, + sheen_falloff: 0.15f, + sheen_saturation: .45f, + sheen_brightness: .7f, + 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.0f, + roundcorners_across_materials: false +); + +// 3 +export material Velvet_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Blue"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Blue.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "blue", "saturated", "cool")) +]] = Velvet( + velvet_color: color(0.005605f, 0.082283f, 0.313989f), + roughness_variation: 0.5f, + sheen_falloff: 0.15f, + sheen_saturation: .75f, + sheen_brightness: .64f, + 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.0f, + roundcorners_across_materials: false +); + + +// 4 +export material Velvet_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Orange"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Orange.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "orange", "warm", "saturated")) +]] = Velvet( + velvet_color: color(0.887923f, 0.318547f, 0.029557f), + roughness_variation: 0.5f, + sheen_falloff: 0.15f, + sheen_saturation: .78f, + sheen_brightness: .65f, + 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.0f, + roundcorners_across_materials: false +); + + +// 5 +export material Velvet_Turquoise(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Turquoise"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Turquoise.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "cool", "saturated", "turquoise")) +]] = Velvet( + velvet_color: color(0.006995f, 0.155926f, 0.278894f), + roughness_variation: 0.5f, + sheen_falloff: 0.15f, + sheen_saturation: .64f, + sheen_brightness: .49f, + 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.0f, + roundcorners_across_materials: false +); + + +// 6 +export material Velvet_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Green"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Green.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "green", "saturated")) +]] = Velvet( + velvet_color: color(0.004391f, 0.155926f, 0.010960f), + roughness_variation: 0.5f, + sheen_falloff: 0.15f, + sheen_saturation: .58f, + sheen_brightness: .71f, + 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.0f, + roundcorners_across_materials: false +); + + +// 7 +export material Velvet_Eggplant(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Eggplant"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Eggplant.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "eggplant", "red", "warm", "dark")) +]] = Velvet( + velvet_color: color(0.051269f, 0.004025f, 0.024158f), + roughness_variation: 0.75f, + sheen_falloff: 0.45f, + sheen_saturation: .59f, + sheen_brightness: .33f, + 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.0f, + roundcorners_across_materials: false +); + + +// 8 +export material Velvet_White(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - White"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_White.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "white", "neutral", "light")) +]] = Velvet( + velvet_color: color(0.783538f, 0.783538f, 0.783538f), + roughness_variation: 0.71f, + sheen_falloff: 0.36f, + sheen_saturation: .0f, + sheen_brightness: .93f, + 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.0f, + roundcorners_across_materials: false +); + + +// 9 +export material Velvet_Black(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Black"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Black.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "black", "neutral", "dark")) +]] = Velvet( + velvet_color: color(0.003035f, 0.003035f, 0.003035f), + roughness_variation: 0.5f, + sheen_falloff: 0.15f, + sheen_saturation: .01f, + sheen_brightness: .49f, + 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.0f, + roundcorners_across_materials: false +); + +// 10 +export material Velvet_Shimmering_Dark_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Shimmering Dark Red"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Shimmering_Dark_Red.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "dark", "red", "warm")) +]] = Velvet( + velvet_color: color(0.064803f, 0.002732f, 0.006995f), + roughness_variation: 0.64f, + sheen_falloff: 0.4f, + sheen_saturation: .7f, + sheen_brightness: .52f, + 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.0f, + roundcorners_across_materials: false +); + + +// 11 +export material Velvet_Shimmering_Emerald(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Shimmering Emerald"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Shimmering_Emerald.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "emerald", "green", "dark")) +]] = Velvet( + velvet_color: color(0.004391f, 0.051269f, 0.024158f), + roughness_variation: 0.5f, + sheen_falloff: 0.15f, + sheen_saturation: .45f, + sheen_brightness: .54f, + 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.0f, + roundcorners_across_materials: false +); + +// 12 +export material Velvet_Shimmering_Dark_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Shimmering Dark Blue"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Shimmering_Dark_Blue.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "dark", "blue", "cool", "saturated")) +]] = Velvet( + velvet_color: color(0.003035f, 0.003035f, 0.266356f), + roughness_variation: 0.5f, + sheen_falloff: 0.13f, + sheen_saturation: .09f, + sheen_brightness: .78f, + 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.0f, + roundcorners_across_materials: false +); + +// 13 +export material Velvet_Shimmering_Purple(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Shimmering Purple"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Shimmering_Purple.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "purple", "dark", "saturated")) +]] = Velvet( + velvet_color: color(0.016807f, 0.003347f, 0.074214f), + roughness_variation: 0.5f, + sheen_falloff: 0.13f, + sheen_saturation: .85f, + sheen_brightness: .85f, + 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.0f, + roundcorners_across_materials: false +); + + +// 14 +export material Velvet_Ocean_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Ocean Blue"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Ocean_Blue.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers")) +]] = Velvet( + velvet_color: color(0.001821f, 0.015209f, 0.027321), + roughness_variation: 0.67f, + sheen_falloff: 0.09f, + sheen_saturation: .31f, + sheen_brightness: .52f, + 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.0f, + roundcorners_across_materials: false +); + + +// 15 +export material Velvet_Dark_Grey(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Velvet - Dark Grey"), + ::anno::description("Velvet material model that shows a soft sheen when the material is viewed at grazing angles. The coloration and the intensity of the sheen can be controlled."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Velvet.Velvet_Dark_Grey.png"), + ::anno::key_words(string[]("fabric", "velvet", "soft", "sheen", "new", "interior", "automotive", "design", "matte", "fibers", "gray", "neutral", "dark")) +]] = Velvet( + velvet_color: color(0.006049f, 0.006049f, 0.006049f), + roughness_variation: 0.67f, + sheen_falloff: 0.09f, + sheen_saturation: .0f, + sheen_brightness: .51f, + 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.0f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Fabric/Wool_Melton.mdl b/code/third_party/vMaterials_2/Fabric/Wool_Melton.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5bca20e6063426c3cb140954019025ce2b4edbd9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Wool_Melton.mdl @@ -0,0 +1,811 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A wool material."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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)); +} + +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); +} + +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 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); +} + +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; +} + +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)); +} + +struct vm_coordinates{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +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; +} + + +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); +} + + + +// Returns an infinite lookup plus a normal map lookup +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; +} + + +export material Wool_Melton( + color fabric_color = color(0.637597f, 0.637597f, 0.637597f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Fabric Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 1.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 white_fibers_weight = 0.29f [[ + ::anno::description("Adds a white fuzz layer on the material which gives it a more used appearance."), + ::anno::display_name("White Fibers Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float sheen_weight = 0.38f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::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, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], + 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 = 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(11) + ]]) +[[ + ::anno::display_name("Wool Melton - White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "white", "light", "neutral")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.11f; // texture covers 11 cm, scale up so it covers 1m per default + + texture_2d multi_tex = texture_2d("./textures/wool_melton_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d diff_fuzz_tex = texture_2d("./textures/wool_melton_R_diff_G_fuzz.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/wool_melton_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(0.0599999987f, 1.f, 5.f, histogram_range(vm_tex_infinite(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.444999993f, 0.662f, 0.472000003f), 1.f, false, 2.20000005f).y, 1.f, 0.459999979f), ::df::microfacet_ggx_smith_bsdf(::math::pow(histogram_range(1.f - vm_tex_infinite(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.444999993f, 0.662f, 0.472000003f), 1.f, false, 2.20000005f).x, 0.98999995f, roughness * 0.300000012f + 0.709999979f), 2.f) * ::math::pow(histogram_range(1.f - vm_tex_infinite(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.444999993f, 0.662f, 0.472000003f), 1.f, false, 2.20000005f).x, 0.98999995f, roughness * 0.300000012f + 0.709999979f), 2.f), ::math::pow(histogram_range(1.f - vm_tex_infinite(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.444999993f, 0.662f, 0.472000003f), 1.f, false, 2.20000005f).x, 0.98999995f, roughness * 0.300000012f + 0.709999979f), 2.f) * ::math::pow(histogram_range(1.f - vm_tex_infinite(multi_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.444999993f, 0.662f, 0.472000003f), 1.f, false, 2.20000005f).x, 0.98999995f, roughness * 0.300000012f + 0.709999979f), 2.f), 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(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_infinite_color_normal(diff_fuzz_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.584999979f, 0.00200000009f, 0.5f), float3(0.5f, 0.5f, 1.f), 0.159999996f, true, 2.20000005f, bump_strength).value.x, 1.f)), ::base::color_layer_overlay, 1.f, true).tint, color(1.f, 1.f, 1.f), ::base::color_layer_blend, ::math::pow(white_fibers_weight * vm_tex_infinite_color_normal(diff_fuzz_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.584999979f, 0.00200000009f, 0.5f), float3(0.5f, 0.5f, 1.f), 0.159999996f, true, 2.20000005f, bump_strength).value.y, 0.629999995f), true).tint, 0.f), bsdf(), vm_tex_infinite_color_normal(diff_fuzz_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.584999979f, 0.00200000009f, 0.5f), float3(0.5f, 0.5f, 1.f), 0.159999996f, true, 2.20000005f, bump_strength).norm)), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_infinite_color_normal(diff_fuzz_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.584999979f, 0.00200000009f, 0.5f), float3(0.5f, 0.5f, 1.f), 0.159999996f, true, 2.20000005f, bump_strength).value.x, 1.f)), ::base::color_layer_overlay, 1.f, true).tint, color(1.f, 1.f, 1.f), ::base::color_layer_blend, ::math::pow(white_fibers_weight * vm_tex_infinite_color_normal(diff_fuzz_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.584999979f, 0.00200000009f, 0.5f), float3(0.5f, 0.5f, 1.f), 0.159999996f, true, 2.20000005f, bump_strength).value.y, 0.629999995f), true).tint, 0.f), bsdf(), vm_tex_infinite_color_normal(diff_fuzz_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.584999979f, 0.00200000009f, 0.5f), float3(0.5f, 0.5f, 1.f), 0.159999996f, true, 2.20000005f, bump_strength).norm), vm_tex_infinite_color_normal(diff_fuzz_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.584999979f, 0.00200000009f, 0.5f), float3(0.5f, 0.5f, 1.f), 0.159999996f, true, 2.20000005f, bump_strength).norm), vm_tex_infinite_color_normal(diff_fuzz_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.584999979f, 0.00200000009f, 0.5f), float3(0.5f, 0.5f, 1.f), 0.159999996f, true, 2.20000005f, bump_strength).norm), 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); + + +// 2 +export material Wool_Melton_Sand(*) +[[ + ::anno::display_name("Wool Melton - Sand"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Sand.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "white", "light", "warm", "sand")) +]] = Wool_Melton( + fabric_color: color(0.637597f, 0.577580f, 0.485150f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 3 +export material Wool_Melton_Gray(*) +[[ + ::anno::display_name("Wool Melton - Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Gray.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "gray", "neutral")) +]] = Wool_Melton( + fabric_color: color(0.274677f, 0.274677f, 0.274677f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 4 +export material Wool_Melton_Tobacco(*) +[[ + ::anno::display_name("Wool Melton - Tobacco"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Tobacco.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "tobacco", "brown")) +]] = Wool_Melton( + fabric_color: color(0.155926f, 0.090842f, 0.038204f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 5 +export material Wool_Melton_Carbon(*) +[[ + ::anno::display_name("Wool Melton - Carbon"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Carbon.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "carbon", "gray", "dark", "neutral")) +]] = Wool_Melton( + fabric_color: color(0.023153f, 0.027321f, 0.031896f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 6 +export material Wool_Melton_Saffron(*) +[[ + ::anno::display_name("Wool Melton - Saffron"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Saffron.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "saffron", "orange", "warm")) +]] = Wool_Melton( + fabric_color: color(0.610496f, 0.262251f, 0.009134f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +//7 +export material Wool_Melton_Paprika(*) +[[ + ::anno::display_name("Wool Melton - Paprika"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Paprika.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "paprika", "orange", "red", "warm", "saturated")) +]] = Wool_Melton( + fabric_color: color(0.679542f, 0.066626f, 0.018500f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 8 +export material Wool_Melton_Garnet(*) +[[ + ::anno::display_name("Wool Melton - Garnet"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Garnet.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "red", "warm", "dark")) +]] = Wool_Melton( + fabric_color: color(0.215861f, 0.013702f, 0.030713f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 9 +export material Wool_Melton_Green_Tea(*) +[[ + ::anno::display_name("Wool Melton - Green Tea"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Green_Tea.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "green")) +]] = Wool_Melton( + fabric_color: color(0.230740f, 0.318547f, 0.030713f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 10 +export material Wool_Melton_Jungle(*) +[[ + ::anno::display_name("Wool Melton - Jungle"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Jungle.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "green", "dark")) +]] = Wool_Melton( + fabric_color: color(0.031896f, 0.080220f, 0.023153f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 11 +export material Wool_Melton_Fuchsia(*) +[[ + ::anno::display_name("Wool Melton - Fuchsia"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Fuchsia.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "fuchsia", "purple", "saturated", "magenta", "violet")) +]] = Wool_Melton( + fabric_color: color(0.386429f, 0.034340f, 0.171441f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 12 +export material Wool_Melton_Aubergine(*) +[[ + ::anno::display_name("Wool Melton - Aubergine"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Aubergine.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "purple", "dark", "violet")) +]] = Wool_Melton( + fabric_color: color(0.066626f, 0.019382f, 0.080220f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 13 +export material Wool_Melton_Morning_Glory(*) +[[ + ::anno::display_name("Wool Melton - Morning Glory"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Morning_Glory.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "blue", "cool")) +]] = Wool_Melton( + fabric_color: color(0.109462f, 0.114435f, 0.304987f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); + +// 14 +export material Wool_Melton_Blue_Jay(*) +[[ + ::anno::display_name("Wool Melton - Blue Jay"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Melton.Wool_Melton_Blue_Jay.png"), + ::anno::key_words(string[]("fabric", "felt","wool", "melton", "clothing", "sheen", "fashion", "new", "blue", "cool")) +]] = Wool_Melton( + fabric_color: color(0.072272f, 0.184475f, 0.479320f), + roughness: 1.0f, + white_fibers_weight: 0.1f, + sheen_weight: 0.21f, + bump_strength: 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: 1.0f, + roundcorners_across_materials: false +); diff --git a/code/third_party/vMaterials_2/Fabric/Wool_Sweater_Knit.mdl b/code/third_party/vMaterials_2/Fabric/Wool_Sweater_Knit.mdl new file mode 100644 index 0000000000000000000000000000000000000000..91a907278deb0a35f15841603721e1d2b6721a6a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/Wool_Sweater_Knit.mdl @@ -0,0 +1,1006 @@ +/****************************************************************************** + * 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::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A knitted wool sweater material."; + +annotation preview_scale( float f); + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +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 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)); +} + +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); +} + +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 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 histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +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; +} + +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)); +} + +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; +} + +vm_coordinates vm_coord_warp( + float warp_value, + vm_coordinates uv_in, + float warp_intensity = 0.1f, + bool warp_u_direction = true, + bool warp_v_direction = true + +) +{ + vm_coordinates uv = uv_in; + uv.uv = uv_in.uv + float2(warp_u_direction?1.0:0.0, warp_v_direction?1.0:0.0) * warp_value * warp_intensity; + 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(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); +} + +::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 Wool_Sweater_Knit( + color fabric_color = color(0.955973f, 0.955973f, 0.955973f) [[ + ::anno::description("Choose the color of the fabric."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.49f [[ + ::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(1) + ]], + float fabric_reflectivity = 0.44f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float sheen_weight = 0.34f [[ + ::anno::description("Adds a fuzzy, soft appearance around the material when viewed at grazing angles."), + ::anno::display_name("Sheen Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float fuzz_weight = 0.46f [[ + ::anno::description("Adds a white fuzz layer on the material which gives it a more used appearance."), + ::anno::display_name("Fuzz Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float translucency_amount = 0.f [[ + ::anno::description("A value of 0 makes the material completely opaque. Increasing the parameter value lets more light pass through the material."), + ::anno::display_name("Translucency Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + uniform bool additional_fabric_detail = false [[ + ::anno::description("Adds additional detail to the bumpiness of the fabric which gives it more of a flannel like look. The effect is subtle though."), + ::anno::display_name("Additional Fabric Detail"), + ::anno::in_group("Appearance"), + ::anno::ui_order(6) + ]], + 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, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float warp_intensity = 0.f [[ + ::anno::description("Adds a little bit of distortion to break up the perfectly regular appearance of the weaving."), + ::anno::display_name("Warp Intensity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 5.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + 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(9) + ]], + 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(10) + ]], + 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)), + ::preview_scale(3.5f), + ::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("Transform"), + ::anno::ui_order(12) + ]], + 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(13) + ]], + 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(14) + ]], + 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(15) + ]]) +[[ + ::anno::display_name("Wool Sweater Knit - White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "white", "light", "neutral")) +]] + = + let { + bool tmp0 = false; + + float2 texture_rescale = texture_scale * 0.095f; // texture covers 9.5 cm, scale up so it covers 1m per default + + texture_2d multi_tex = texture_2d("./textures/wool_knit_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear); + texture_2d fabric_warp_tex = texture_2d("./textures/french_terry_fabric_warp.png", ::tex::gamma_linear); + texture_2d wool_knit_diff_tex = texture_2d("./textures/wool_knit_R_diff.jpg", ::tex::gamma_srgb); + texture_2d fibers_tex = texture_2d("./textures/fibers.jpg", ::tex::gamma_linear); + texture_2d knit_norm_tex = texture_2d("./textures/wool_knit_norm.jpg", ::tex::gamma_linear); + texture_2d wuckerl_norm_tex = texture_2d("./textures/wuckerl_norm.jpg", ::tex::gamma_linear); + texture_2d wuckerl_multi_tex = texture_2d("./textures/wuckerl_R_ao_G_mask.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::custom_curve_layer(fabric_reflectivity * 0.0500000007f + 0.0199999996f, 1.f, 5.f, ::math::lerp(histogram_scan_big(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 2.f), 0.269999981f, 0.529999971f), histogram_scan_big(float3(vm_tex_lookup(wuckerl_multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 1.f, 0.639999986f), additional_fabric_detail ? 1.f : 0.f), ::df::microfacet_ggx_smith_bsdf(histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.48000002f), 0.98999995f, roughness * 0.449999988f + 0.5f) * histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.48000002f), 0.98999995f, roughness * 0.449999988f + 0.5f), histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.48000002f), 0.98999995f, roughness * 0.449999988f + 0.5f) * histogram_range(::math::pow(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).x, 2.48000002f), 0.98999995f, roughness * 0.449999988f + 0.5f), 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(sheen_weight, ::df::sheen_bsdf(0.0700000003f, hsl2rgb(rgb2hsl(float3(fabric_color)) * float3(1.f, 0.74000001f, 1.f)), color(1.f, 1.f, 1.f), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::weighted_layer(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.75999999f, 0.199999988f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup(wool_knit_diff_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 0.479999989f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.610000014f, 0.519999981f)), ::base::color_layer_multiply, 1.f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.87f, 1.88f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), additional_fabric_detail ? ::base::blend_normals(vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), 1.f, vm_tex_normal_lookup(wuckerl_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), additional_fabric_detail ? 1.f : 0.f) : vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), additional_fabric_detail ? ::base::blend_normals(vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), 1.f, vm_tex_normal_lookup(wuckerl_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), additional_fabric_detail ? 1.f : 0.f) : vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength))), ::df::weighted_layer(translucency_amount * 0.200000003f, ::df::weighted_layer(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.75999999f, 0.199999988f), ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(hsl2rgb(float3(rgb2hsl(float3(fabric_color)).x, ::math::min(rgb2hsl(float3(fabric_color)).y, ::math::pow(rgb2hsl(float3(fabric_color)).z, 0.149999991f)), 0.5f)), color(::math::pow(histogram_scan_big(1.f - float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).z, 0.810000002f, 0.319999993f), 2.20000005f)), ::base::color_layer_multiply, 1.f, true).tint), ::df::specular_bsdf(color(1.f, 1.f, 1.f), ::df::scatter_transmit), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(fabric_color, color(::math::lerp(1.f, vm_tex_lookup(wool_knit_diff_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_r, float4(1.f)).mono, 0.479999989f)), ::base::color_layer_overlay, 1.f, true).tint, color(histogram_scan_big(float3(vm_tex_lookup(multi_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), mono_a, float4(1.f)).tint).y, 0.610000014f, 0.519999981f)), ::base::color_layer_multiply, 1.f, true).tint, color(0.913098991f, 0.913098991f, 0.913098991f), ::base::color_layer_blend, fuzz_weight * vm_tex_infinite(fibers_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(1.87f, 1.88f)), float3(0.00400000019f), 1.f, false, 2.20000005f).x, true).tint, 1.86000001f), 0.f), bsdf(), additional_fabric_detail ? ::base::blend_normals(vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), 1.f, vm_tex_normal_lookup(wuckerl_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), additional_fabric_detail ? 1.f : 0.f) : vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), additional_fabric_detail ? ::base::blend_normals(vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), 1.f, vm_tex_normal_lookup(wuckerl_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), additional_fabric_detail ? 1.f : 0.f) : vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), additional_fabric_detail ? ::base::blend_normals(vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), 1.f, vm_tex_normal_lookup(wuckerl_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), additional_fabric_detail ? 1.f : 0.f) : vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), additional_fabric_detail ? ::base::blend_normals(vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), 1.f, vm_tex_normal_lookup(wuckerl_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength), additional_fabric_detail ? 1.f : 0.f) : vm_tex_normal_lookup(knit_norm_tex, vm_coord_warp(vm_tex_lookup(fabric_warp_tex, vm_coord(float2(0.f), 0.f, texture_rescale * float2(4.6500001f, 4.50999975f), 0), mono_a, float4(1.f)).mono, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), warp_intensity * 0.100000001f, false, true), bump_strength)), 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); + +// 2 +export material Wool_Sweater_Knit_Oyster(*) +[[ + ::anno::display_name("Wool Sweater Knit - Oyster"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Oyster.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "oyster", "white", "light", "warm", "neutral")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.846873f, 0.783538f, 0.651406f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false +); + +// 3 +export material Wool_Sweater_Knit_Sand(*) +[[ + ::anno::display_name("Wool Sweater Knit - Sand"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Sand.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "sand", "light")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.672443f, 0.558340f, 0.407240f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 4 +export material Wool_Sweater_Knit_Black_Pepper(*) +[[ + ::anno::display_name("Wool Sweater Knit - Black Pepper"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Black_Pepper.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "black", "dark", "neutral")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.127438f, 0.109462f, 0.088656f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 5 +export material Wool_Sweater_Knit_Tobacco(*) +[[ + ::anno::display_name("Wool Sweater Knit - Tobacco"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Tobacco.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "brown", "saturated")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.304987f, 0.174647f, 0.072272f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 6 +export material Wool_Sweater_Knit_Carbon(*) +[[ + ::anno::display_name("Wool Sweater Knit - Carbon"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Carbon.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "black", "dark", "neutral")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.023153f, 0.027321f, 0.031896f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 7 +export material Wool_Sweater_Knit_Charcoal(*) +[[ + ::anno::display_name("Wool Sweater Knit - Charcoal"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Charcoal.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "dark", "gray", "neutral")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.141263f, 0.149960f, 0.158961f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 8 +export material Wool_Sweater_Knit_Fog(*) +[[ + ::anno::display_name("Wool Sweater Knit - Fog"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fog.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "gray", "neutral")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.456411f, 0.428690f, 0.401978f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 9 +export material Wool_Sweater_Knit_Saffron(*) +[[ + ::anno::display_name("Wool Sweater Knit - Saffron"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Saffron.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "saffron", "orange", "saturated", "warm")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.610496f, 0.262251f, 0.009134f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 10 +export material Wool_Sweater_Knit_Paprika(*) +[[ + ::anno::display_name("Wool Sweater Knit - Paprika"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Paprika.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "orange", "red", "saturated", "warm")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.679542f, 0.114435f, 0.052861f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 11 +export material Wool_Sweater_Knit_Garnet(*) +[[ + ::anno::display_name("Wool Sweater Knit - Garnet"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Garnet.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "red", "dark", "saturated", "warm")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.215861f, 0.013702f, 0.030713f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 12 +export material Wool_Sweater_Knit_Emerald(*) +[[ + ::anno::display_name("Wool Sweater Knit - Emerald"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Emerald.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "green", "dark")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.078187f, 0.152926f, 0.061246f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 13 +export material Wool_Sweater_Knit_Green_Tea(*) +[[ + ::anno::display_name("Wool Sweater Knit - Green Tea"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Green_Tea.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "green", "saturated")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.323143f, 0.450786f, 0.040915f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 14 +export material Wool_Sweater_Knit_Fuchsia(*) +[[ + ::anno::display_name("Wool Sweater Knit - Fuchsia"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fuchsia.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "fuchsia", "purple", "saturated", "magenta", "violet")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.226966f, 0.035601f, 0.194618f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 15 +export material Wool_Sweater_Knit_Purple(*) +[[ + ::anno::display_name("Wool Sweater Knit - Purple"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Purple.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "purple", "saturated", "violet")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.226966f, 0.035601f, 0.194618f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 16 +export material Wool_Sweater_Knit_Aubergine(*) +[[ + ::anno::display_name("Wool Sweater Knit - Aubergine"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Aubergine.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "purple", "dark", "violet")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.093059f, 0.026241f, 0.111932f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); + +// 17 +export material Wool_Sweater_Knit_Blue_Jay(*) +[[ + ::anno::display_name("Wool Sweater Knit - Blue Jay"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Miguel Guerrero"), + ::anno::contributor("Vanni Brighella"), + ::anno::thumbnail("./.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Blue_Jay.png"), + ::anno::key_words(string[]("fabric", "wool", "knit", "knitting", "clothing", "sheen", "fashion", "new", "blue", "cool")) +]] = Wool_Sweater_Knit( + fabric_color: color(0.072272f, 0.184475f, 0.479320f), + roughness: 0.5f, + fabric_reflectivity: 0.44f, + sheen_weight: 0.34f, + fuzz_weight: 0.46f, + translucency_amount: 0.0f, + additional_fabric_detail: false, + bump_strength: 1.0f, + warp_intensity: 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: 1.5f, + roundcorners_across_materials: false + +); diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..8b18b0ba1268a521e074145cb237ae5e8da914d8 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a72c174b26f1e24905f2f2661bcaf777e7bdfb4386c0115625c0aa207234f51 +size 98165 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..8b18b0ba1268a521e074145cb237ae5e8da914d8 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a72c174b26f1e24905f2f2661bcaf777e7bdfb4386c0115625c0aa207234f51 +size 98165 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear_Blueish.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear_Blueish.png new file mode 100644 index 0000000000000000000000000000000000000000..306b32eaec3689b279eb6a9d93a1bf0afeb72f8b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear_Blueish.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2d48f6fff7eab6ba88f48950d568caf8537bc7d215ad9228989535d16cb8a27 +size 98217 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear_Greenish.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear_Greenish.png new file mode 100644 index 0000000000000000000000000000000000000000..21cbfedaa0bff0d615a41c5094bf6f4f9e43bfad --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear_Greenish.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:150bbf9d41bb01e681ebdd7b9d0ef6b00cef4e6cab6b215d51c339bec39dc24e +size 98202 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..4633db61f4df78d7f937c7ce29e24afa62b0d716 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69e31f5a5d89f773a4cbbeb94f4df0cf85e8307c6f21d7a7f7cba702c8536547 +size 94760 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Blue.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..ef2736afc4e5765823d65506ff7e054094efb842 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcbed27be3b6011e06080978ea86178f310ed92e3d39789b11eea06e13344128 +size 92218 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Orange.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..bc9456b2c69ee32a7bb4be05986938a4ba20035a --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cb401eb6750f32e14d9e1ef551a27d6344a66694898757054ac08be034bd098 +size 95905 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Purple.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..06d32f9942b2ae448bfcb7b70ea96567ef023430 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef205054ec3c5ab905ddb8ea3e7e8c6bd865124df7880d9d74f6389d3978e4af +size 96878 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Red.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..6dbd4483761bef559f5f81c5e3b7ddb7f436893a --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8175171faa41434b7662649bd4eda9eec3e188a24a65561f57efd05fad9978c +size 92201 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Sea_Blue.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Sea_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..54d63bc1674cec6d90910993b7a939b6d6c35205 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Sea_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2628e40b021f727559d2ef556f56655b89efcd4478b3cfed6455f6f763a7171 +size 98103 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Yellow.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..b96dd66f3767e96dc07823e3e3c0508529799ab4 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dd4179a5a6636400d519d29b6777c9f4fdceacfac2686ed6a73f4ddb132b82b +size 98273 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Colored.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Colored.png new file mode 100644 index 0000000000000000000000000000000000000000..4633db61f4df78d7f937c7ce29e24afa62b0d716 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Colored.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69e31f5a5d89f773a4cbbeb94f4df0cf85e8307c6f21d7a7f7cba702c8536547 +size 94760 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..60867308ae7e8d86b7783f55a83d7acef3d9733d --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed784f994c1c578844c959484975f26d316af1dd86ece7b57645a7cd2a876779 +size 112587 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Heavy_Dirt_Dust.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Heavy_Dirt_Dust.png new file mode 100644 index 0000000000000000000000000000000000000000..648fd862aa645dfa787dfa00bfb53c717e3a706a --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Heavy_Dirt_Dust.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65259fcad7f391e20c8bc456a14c1750affede01bd03d49f8579f887c2e8433e +size 112376 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Heavy_Mixed_Dirt.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Heavy_Mixed_Dirt.png new file mode 100644 index 0000000000000000000000000000000000000000..d7b1530b201ccc310c65feef9e6e0640135df4a6 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Heavy_Mixed_Dirt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c97fc877f8cb1b02b1c70973b415149b00f5c84191c29b5ebb7f059844100349 +size 119943 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Drop_Stains.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Drop_Stains.png new file mode 100644 index 0000000000000000000000000000000000000000..ff69211f9b64883caa48603e2766df6d0d1e8dd4 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Drop_Stains.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33c5c185d46154544963fde4fe9c4dce8f4501edf5bd8eef97609b8ea568a9d8 +size 104571 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Dusty_Dirt.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Dusty_Dirt.png new file mode 100644 index 0000000000000000000000000000000000000000..af76ac0330d89ec9eb2ce0715a218e1ad66592d0 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Dusty_Dirt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b546959a2062854ca7a456299e4666e8b110031915284e2abe250c5cd7d0defd +size 106186 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Mixed_Dirt.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Mixed_Dirt.png new file mode 100644 index 0000000000000000000000000000000000000000..08c74c0050f304d2346bd9c8d72f33ce5a46a16c --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Mixed_Dirt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:981ebf41813ff2da29cc8698ce4b4b97b613976dee40751855945229fddd06e7 +size 108121 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Dirty.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Dirty.png new file mode 100644 index 0000000000000000000000000000000000000000..60867308ae7e8d86b7783f55a83d7acef3d9733d --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Dirty.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed784f994c1c578844c959484975f26d316af1dd86ece7b57645a7cd2a876779 +size 112587 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..949af3d4103145e48c1f553076ad0279aaa0262e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ec41282acff058bfd7a90354454b49cd1466aff86611771b01912bd41cc236e +size 157909 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Clear_Large_Frit.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Clear_Large_Frit.png new file mode 100644 index 0000000000000000000000000000000000000000..e782ebc2c1e3144f638e7af6cd3a1016d4e91df4 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Clear_Large_Frit.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2c9e8cb0f2232e7a1115c2696981e8a6dc40097bd2ab5c666370e84e790927e +size 160726 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Clear_Medium_Frit.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Clear_Medium_Frit.png new file mode 100644 index 0000000000000000000000000000000000000000..2668f927ed43435ba06bb3d2402f7e84813352fa --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Clear_Medium_Frit.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b82827fe46ac97b27302ff8f30314d388d20de4c87be6efea3cee86e9067eab +size 165308 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Fritted.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Fritted.png new file mode 100644 index 0000000000000000000000000000000000000000..949af3d4103145e48c1f553076ad0279aaa0262e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Fritted.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ec41282acff058bfd7a90354454b49cd1466aff86611771b01912bd41cc236e +size 157909 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..f9e53a111d54bae3d39119c883168af94b2ee8a7 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:019401d26c043324c35434e543958c31df36e12850193de539ad8458242ef14a +size 74883 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel.png new file mode 100644 index 0000000000000000000000000000000000000000..f9e53a111d54bae3d39119c883168af94b2ee8a7 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:019401d26c043324c35434e543958c31df36e12850193de539ad8458242ef14a +size 74883 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Bronze.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Bronze.png new file mode 100644 index 0000000000000000000000000000000000000000..8040dd97c67c430809d6d78d48cf56514c910282 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Bronze.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:060c3df55d90dfd4732b7c72fc8094fa5bb089db67bed79b61a3d76aa2bc19e4 +size 78079 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Cool_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Cool_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..6c32bf7ae91ed52949916cd4b1b7d6f44279e902 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Cool_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e390e59622726a8ecbb957843e2524b9ba9d1fc86ce10652d8e45c8b93c582f +size 73776 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Dark_Blue.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..1ee40426199f6cb2e7260deb23f1247480affebd --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:487c399c869b64290bf6f9475be19d36e0f8341820cc648b0a261448e7d48e07 +size 82043 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Dark_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..5a8d8a723f350955dcd525b10f3d1bcb42f6e28f --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e92198eb6dc4d0d9272c353458957553cf6538eaf481f947508118cf332b3747 +size 76922 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Evergreen.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Evergreen.png new file mode 100644 index 0000000000000000000000000000000000000000..debf08f00ab7485ad655e94769dfaf6e06d9a198 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Evergreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc60461744ef36c6f25e24bc98321d183321951109771235eee436c814401709 +size 78012 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_White.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_White.png new file mode 100644 index 0000000000000000000000000000000000000000..8864717eb61f075f42b1bb97ba25348da8b38c85 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_White.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35285689d096ee4ebdd1f5765e9ee1f10db7f6b2d6e1399ae0e71a37db6481b3 +size 73794 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..46b061fbb674e706d428bd073a18e4fbefe69478 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c3e95d5d0a0334126b92b334e36727e455deefd26f1bdbb05cb8f3614bdd5c8 +size 94967 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted.png new file mode 100644 index 0000000000000000000000000000000000000000..46b061fbb674e706d428bd073a18e4fbefe69478 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c3e95d5d0a0334126b92b334e36727e455deefd26f1bdbb05cb8f3614bdd5c8 +size 94967 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Blue_Sky.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Blue_Sky.png new file mode 100644 index 0000000000000000000000000000000000000000..dbb8664ddb70eefbe4a8fc1e7bb65122e0f57f67 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Blue_Sky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d10899069c697c6e0a780a0e1b4ba0da51185fda7565420ea1038a803e036f06 +size 93314 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Bronze.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Bronze.png new file mode 100644 index 0000000000000000000000000000000000000000..1d1fc7371dc13f588ff5461d91ca33ca89a622ab --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Bronze.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f93d83834bb60e1efa6ed1d961e4c5f4ae1ca0526f4caafac932fa72581ca0a +size 91849 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Cool_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Cool_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..485783019627967ef3be871fc7d8782687e021f3 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Cool_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67175401a6be32b309e081b2d4d0cb21c7431df6aa5be44ba9bc20f98c23c9dd +size 92364 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Blue.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..9f894783eb352f073488441558b3348dd853fb95 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15f535c18aa0678b84a3c165870b81930319e9048da503eab58140b5fc6462dd +size 90216 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Bronze.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Bronze.png new file mode 100644 index 0000000000000000000000000000000000000000..aeab150eec9bcd6096562d73d4b440b77746aee0 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Bronze.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3912e1ef0234ea31ba7341fa61810702d46fe40df958ac0269906d35139888c6 +size 89398 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..66041f8eb6682d06281ecb19999fa572fdf1e45d --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03ef288f84c675f3ce6c7b492850e9ee2594512b42128a3b85b4e1b80d22356f +size 88365 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Evergreen.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Evergreen.png new file mode 100644 index 0000000000000000000000000000000000000000..2159bbe6cd29dcdaa8b54dd54a4d1ca45bde7cb1 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Evergreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e7b5cc63fe4ff5e316688c3e563158a1a5ca73f905f3b98b5c1b333ae9bc658 +size 89885 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Green.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..c8bcc155e348099122e179fd4d45ceafa10028e7 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:298ce4644f45f3c875ac4a7ae35da0cd646a41463f26098d513fad0c0c3d1b7c +size 93216 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Light_Bronze.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Light_Bronze.png new file mode 100644 index 0000000000000000000000000000000000000000..47bd63dcc5888b086fc97eba0d72c3bfff550d88 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Light_Bronze.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e80ce0cf9228e5a255000955416d7bdbf71a9402ebecfdedc84ca0c02a33138e +size 95086 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Medium_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Medium_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..fe3ed6afea22143265d4fc047215fe3f9e2dca7b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Medium_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a927644c17eb1e5b74ce87bee292ec3d81281eed1af313dc3b6862a6b07e868c +size 91231 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Petrol.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Petrol.png new file mode 100644 index 0000000000000000000000000000000000000000..b97cca17d5afbd5a3e42bc4908f226f7393b56b5 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Petrol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56551e28157e11d3794f9962a92dfa5b198da0a974c9d5620ec7f8b42fc5300f +size 92120 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Smoked_Sky.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Smoked_Sky.png new file mode 100644 index 0000000000000000000000000000000000000000..557daad0f95b9cb2d3f3dc6045c7552c9ab1a2a9 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Smoked_Sky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34f8b8d9a001dc4de709e3aef3207919e5d55c18999bf9a82bfcbf7b97cab374 +size 89619 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Soft_Green.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Soft_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..bb903a5c33bf0b6803a9cd23d06463b97d62baf5 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Soft_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c325ced69785f0956e5ea7aacff6fefb1cddc5334a94e201faaf7a660098121 +size 95591 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Teal.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..290955422622fcef4f517dbe782e7d21de1fc464 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b24c442a75779aa88fd02c188d06e3bcd28ec4f6520462bcce9f4b97a182973d +size 92016 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..8e863da1a632ef7f736befe77e14ad138d57d712 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3499d83d8d57296fa09a5f9fc81a48c5fb6075b6cbf187be1f0bf90f14a83e2a +size 124012 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical.png new file mode 100644 index 0000000000000000000000000000000000000000..8e863da1a632ef7f736befe77e14ad138d57d712 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3499d83d8d57296fa09a5f9fc81a48c5fb6075b6cbf187be1f0bf90f14a83e2a +size 124012 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BAF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BAF.png new file mode 100644 index 0000000000000000000000000000000000000000..b8f084305c86d9cf2fa9cf8c745eb01ea3a4be19 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BAF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c585a350be15c355cf84cc50772689e2688b57e6b630046c36bbbfd75da432b6 +size 124885 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BAK.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BAK.png new file mode 100644 index 0000000000000000000000000000000000000000..a3c817f3e38ad3f4488ab05a89111205c9e922a6 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BAK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b37679016835936ba07c506d32aeee6e2e6b44da5b698fa72846b17fc566a9c +size 124645 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BALF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BALF.png new file mode 100644 index 0000000000000000000000000000000000000000..4f78e624ef853ce9bfa710feb5ffbf621a25b818 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BALF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b5cb12951adaa4eb9c4a6a50ca14fcf3046b2e373613fe20358c6165530fd88 +size 124987 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BASF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BASF.png new file mode 100644 index 0000000000000000000000000000000000000000..cdb86f639b0bfb5824b684be4d5fa355c74b8934 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BASF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a957f8de5672b4ea6db64dc8da981300acea14b8808ee4f153e54970d04805b9 +size 124840 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BK.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BK.png new file mode 100644 index 0000000000000000000000000000000000000000..4d9d52bdab0c2ba2b3228cd034055b8272450186 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13ddd15d2da00a68b67cce6a4d895caf21d090c8c8427705b65e3eaaf9955ae0 +size 124233 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_F.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_F.png new file mode 100644 index 0000000000000000000000000000000000000000..d8ab42af8a818d68ed869c06b22fcca945fedcf9 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_F.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b41cef89733576c4755f2c46d4ccdec61137916ff216701ee41b42380340a6a4 +size 124971 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_FK.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_FK.png new file mode 100644 index 0000000000000000000000000000000000000000..bdd9feda377ce3c6b5eb728937757bb6d98aac34 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_FK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:296bf8a13cf869f302bbf9b42dc97394a35cbaa25888d149cd1e45babdc0f8fc +size 123829 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_K.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_K.png new file mode 100644 index 0000000000000000000000000000000000000000..6e0f607ec23cd03b3c01e150ac1c6c9b657c020b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_K.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d6d0903ee71679c799112c959bf535f523d3cbeb24193822f2a7894d204810d +size 124400 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_KF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_KF.png new file mode 100644 index 0000000000000000000000000000000000000000..2519da19fdf1a20131ffa7c7c5e1c2da90bceb1e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_KF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89bd109e8f5aa3b94485548c7d60c623578d93959dc2fcdf11a60b565eb3574c +size 124565 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LAF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LAF.png new file mode 100644 index 0000000000000000000000000000000000000000..fb1b24e79b91eea3770373c8a9f9231cd9f70707 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LAF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5bc0eb9fa9ce1b461df65da84afef528a116be6a9037946058f7a705a5b772e +size 123761 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LAK.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LAK.png new file mode 100644 index 0000000000000000000000000000000000000000..7ae03fc495972037eac6442aef41a3ad2dab74af --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LAK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1573192aaaebb2e4feddef065d358911343b1c7e4329d251b179edecdcabd096 +size 124536 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LASF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LASF.png new file mode 100644 index 0000000000000000000000000000000000000000..269b3ee5c0ee6d81a9ebeaf6d8eaa3db8f88db94 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LASF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72cd26062a0ce78bf3dbf598bbc7dcabeb832feb15dc9c218e9a69c8f7924c5d +size 122943 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LF.png new file mode 100644 index 0000000000000000000000000000000000000000..a295e98d305d56adefab019f2905983c37b0e34d --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bf2940304f625088d0848a524e1f3bc7652f29ddf1b0bae2396f6a6c820b63b +size 125152 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LLF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LLF.png new file mode 100644 index 0000000000000000000000000000000000000000..4cae2e1686c4b326da072b4a614f588dc2a8f447 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LLF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:968ee2d90956425f0a068f34b72d8d87e2bda546444ca5da27f145e56f6d5954 +size 124071 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_PK.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_PK.png new file mode 100644 index 0000000000000000000000000000000000000000..a898486db16973acfe8f7a4c4464a068050538ad --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_PK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed1158c246907109219a2ea7c6a8c41f45f99bdf64c5f4e733f02654d4cea8bf +size 124258 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_PSK.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_PSK.png new file mode 100644 index 0000000000000000000000000000000000000000..76fc5b6345f5421b00d9fdf4fe8dde4f91a34b92 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_PSK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50c6e5eb75a63ed7a5495811337ce450df579a13d265044a9a561c4e5f7c620d +size 123970 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SF.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SF.png new file mode 100644 index 0000000000000000000000000000000000000000..a93aa7c19ec1dc3959b9c5157ffed32ae7bba07b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df85088c7909f2f3493ddaf4e59831aff4bc4c736f0c94d93a0836803d6f951d +size 123885 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SK.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SK.png new file mode 100644 index 0000000000000000000000000000000000000000..5ee4e11f39248886758dfc0390cb3fa605bda0f2 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c980fbc76b068444fe0df19fb60f3f16ad25f9bc7b7a55de7b813bbc9db4c82 +size 124615 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SSK.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SSK.png new file mode 100644 index 0000000000000000000000000000000000000000..d75aca3dada8afe86b884a42e9354816aacbedd7 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SSK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa25414a110e13aa72d564906c5a990a7ed5e8ac3f7bc18f304d856bd2e72114 +size 125107 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..eb085420fade55667e4742ec1068183a01ba2b71 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2311279703f161dc40f3b59d8395fc5dc1a0a74b2dcf27787ea8f2e58cc46539 +size 103124 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Clear_Heavy_Smudges.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Clear_Heavy_Smudges.png new file mode 100644 index 0000000000000000000000000000000000000000..1a4300478b8c51783a0b8e53a77c283b8a2ff13e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Clear_Heavy_Smudges.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b7b9bec24dad93aba0a7bbae35b741281ca9aecaf7531cd4d90011f6fcb0aac +size 113311 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Clear_Light_Smudges_Variation.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Clear_Light_Smudges_Variation.png new file mode 100644 index 0000000000000000000000000000000000000000..bea08c8c8e9fdd6a3cd54e1b50a21cbb0fbd4b09 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Clear_Light_Smudges_Variation.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8b4d32d2f00760c06326ec773c14b6cd4cee2b6e6268d2af976366b5c2b2060 +size 104515 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Smudged.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..eb085420fade55667e4742ec1068183a01ba2b71 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2311279703f161dc40f3b59d8395fc5dc1a0a74b2dcf27787ea8f2e58cc46539 +size 103124 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Clear.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..c25656880da06d4e12528c54c7c1a25b12d0c658 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a633268441b465d9a4050a144347f4b5e5e8a5d27ce77dda30cd1d91bf536d51 +size 97799 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Clear.mdl@Glazing_Clear.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Clear.mdl@Glazing_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..c25656880da06d4e12528c54c7c1a25b12d0c658 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Clear.mdl@Glazing_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a633268441b465d9a4050a144347f4b5e5e8a5d27ce77dda30cd1d91bf536d51 +size 97799 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Float.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Float.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..99a54f9ac1060c3d2a4390683c443acb165244a5 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Float.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a01c0b77a359fee98272f01b29de80f86dc5909a64a4b92894fe3918d8d3e586 +size 93613 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Float.mdl@Glazing_Float.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Float.mdl@Glazing_Float.png new file mode 100644 index 0000000000000000000000000000000000000000..99a54f9ac1060c3d2a4390683c443acb165244a5 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Glazing_Float.mdl@Glazing_Float.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a01c0b77a359fee98272f01b29de80f86dc5909a64a4b92894fe3918d8d3e586 +size 93613 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..eb78ba3641ec66fd19d34afe96d9d79e5888cdd0 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e470ca72494cbf56983c570493d17166ff51c564a5f34c30412f4c208456de3 +size 74687 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror.png new file mode 100644 index 0000000000000000000000000000000000000000..eb78ba3641ec66fd19d34afe96d9d79e5888cdd0 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e470ca72494cbf56983c570493d17166ff51c564a5f34c30412f4c208456de3 +size 74687 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Cool_Tint.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Cool_Tint.png new file mode 100644 index 0000000000000000000000000000000000000000..e7082acf52527762472b37ac114368f71098fb81 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Cool_Tint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60a2e2583ca24819315e1836a25b047a475fd716c1a93e4434e7e71b69144db5 +size 74452 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Smoked_Dark.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Smoked_Dark.png new file mode 100644 index 0000000000000000000000000000000000000000..a21c2f4174c2f9c9742c706b870dfe4a5c684e6c --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Smoked_Dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4d0ceaf7fc140b4ea4b98ff343345a9df6b22773b359001c3e44adda5805d32 +size 68551 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Smoked_Light.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Smoked_Light.png new file mode 100644 index 0000000000000000000000000000000000000000..df47162281a003f40673135be46b5d230d7e795e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Smoked_Light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1da1f670c1932939054b5e0fd02e0b9bded521a52551564dca05b752dacc032 +size 72581 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Warm_Tint.png b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Warm_Tint.png new file mode 100644 index 0000000000000000000000000000000000000000..5b0f674886d3e76fdbe862e848a0dec61a3ddc39 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Warm_Tint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ada41fae43684deb7a921f180b75f407c6c0ec68366b060b80f3213f63d087b +size 74802 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..ce1d7dc4832c4926ec9caf1ffaf2aae5a6c22645 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2480137544593b676d47087dae90dbdba760795ff15568a709ad1308c0ab799 +size 122413 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear_Blueish.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear_Blueish.png new file mode 100644 index 0000000000000000000000000000000000000000..bf5226af1b8e6e095ebc4d35d41369939367c034 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear_Blueish.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5554d1efe7ad70be7d0a0966f8ec8a0915e0002bed45c482a37b2667f52cae6f +size 118783 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear_Greenish.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear_Greenish.png new file mode 100644 index 0000000000000000000000000000000000000000..9d50eb0955be9ed56ecb0998aa839d3f90d6e9bb --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear_Greenish.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c16e3db043f54584e4d6161a0d8dcd056602349089391f45fb1942d459b98760 +size 121483 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Blue.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..b3934c53f3e71f9ff87c8c585187b87de9e4fc9b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b00eae577bc9ab6b395a6825c4a1b5a75d2244a3950b677cfcdc7b99695fd607 +size 121655 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Orange.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..f73a2d13e0306b0c8ca8edded3dde423d6f2e48c --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb02e96e292135cccf8ae5b089f6b86d6239f3d2a8e41f2f4a258c717250b7dd +size 125462 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Purple.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..315b0e13b9663b81157532cc5864444ee913b23e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da578878342d383c4620a31ef2320385ed7935816d5d279e9bc35b544d1a3b02 +size 127943 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Red.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..32fcb1a37e9a967bedbb9d92bb257e7b7de3e606 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1403de405eb2bc6fe1fc5be986f56c50256be8f2190ea0590ec521c511cffac0 +size 126269 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Sea_Blue.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Sea_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..069dce589e63ebbfc63279ca22ae3d4443bae6cc --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Sea_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19e59ed35bc732e9f46312a3a4fc9886045a75242e9c0ac5427acd136cb9b2e1 +size 126758 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Yellow.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..88b47e6380cfcf37753b52aafa9791c64d25eb1f --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c25c980a29db37481237ad2afacec42e1010ae89b107f35cf7e3b2004b67a2e4 +size 124335 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Colored.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Colored.png new file mode 100644 index 0000000000000000000000000000000000000000..1ffe675149f8c1ee38e337c828ed10349c02d471 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Colored.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc7fe18f0d007878079c3d9f88960bbd2c5b6f7631450af6bf9ca0e28a76e4b5 +size 126702 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Heavy_Dirt_Dust.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Heavy_Dirt_Dust.png new file mode 100644 index 0000000000000000000000000000000000000000..0408c257e98d5fce86695b0bafdefe279a61e91a --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Heavy_Dirt_Dust.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af2f54b5baa98962f5bd175f36ffd5e4f5c053211406128457566d2cab241a21 +size 129469 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Heavy_Mixed_Dirt.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Heavy_Mixed_Dirt.png new file mode 100644 index 0000000000000000000000000000000000000000..ecb3e9bd8ef09d004123d28338e31565029e67f0 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Heavy_Mixed_Dirt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20293f7c24a2178330e20da55d31e6492caefb0bf9ae59248aeaef2e0de8aa2a +size 129393 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Drop_Stains.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Drop_Stains.png new file mode 100644 index 0000000000000000000000000000000000000000..c0a95012fbf938fcfb4c9dca7cd9ad3d231bb797 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Drop_Stains.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc215a66e7024711fbfcc7632684e1ee2aed1c51b361c57a9448e05d1a4cc9e8 +size 127968 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Dusty_Dirt.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Dusty_Dirt.png new file mode 100644 index 0000000000000000000000000000000000000000..a23d35145f714c4d40e2bea9bfee8d7cdcc55094 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Dusty_Dirt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a508bac6e0882414ba36558320cf1962a2882b4b25df4b5943ccc35356a3ff0 +size 128217 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Mixed_Dirt.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Mixed_Dirt.png new file mode 100644 index 0000000000000000000000000000000000000000..e6582507204d21609f36b8e51fe18ecb5e685c04 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Mixed_Dirt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61c0cef62a189562f8ba598a4e315501db2778cde4fa2302c3abbfd2e1bf7f23 +size 128305 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Dirty.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Dirty.png new file mode 100644 index 0000000000000000000000000000000000000000..502c0dfa79eee34f1fd8fdf929bf9d20e2d18ec2 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Dirty.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5888e6dd91c722cccb762554102277dbd3d5e41bc443dfd74ac3a0fb8c906f31 +size 129205 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Clear_Large_Frit.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Clear_Large_Frit.png new file mode 100644 index 0000000000000000000000000000000000000000..a2a5256455ee4eaf3a6f52beb23818ebece4c33b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Clear_Large_Frit.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0cfbc2571b0b6b209a27649b657cfab4c8438de69471a2e4d743f010fad43b5 +size 131824 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Clear_Medium_Frit.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Clear_Medium_Frit.png new file mode 100644 index 0000000000000000000000000000000000000000..ba097968b04dd3af74f5ddbcbaea798e560bd56b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Clear_Medium_Frit.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdf60491460a9f5c3b488300b375e99dffb5854002e7180efe1f1b3c7fe57fb7 +size 135698 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Fritted.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Fritted.png new file mode 100644 index 0000000000000000000000000000000000000000..680082e5c8d385bc133b562d0110c2d2899b6134 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Fritted.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d708ec77d72e1dbd9e62b1381f890eeedc9f1e9898cb0a568e98e3838216452 +size 134848 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel.png new file mode 100644 index 0000000000000000000000000000000000000000..3f456fc1f340a03274dd58e1954446be3f58d084 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f5a0deb14531807ab4c4508dee0d77772ca8559de633938a9ecb2b7b29ae215 +size 101744 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Bronze.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Bronze.png new file mode 100644 index 0000000000000000000000000000000000000000..bd7dd0aa54f2c01c35270378eb6ecf07cba59f7f --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Bronze.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3cab9b3c2a9f3450c0879eafd1ea732fbf6a04f42096fcff43d5bf19615ee10 +size 101514 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Cool_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Cool_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..fe053c87c4df2c657e0c3297165b032350fdc1a1 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Cool_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49c514efe5f74e557b32cf57e82d5a9b6f1563eabc177f19df5c6c89e9cb4e6a +size 99413 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Blue.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..da823580651edd8b52afac23b03d88d407014c9b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e49643a76b620b62484e618a318ebce938512ef735f642ae7d8907c87757466 +size 103363 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..2e34475b29d44af7e687f1fdafbbbf8f7f4eb164 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7db4b74a50b8bcc4c0df2e2c5893fbbe5968bb7ad8b1fe71151ebdcdd6cf2392 +size 98531 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Evergreen.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Evergreen.png new file mode 100644 index 0000000000000000000000000000000000000000..9de05f95a449e355e24e244428fe17c3fefb69d9 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Evergreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1df8a95d3e6333f3dbdcc0841ee5736cd617017a24d3223535c45969740b8900 +size 103988 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_White.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_White.png new file mode 100644 index 0000000000000000000000000000000000000000..3bea9e3f63b8cb5d3ef596d827c22cee28289c92 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_White.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6046df1316622e5c6b252543dc9cea71c4799c4069aadb0c9bc87d2d28db40b1 +size 99144 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted.png new file mode 100644 index 0000000000000000000000000000000000000000..7734207b454af0b13555464fcb7c2d8fcae87f31 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f57190f41502cfbc5b911dfbfd9eed6a798be9ce34f8ae161058cc293c7d8fce +size 118617 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Blue_Sky.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Blue_Sky.png new file mode 100644 index 0000000000000000000000000000000000000000..ebfcd3a7a14e5a40ed915fdc97c31e1953702d08 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Blue_Sky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d2216f265638a2fbc7e9590c63fd7fd190e1a1c7999b22ea7d0830123327f9f +size 121229 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Bronze.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Bronze.png new file mode 100644 index 0000000000000000000000000000000000000000..cf6fd24da389c8ca6fbbcf0f1a3bf468476d1224 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Bronze.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:724b6d7e6309bf8fe2f8d1d998d8c29668bab9c30c738b60cd8b553f72d76310 +size 118413 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Cool_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Cool_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..59aaac6ab64cbbc33989c4f39c02e50d53820a77 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Cool_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f2000d6abb8bf76f6eb1384f239e64e5297f45bc4f63ed08acb7e82a0b08555 +size 118059 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Blue.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..095978dcedf69540a9995cfbea76e105e4b08603 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:517f7200532226cb0ebc2f244a221111343cbb70d81283bf4e1438cd8bf930be +size 119584 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Bronze.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Bronze.png new file mode 100644 index 0000000000000000000000000000000000000000..fee749901e07272a7ba52fc2190502240b028a36 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Bronze.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45d9602f3a13a593dba9721c1e39611a863fe46f0460d762bde833a6e4cac2ae +size 115784 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..3e7332c4649783863fe0bd452e7f4266f4002d5c --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e1957a86bd57777406d2824371eb221fee802c62b89d49e13b0536860cc89e7 +size 115844 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Evergreen.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Evergreen.png new file mode 100644 index 0000000000000000000000000000000000000000..d134e979a7755c8040df141089db0a37c4b0d2e1 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Evergreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2689be19e8e6e27925d3024f01a755636ad9dfd0d552c5b11a0b87e2ba0a634 +size 118714 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Green.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..4dd664491109824509ec134044060100af5fee6e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfe4440864ea44cb8a84a5ab4a3e5db68172a4fe778dcb20de63663d8a0c4797 +size 122351 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Light_Bronze.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Light_Bronze.png new file mode 100644 index 0000000000000000000000000000000000000000..c14593d33dff09e0608a4bf4a3d8ad732d8d7050 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Light_Bronze.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ffbba20155bb658f0e999fbd59698c8ef84f92402b90b39dc1266061626336b +size 121050 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Medium_Gray.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Medium_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..293cb6477f73a5a6d3175ab04ce07b4bfc8b6c50 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Medium_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c0e3f7e0da9d37ccf7ecfe3a56d954aae9ebc4889665ece757dc00361f37adf +size 115783 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Petrol.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Petrol.png new file mode 100644 index 0000000000000000000000000000000000000000..d971d5c5c38dc5e1a7f882251d1e79841f1c26bf --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Petrol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a748030c72c1478b5b668194bc094121cae36f5221e0c7575d93fb9017b2e19 +size 119675 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Smoked_Sky.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Smoked_Sky.png new file mode 100644 index 0000000000000000000000000000000000000000..32a450f05c286f9f67c51a1667845c9fba8f6d9c --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Smoked_Sky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3094262246df0454d3dd4888b8f210c565176558b97f4e3376868437c7624011 +size 117596 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Soft_Green.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Soft_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..43ea21bed3402e22ac25142f605f62075c1ca37c --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Soft_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1f61090faf728b4427016a92e707099ed0aa6eb8d8402ef666dfc74925c8298 +size 124848 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Teal.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..1ecd80fe9a2cdc9561769db3735b22acf5758446 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37c3c65eefc3953972c596b483cc29c0481fceff36fd2f1d37d6c76f8dcb48e2 +size 123348 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical.png new file mode 100644 index 0000000000000000000000000000000000000000..601ffd4a16693edd18e28463693dc1f977ff6ce8 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e68f2f7c05adae3d610dbf7fde7b85079d3fa6722d847521bf76a5f21f47bc6f +size 147940 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BAF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BAF.png new file mode 100644 index 0000000000000000000000000000000000000000..10e0c5b79980552bc932897630a7fdde6d4f520e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BAF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ab5de839a6ff3ef95e4c0cd1c816b1eb05125f6852bc1007ff29265f5b546eb +size 148368 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BAK.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BAK.png new file mode 100644 index 0000000000000000000000000000000000000000..32e2b81c0b910d7660d5b8e5b913b2ea004ad223 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BAK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb15d209ed339f4f9067270afbe03438f4e006f5c19a79b5e44c2aadef7532ea +size 148102 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BALF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BALF.png new file mode 100644 index 0000000000000000000000000000000000000000..258552ded8feeeba357b1085d6b63a7f47fe9092 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BALF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73a13ea0344cdbb345f95f981c8ea7b0458fe02395959ef2864fb7c431990d7c +size 147732 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BASF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BASF.png new file mode 100644 index 0000000000000000000000000000000000000000..7bf66ffb823dbf677d0d3f258be041cfc76a1681 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BASF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:651d58842762980693df4a780989bdcbe0b5c8d5d3e3b75de8238f93d4c2aed0 +size 148962 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BK.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BK.png new file mode 100644 index 0000000000000000000000000000000000000000..cd0da1d086ad946fc70403a4b1bb1161f47b839b --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fcac5713fcb4445edff21f30a2bea03134f73ef9ed0fb8709e637963b9e48e4 +size 148149 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_F.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_F.png new file mode 100644 index 0000000000000000000000000000000000000000..5f3c482edab1d376a00b3815416f0b51820284ae --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_F.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:997c8fd3738b3ea47df52774428e0581a0c5f2cdbe386be98e295d9b9e1385c6 +size 148397 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_FK.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_FK.png new file mode 100644 index 0000000000000000000000000000000000000000..d6167112da2e49638db206c6c892a06d8b8e0a7c --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_FK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd2a7075b04952495c72520995864eaf8e7a5783a7f8953ae87e9b1c4ca8fb90 +size 147922 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_K.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_K.png new file mode 100644 index 0000000000000000000000000000000000000000..538f49a1d865f42f88260a3f8395e7271fc02a75 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_K.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cb236b8c5fdd254ef6706a6119e505b78cf674f848cb10058014b58c58efff1 +size 148320 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_KF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_KF.png new file mode 100644 index 0000000000000000000000000000000000000000..9b6b44354b1b00aad8ac1ece756b8763add297fa --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_KF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22452988425f8a65feaa765bc7f4aa9b27718e11239b2a72fef318a56f08a494 +size 148016 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LAF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LAF.png new file mode 100644 index 0000000000000000000000000000000000000000..3dc01cc869a7d3a9b757df437847b010c0bf0cc9 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LAF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f24db8204a8cdbc9837fce71b43e9a6b4f8adac63a544e0e6734888369191ac +size 149610 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LAK.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LAK.png new file mode 100644 index 0000000000000000000000000000000000000000..03deb4a0e2ad5e7f5bb58acac57bcd569a563fa5 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LAK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:680f2ec21f2a7cccb47289cada5ab31abe23c6015435ddd0cd8efae11d465482 +size 149056 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LASF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LASF.png new file mode 100644 index 0000000000000000000000000000000000000000..08315c196b3c9e3e22615356c827c176b899032f --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LASF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:013dd90eb0d0664d7a4d6d8747a65b3006193970b2ef24e513967b1fac83fa4a +size 150606 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LF.png new file mode 100644 index 0000000000000000000000000000000000000000..80b8535e4864c51616cb0efd6847d558e783107e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:306ac33b8b226cfea87fe3ecf0a446b59f4bb6511983041cfda2c48a1cc27a32 +size 148092 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LLF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LLF.png new file mode 100644 index 0000000000000000000000000000000000000000..601eb5a09ee76d07e0eaa5a503820a16fff9f6b8 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LLF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b08f533bbbea309391190327f74760fe0a9c67ff7c234752c4919f330d9fbed +size 147979 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_PK.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_PK.png new file mode 100644 index 0000000000000000000000000000000000000000..86b2395c523508477d6e9067ded0db158f228911 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_PK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1abebb886dcdb81373be1d61a751a049f5f2d1fd4f76ddb9d0d6a0a97d4ecef5 +size 147935 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_PSK.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_PSK.png new file mode 100644 index 0000000000000000000000000000000000000000..931b3529edcd4498e5e44220ae17019ea1b46ade --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_PSK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58e38ecf8d74a650730582f0c2c79db9f01387b1540d2daa042159483261e2ac +size 147209 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SF.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SF.png new file mode 100644 index 0000000000000000000000000000000000000000..5e74ea6b27d2101a87c654452da1d2df533b1a0a --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SF.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41a77af95f55d190c82e41bf74db521dad86c22c9fd1b92a806466ec4dc2cb60 +size 149790 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SK.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SK.png new file mode 100644 index 0000000000000000000000000000000000000000..45ae988cdc5188301c33859b7c48411dc2756f6e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72e0fab73094c1cc997511e4a84b5c2a403cf8b6e9c1ec5b41eb887bfb6364d7 +size 148243 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SSK.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SSK.png new file mode 100644 index 0000000000000000000000000000000000000000..b81a369a9ebf3c5d7e4a307302220d617bbb3ec6 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SSK.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac60bd1c92e8b686f0fd6c0b115daae2a7e59426a71d554c7aba021ca2abc39e +size 148388 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Clear_Heavy_Smudges.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Clear_Heavy_Smudges.png new file mode 100644 index 0000000000000000000000000000000000000000..a5c97eae0cdf41baae66d08eec1edd34eda55fa5 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Clear_Heavy_Smudges.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:400aaec24fc76fa71ae46460cf45557a3ec7045d9be9f4a1dc6d4a2f1af91fad +size 128267 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Clear_Light_Smudges_Variation.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Clear_Light_Smudges_Variation.png new file mode 100644 index 0000000000000000000000000000000000000000..e67ae80e8d8a3a26a2907d4bfefdd72c48dfbcbb --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Clear_Light_Smudges_Variation.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21323b1a36ebf9e4e46196f810ac3429faa824c1484e5f60c603503b2857724c +size 128275 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Smudged.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..4abc7a87d2655af2e676748d0e5e41e51506f508 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aaa7099243489f1bbf6ffbf6bf3e43f987a2a05c507e1b5f1628e43eed4b00a7 +size 128362 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glazing_Clear.Glazing_Clear.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glazing_Clear.Glazing_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..5e0631b1dca1de72c3fb29854e0a74126b9e8bd2 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glazing_Clear.Glazing_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46ed13eb4005541f750bbd755bc7e6f3fd2ada8b9aa0a365d5f09a56bb1f1500 +size 122562 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Glazing_Float.Glazing_Float.png b/code/third_party/vMaterials_2/Glass/.thumbs/Glazing_Float.Glazing_Float.png new file mode 100644 index 0000000000000000000000000000000000000000..5329f282dfc58062ababe90ef5bf699e32b7bc0e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Glazing_Float.Glazing_Float.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b00dde2999446e5ece68342e511a9aaf07c155ea2c774ddf584f3b93e4564da +size 128259 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.Mirror.png b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.Mirror.png new file mode 100644 index 0000000000000000000000000000000000000000..a9b828eb4baf7ec68c866899ca0e30d3c534a200 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.Mirror.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ed3a04a3451e1662f3f492a888ca8ea5056b6d91d96902c143a257ea9f3461c +size 109958 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_cool_tint.png b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_cool_tint.png new file mode 100644 index 0000000000000000000000000000000000000000..c7e5dc7a0ac694981af338c3b7f2acc6964cdc74 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_cool_tint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1338fae4e8ceb82fb1cffe221ec3f54b6f903c721246abb56d014cbfc2b22394 +size 115622 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_smoked_dark.png b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_smoked_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..05f51c255ba27f449e67cd330e7f2e5e5ed9ded4 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_smoked_dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09f8731b136d41b59ae682c709387bea0cc70735708b5ba225ddd1505e614da0 +size 102114 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_smoked_light.png b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_smoked_light.png new file mode 100644 index 0000000000000000000000000000000000000000..448a8fffd4d512932c656dd5b950d7d067d311ea --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_smoked_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cee2adb7c0d11191f0cce66bf899ae1664838144c9c494ca7ee44a4e9c4bbf1 +size 110287 diff --git a/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_warm_tint.png b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_warm_tint.png new file mode 100644 index 0000000000000000000000000000000000000000..98b325055d2b02152033a408a6742ed2b10ddfbc --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/.thumbs/Mirror.mirror_warm_tint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca6378b934e4eeae69acfe6e1634304219d71ddcb91259fcd34068bda1707ac0 +size 115372 diff --git a/code/third_party/vMaterials_2/Glass/Glass_Clear.mdl b/code/third_party/vMaterials_2/Glass/Glass_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c34d9e73e007d009c91abf3cc6701a372d1c1215 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glass_Clear.mdl @@ -0,0 +1,682 @@ +/****************************************************************************** + * 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 = "Versatile glass material with features such as ceramic frit, coating, dirt and smudges."; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +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 transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization +} + + +// 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)); +} + +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); +} + +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 + )); +} + + +// ------------------------------- Pure Glass ------------------------------- +// 1.1 + +// Glass_V1 + +export material Glass_Clear( +// Appearance + 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") + ]], + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.47f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 0.f), + ::anno::hard_range(0.f, 20.f) + ]], + uniform float abbe_number = 0.f [[ + ::anno::description("Dispersion in relation to index of refraction."), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_m [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 1.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform color transmittance = color(0.68f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + + +// Coating + float coating_reflectivity = 0.0f [[ + ::anno::description("Adjusts the reflectivity of the coating - the amount of light that gets reflected before it transfers through the glass surface."), + ::anno::display_name("Coating Reflectivity"), + ::anno::in_group("Appearance", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + color coating_tint = color(1.f, 1.f, 1.f) [[ + ::anno::display_name("Coating Tint"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("coating_reflectivity > 0.0"), + ::anno::in_group("Appearance", "Coating") + ]], + +// Frit + uniform float frit_weight = 0.f [[ + ::anno::description("Controls the weight of the frit layer."), + ::anno::display_name("Frit Layer Weight"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + color frit_color = color(0.78f) [[ + ::anno::display_name("Frit Color"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit") + ]], + float frit_size = 0.363f [[ + ::anno::description("Controls the size of the frit circles."), + ::anno::display_name("Frit Size"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float frit_roughness = 0.286f [[ + ::anno::description("Controls the roughness of the frit layer."), + ::anno::display_name("Frit Roughness"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 frit_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Frit Scale"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + float reflection_transmission_balance = 0.f [[ + ::anno::description("Makes the frit translucent."), + ::anno::display_name("Frit Translucency"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Dirt + uniform float dirt_layer_weight = 0.f [[ + ::anno::description("Controls the visibility of the dirt layer."), + ::anno::display_name("Dirt Layer Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_brightness = 0.75f [[ + ::anno::description("Sets the brightness of the dirt."), + ::anno::display_name("Dirt Brightness"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_1 = 1.f [[ + ::anno::description("Dirty dried droplets."), + ::anno::display_name("Dirt 1 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_2 = 1.f [[ + ::anno::description("Dirt with the appearance of a dust layer."), + ::anno::display_name("Dirt 2 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_3 = 0.f [[ + ::anno::description("Dirt which shows some driet water flow stains."), + ::anno::display_name("Dirt 3 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_balance = 0.5f [[ + ::anno::description("Controls the balance of the dirt textures. A low value makes the dirt more visible, higher values make it less visible while maintaining its contours."), + ::anno::display_name("Dirt Balance"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 dirt_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Dirt Scale"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// Smudges + uniform float smudges_weight = 0.f [[ + ::anno::description("Controls the visibility of the smudge layer."), + ::anno::display_name("Smudge Layer Weight"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_1_weight = 0.7f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges 1 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_2_weight = 0.3f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Smudges 2 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudge_balance = 0.5f [[ + ::anno::description("Balances the coverage of the smudges. A low value makes them more visible, higher make leave only stronger smudges visible."), + ::anno::display_name("Smudge Balance"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +//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"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Clear.Glass_Clear.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "shiny", "AEC", "transparent", "clear", "smooth", "new", "refractive", "reflective")) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1( + smudges_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] * smudges_1_weight, float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] * smudges_2_weight), ::math::lerp(1.f, 3.f, smudge_balance)) * smudges_weight, ::df::microfacet_ggx_smith_bsdf(0.275000006f, 0.275000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5( + float3(0.f), + 1.f, + normal); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +// ------------------------------- Pure Glass ------------------------------- + + + + +// 1.2 +export material Glass_Clear_Greenish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Greenish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Clear.Glass_Clear_Greenish.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "shiny", "AEC", "transparent", "clear", "smooth", "new", "refractive", "reflective")) +]] = Glass_Clear +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.270498f, 0.679542f, 0.456411f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.f, + dirt_brightness: 0.75f, + dirt_weight_1: 1.f, + dirt_weight_2: 1.f, + dirt_weight_3: 0.f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 1.3 +export material Glass_Clear_Blueish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Blueish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Clear.Glass_Clear_Blueish.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "shiny", "AEC", "transparent", "clear", "smooth", "new", "refractive", "reflective")) +]] = Glass_Clear +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.341914f, 0.577580f, 0.672443f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.f, + dirt_brightness: 0.75f, + dirt_weight_1: 1.f, + dirt_weight_2: 1.f, + dirt_weight_3: 0.f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Glass/Glass_Colored.mdl b/code/third_party/vMaterials_2/Glass/Glass_Colored.mdl new file mode 100644 index 0000000000000000000000000000000000000000..639ff54708501c946a63cf597e2eb3f0624f28b6 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glass_Colored.mdl @@ -0,0 +1,890 @@ +/****************************************************************************** + * 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 = "Versatile glass material with features such as ceramic frit, coating, dirt and smudges."; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +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 transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization +} + + +// 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)); +} + +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); +} + +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 + )); +} + + +// ------------------------------- Colored Glass ------------------------------- +// 2.1 + +// Glass_V1 +export material Glass_Colored( +// Appearance + 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") + ]], + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.47f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 0.f), + ::anno::hard_range(0.f, 20.f) + ]], + uniform float abbe_number = 0.f [[ + ::anno::description("Dispersion in relation to index of refraction."), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 1.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform color transmittance = color(0.002732f, 0.887923f, 0.005605f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + + +// Coating + float coating_reflectivity = 0.0f [[ + ::anno::description("Adjusts the reflectivity of the coating - the amount of light that gets reflected before it transfers through the glass surface."), + ::anno::display_name("Coating Reflectivity"), + ::anno::in_group("Appearance", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + color coating_tint = color(1.f, 1.f, 1.f) [[ + ::anno::display_name("Coating Tint"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("coating_reflectivity > 0.0"), + ::anno::in_group("Appearance", "Coating") + ]], + +// Frit + uniform float frit_weight = 0.f [[ + ::anno::description("Controls the weight of the frit layer."), + ::anno::display_name("Frit Layer Weight"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + color frit_color = color(0.78f) [[ + ::anno::display_name("Frit Color"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit") + ]], + float frit_size = 0.363f [[ + ::anno::description("Controls the size of the frit circles."), + ::anno::display_name("Frit Size"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float frit_roughness = 0.286f [[ + ::anno::description("Controls the roughness of the frit layer."), + ::anno::display_name("Frit Roughness"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 frit_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Frit Scale"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + float reflection_transmission_balance = 0.f [[ + ::anno::description("Makes the frit translucent."), + ::anno::display_name("Frit Translucency"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Dirt + uniform float dirt_layer_weight = 0.f [[ + ::anno::description("Controls the visibility of the dirt layer."), + ::anno::display_name("Dirt Layer Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_brightness = 0.75f [[ + ::anno::description("Sets the brightness of the dirt."), + ::anno::display_name("Dirt Brightness"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_1 = 1.f [[ + ::anno::description("Dirty dried droplets."), + ::anno::display_name("Dirt 1 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_2 = 1.f [[ + ::anno::description("Dirt with the appearance of a dust layer."), + ::anno::display_name("Dirt 2 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_3 = 0.f [[ + ::anno::description("Dirt which shows some driet water flow stains."), + ::anno::display_name("Dirt 3 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_balance = 0.5f [[ + ::anno::description("Controls the balance of the dirt textures. A low value makes the dirt more visible, higher values make it less visible while maintaining its contours."), + ::anno::display_name("Dirt Balance"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 dirt_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Dirt Scale"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// Smudges + uniform float smudges_weight = 0.f [[ + ::anno::description("Controls the visibility of the smudge layer."), + ::anno::display_name("Smudge Layer Weight"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_1_weight = 0.7f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges 1 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_2_weight = 0.3f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Smudges 2 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudge_balance = 0.5f [[ + ::anno::description("Balances the coverage of the smudges. A low value makes them more visible, higher make leave only stronger smudges visible."), + ::anno::display_name("Smudge Balance"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +//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"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Deep Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Colored.Glass_Colored.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "architecture", "colored", "shiny", "AEC", "transparent", "new", "clear", "smooth", "refractive", "reflective", "saturated", "green")) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1( + smudges_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] * smudges_1_weight, float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] * smudges_2_weight), ::math::lerp(1.f, 3.f, smudge_balance)) * smudges_weight, ::df::microfacet_ggx_smith_bsdf(0.275000006f, 0.275000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5( + float3(0.f), + 1.f, + normal); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + + +// 2.2 +export material Glass_Clear_Saturated_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Saturated Orange"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Colored.Glass_Clear_Saturated_Orange.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "architecture", "colored", "shiny", "AEC", "transparent", "new", "clear", "smooth", "refractive", "reflective", "saturated", "orange", "warm")) +]] = Glass_Colored +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.938686f, 0.361307f, 0.003035f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.f, + dirt_brightness: 0.75f, + dirt_weight_1: 1.f, + dirt_weight_2: 1.f, + dirt_weight_3: 0.f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 2.3 +export material Glass_Clear_Saturated_Yellow(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Saturated Yellow"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Colored.Glass_Clear_Saturated_Yellow.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "architecture", "colored", "shiny", "AEC", "transparent", "new", "clear", "smooth", "refractive", "reflective", "saturated", "yellow", "warm")) +]] = Glass_Colored +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.955973f, 0.947307f, 0.003347f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.f, + dirt_brightness: 0.75f, + dirt_weight_1: 1.f, + dirt_weight_2: 1.f, + dirt_weight_3: 0.f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 2.4 +export material Glass_Clear_Saturated_Sea_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Saturated Sea Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Colored.Glass_Clear_Saturated_Sea_Blue.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "architecture", "colored", "shiny", "AEC", "transparent", "new", "clear", "smooth", "refractive", "reflective", "blue", "cool")) +]] = Glass_Colored +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.054480f, 0.887923f, 0.955973f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.f, + dirt_brightness: 0.75f, + dirt_weight_1: 1.f, + dirt_weight_2: 1.f, + dirt_weight_3: 0.f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + +// 2.5 +export material Glass_Clear_Saturated_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Saturated Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Colored.Glass_Clear_Saturated_Blue.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "architecture", "colored", "shiny", "AEC", "transparent", "new", "clear", "smooth", "refractive", "reflective", "saturated", "blue", "cool")) +]] = Glass_Colored +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.001518f, 0.001518f, 0.947307f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.f, + dirt_brightness: 0.75f, + dirt_weight_1: 1.f, + dirt_weight_2: 1.f, + dirt_weight_3: 0.f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 2.6 +export material Glass_Clear_Saturated_Purple(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Saturated Purple"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Colored.Glass_Clear_Saturated_Purple.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "architecture", "colored", "shiny", "AEC", "transparent", "new", "clear", "smooth", "refractive", "reflective", "saturated", "purple")) +]] = Glass_Colored +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.737910f, 0.000607f, 0.938686f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.f, + dirt_brightness: 0.75f, + dirt_weight_1: 1.f, + dirt_weight_2: 1.f, + dirt_weight_3: 0.f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 2.7 +export material Glass_Clear_Saturated_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Saturated Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Colored.Glass_Clear_Saturated_Red.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "architecture", "colored", "shiny", "AEC", "transparent", "new", "clear", "smooth", "refractive", "reflective", "saturated", "red")) +]] = Glass_Colored +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.871367f, 0.002125f, 0.002428f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.f, + dirt_brightness: 0.75f, + dirt_weight_1: 1.f, + dirt_weight_2: 1.f, + dirt_weight_3: 0.f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Glass/Glass_Dirty.mdl b/code/third_party/vMaterials_2/Glass/Glass_Dirty.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fd5ca5745a36fba8382de5e65f4d5f4051f093e6 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glass_Dirty.mdl @@ -0,0 +1,837 @@ +/****************************************************************************** + * 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 = "Versatile glass material with features such as ceramic frit, coating, dirt and smudges."; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +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 transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization +} + + +// 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)); +} + +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); +} + +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 + )); +} + + + +// ------------------------------- 3. Dirty Glass ------------------------------- +// 3.1 + +// Glass_V1 +export material Glass_Dirty( +// Appearance + 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") + ]], + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.47f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 0.f), + ::anno::hard_range(0.f, 20.f) + ]], + uniform float abbe_number = 0.f [[ + ::anno::description("Dispersion in relation to index of refraction."), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_m [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 1.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform color transmittance = color(0.274677f, 0.651406f, 0.545724f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + + +// Coating + float coating_reflectivity = 0.0f [[ + ::anno::description("Adjusts the reflectivity of the coating - the amount of light that gets reflected before it transfers through the glass surface."), + ::anno::display_name("Coating Reflectivity"), + ::anno::in_group("Appearance", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + color coating_tint = color(1.f, 1.f, 1.f) [[ + ::anno::display_name("Coating Tint"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("coating_reflectivity > 0.0"), + ::anno::in_group("Appearance", "Coating") + ]], + +// Frit + uniform float frit_weight = 0.f [[ + ::anno::description("Controls the weight of the frit layer."), + ::anno::display_name("Frit Layer Weight"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + color frit_color = color(0.78f) [[ + ::anno::display_name("Frit Color"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit") + ]], + float frit_size = 0.363f [[ + ::anno::description("Controls the size of the frit circles."), + ::anno::display_name("Frit Size"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float frit_roughness = 0.286f [[ + ::anno::description("Controls the roughness of the frit layer."), + ::anno::display_name("Frit Roughness"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 frit_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Frit Scale"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + float reflection_transmission_balance = 0.f [[ + ::anno::description("Makes the frit translucent."), + ::anno::display_name("Frit Translucency"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Dirt + uniform float dirt_layer_weight = 0.641f [[ + ::anno::description("Controls the visibility of the dirt layer."), + ::anno::display_name("Dirt Layer Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_brightness = 0.75f [[ + ::anno::description("Sets the brightness of the dirt."), + ::anno::display_name("Dirt Brightness"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_1 = 0.9f [[ + ::anno::description("Dirty dried droplets."), + ::anno::display_name("Dirt 1 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_2 = 0.3f [[ + ::anno::description("Dirt with the appearance of a dust layer."), + ::anno::display_name("Dirt 2 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_3 = 0.f [[ + ::anno::description("Dirt which shows some driet water flow stains."), + ::anno::display_name("Dirt 3 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_balance = 0.374f [[ + ::anno::description("Controls the balance of the dirt textures. A low value makes the dirt more visible, higher values make it less visible while maintaining its contours."), + ::anno::display_name("Dirt Balance"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 dirt_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Dirt Scale"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// Smudges + uniform float smudges_weight = 0.f [[ + ::anno::description("Controls the visibility of the smudge layer."), + ::anno::display_name("Smudge Layer Weight"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_1_weight = 0.7f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges 1 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_2_weight = 0.3f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Smudges 2 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudge_balance = 0.5f [[ + ::anno::description("Balances the coverage of the smudges. A low value makes them more visible, higher make leave only stronger smudges visible."), + ::anno::display_name("Smudge Balance"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +//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"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Heavy Drop Stains"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Dirty.Glass_Dirty.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "outdoor", "design", "shiny", "AEC", "transparent", "smooth", "dirty", "worn", "refractive", "reflective")) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1( + smudges_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] * smudges_1_weight, float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] * smudges_2_weight), ::math::lerp(1.f, 3.f, smudge_balance)) * smudges_weight, ::df::microfacet_ggx_smith_bsdf(0.275000006f, 0.275000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5( + float3(0.f), + 1.f, + normal); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +// 3.2 +export material Glass_Clear_Heavy_Dirt_Dust(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Heavy Dirt and Dust"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Dirty.Glass_Clear_Heavy_Dirt_Dust.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "outdoor", "design", "shiny", "AEC", "transparent", "smooth", "dirty", "worn", "refractive", "reflective")) +]] = Glass_Dirty +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.234551f, 0.558340f, 0.467784f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.641f, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 3.3 +export material Glass_Clear_Heavy_Mixed_Dirt(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Heavy Mixed Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Dirty.Glass_Clear_Heavy_Mixed_Dirt.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "outdoor", "design", "shiny", "AEC", "transparent", "smooth", "dirty", "worn", "refractive", "reflective")) +]] = Glass_Dirty +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.168269f, 0.396755f, 0.332452f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.894f, + dirt_brightness: 0.75f, + dirt_weight_1: 0.631f, + dirt_weight_2: 0.733f, + dirt_weight_3: 1.0f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 3.4 +export material Glass_Clear_Light_Drop_Stains(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Light Drop Stains"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Dirty.Glass_Clear_Light_Drop_Stains.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "outdoor", "design", "shiny", "AEC", "transparent", "smooth", "dirty", "worn", "refractive", "reflective")) +]] = Glass_Dirty +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.194618f, 0.456411f, 0.386429f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.282f, + dirt_brightness: 0.75f, + dirt_weight_1: 0.893f, + dirt_weight_2: 0.301f, + dirt_weight_3: 0.0f, + dirt_balance: 0.806, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 3.5 +export material Glass_Clear_Light_Dusty_Dirt(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Light Dusty Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Dirty.Glass_Clear_Light_Dusty_Dirt.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "outdoor", "design", "shiny", "AEC", "transparent", "smooth", "dirty", "worn", "refractive", "reflective")) +]] = Glass_Dirty +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.171441f, 0.401978f, 0.337164f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.311f, + dirt_brightness: 0.75f, + dirt_weight_1: 0.0f, + dirt_weight_2: 1.0f, + dirt_weight_3: 0.0f, + dirt_balance: 0.7f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 3.6 +export material Glass_Clear_Light_Mixed_Dirt(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Light Mixed Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Dirty.Glass_Clear_Light_Mixed_Dirt.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "outdoor", "design", "shiny", "AEC", "transparent", "smooth", "dirty", "worn", "refractive", "reflective")) +]] = Glass_Dirty +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.191202f, 0.445201f, 0.376262f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.32f, + dirt_brightness: 0.75f, + dirt_weight_1: 0.631f, + dirt_weight_2: 0.733f, + dirt_weight_3: 1.0f, + dirt_balance: 0.5f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.3f, + smudge_balance: 0.5f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Glass/Glass_Fritted.mdl b/code/third_party/vMaterials_2/Glass/Glass_Fritted.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6462cafbc7da62b5ceccb5cbc68992c197c4edff --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glass_Fritted.mdl @@ -0,0 +1,677 @@ +/****************************************************************************** + * 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 = "Versatile glass material with features such as ceramic frit, coating, dirt and smudges."; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +export struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +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 transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization +} + + +// 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)); +} + +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); +} + +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 + )); +} + + + +// ------------------------------- 5. Fritted Glass ------------------------------- + +// 5.1 + +export material Glass_Fritted( +// Appearance + 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") + ]], + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.47f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 0.f), + ::anno::hard_range(0.f, 20.f) + ]], + uniform float abbe_number = 0.f [[ + ::anno::description("Dispersion in relation to index of refraction."), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_m [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 1.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform color transmittance = color(0.304987f, 0.723055f, 0.603827f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + + +// Coating + float coating_reflectivity = 0.0f [[ + ::anno::description("Adjusts the reflectivity of the coating - the amount of light that gets reflected before it transfers through the glass surface."), + ::anno::display_name("Coating Reflectivity"), + ::anno::in_group("Appearance", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + color coating_tint = color(1.f, 1.f, 1.f) [[ + ::anno::display_name("Coating Tint"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("coating_reflectivity > 0.0"), + ::anno::in_group("Appearance", "Coating") + ]], + +// Frit + uniform float frit_weight = 1.0f [[ + ::anno::description("Controls the weight of the frit layer."), + ::anno::display_name("Frit Layer Weight"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + color frit_color = color(0.5f) [[ + ::anno::display_name("Frit Color"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit") + ]], + float frit_size = 0.3f [[ + ::anno::description("Controls the size of the frit circles."), + ::anno::display_name("Frit Size"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float frit_roughness = 0.286f [[ + ::anno::description("Controls the roughness of the frit layer."), + ::anno::display_name("Frit Roughness"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 frit_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Frit Scale"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + float reflection_transmission_balance = 0.f [[ + ::anno::description("Makes the frit translucent."), + ::anno::display_name("Frit Translucency"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Dirt + uniform float dirt_layer_weight = 0.0f [[ + ::anno::description("Controls the visibility of the dirt layer."), + ::anno::display_name("Dirt Layer Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_brightness = 0.75f [[ + ::anno::description("Sets the brightness of the dirt."), + ::anno::display_name("Dirt Brightness"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_1 = 0.9f [[ + ::anno::description("Dirty dried droplets."), + ::anno::display_name("Dirt 1 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_2 = 0.3f [[ + ::anno::description("Dirt with the appearance of a dust layer."), + ::anno::display_name("Dirt 2 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_3 = 0.f [[ + ::anno::description("Dirt which shows some driet water flow stains."), + ::anno::display_name("Dirt 3 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_balance = 0.374f [[ + ::anno::description("Controls the balance of the dirt textures. A low value makes the dirt more visible, higher values make it less visible while maintaining its contours."), + ::anno::display_name("Dirt Balance"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 dirt_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Dirt Scale"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// Smudges + uniform float smudges_weight = 0.0f [[ + ::anno::description("Controls the visibility of the smudge layer."), + ::anno::display_name("Smudge Layer Weight"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_1_weight = 0.95f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges 1 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_2_weight = 0.3f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Smudges 2 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudge_balance = 0.2f [[ + ::anno::description("Balances the coverage of the smudges. A low value makes them more visible, higher make leave only stronger smudges visible."), + ::anno::display_name("Smudge Balance"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +//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"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Small Frit"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Fritted.Glass_Fritted.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "shiny", "AEC", "fritted", "transparent", "clear", "smooth", "refractive", "reflective")) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1( + smudges_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] * smudges_1_weight, float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] * smudges_2_weight), ::math::lerp(1.f, 3.f, smudge_balance)) * smudges_weight, ::df::microfacet_ggx_smith_bsdf(0.275000006f, 0.275000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5( + float3(0.f), + 1.f, + normal); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +// 5.2 +export material Glass_Clear_Medium_Frit(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Medium Frit"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Fritted.Glass_Clear_Medium_Frit.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "shiny", "AEC", "fritted", "transparent", "clear", "smooth", "refractive", "reflective")) +]] = Glass_Fritted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: .25f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 1.f, + frit_color: color(.5f), + frit_size: 0.45f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 5.3 +export material Glass_Clear_Large_Frit(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Large Frit"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Fritted.Glass_Clear_Large_Frit.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "indoor", "outdoor", "design", "shiny", "AEC", "fritted", "transparent", "clear", "smooth", "refractive", "reflective")) +]] = Glass_Fritted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 0.25f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 1.f, + frit_color: color(.5f), + frit_size: 0.6f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Glass/Glass_Glazing_Spandrel.mdl b/code/third_party/vMaterials_2/Glass/Glass_Glazing_Spandrel.mdl new file mode 100644 index 0000000000000000000000000000000000000000..52207273681c0add8809d50b3bd526ab0f9b7900 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glass_Glazing_Spandrel.mdl @@ -0,0 +1,895 @@ +/****************************************************************************** + * 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 = "Versatile glass material with features such as ceramic frit, coating, dirt and smudges."; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +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 transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization +} + + +// 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)); +} + +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); +} + +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 + )); +} + + + +// ------------------------------- 8. Glazing Spandrel ------------------------------- + +// 8.1 + +// Glass_V1 + +export material Glass_Glazing_Spandrel( +// Appearance + 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") + ]], + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.48f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 0.f), + ::anno::hard_range(0.f, 20.f) + ]], + uniform float abbe_number = 0.0f [[ + ::anno::description("Dispersion in relation to index of refraction."), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_m [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 1.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform color transmittance = color(0.388910f, 0.932277f, 0.781751f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + + +// Coating + float coating_reflectivity = 0.0f [[ + ::anno::description("Adjusts the reflectivity of the coating - the amount of light that gets reflected before it transfers through the glass surface."), + ::anno::display_name("Coating Reflectivity"), + ::anno::in_group("Appearance", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + color coating_tint = color(1.f, 1.f, 1.f) [[ + ::anno::display_name("Coating Tint"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("coating_reflectivity > 0.0"), + ::anno::in_group("Appearance", "Coating") + ]], + +// Frit + uniform float frit_weight = 1.0f [[ + ::anno::description("Controls the weight of the frit layer."), + ::anno::display_name("Frit Layer Weight"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + color frit_color = color(0.339223f, 0.348865f, 0.234895f) [[ + ::anno::display_name("Frit Color"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit") + ]], + float frit_size = 1.0f [[ + ::anno::description("Controls the size of the frit circles."), + ::anno::display_name("Frit Size"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float frit_roughness = 0.0f [[ + ::anno::description("Controls the roughness of the frit layer."), + ::anno::display_name("Frit Roughness"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 frit_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Frit Scale"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + float reflection_transmission_balance = 0.194f [[ + ::anno::description("Makes the frit translucent."), + ::anno::display_name("Frit Translucency"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Dirt + uniform float dirt_layer_weight = 0.0f [[ + ::anno::description("Controls the visibility of the dirt layer."), + ::anno::display_name("Dirt Layer Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_brightness = 0.75f [[ + ::anno::description("Sets the brightness of the dirt."), + ::anno::display_name("Dirt Brightness"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_1 = 0.9f [[ + ::anno::description("Dirty dried droplets."), + ::anno::display_name("Dirt 1 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_2 = 0.3f [[ + ::anno::description("Dirt with the appearance of a dust layer."), + ::anno::display_name("Dirt 2 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_3 = 0.f [[ + ::anno::description("Dirt which shows some driet water flow stains."), + ::anno::display_name("Dirt 3 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_balance = 0.374f [[ + ::anno::description("Controls the balance of the dirt textures. A low value makes the dirt more visible, higher values make it less visible while maintaining its contours."), + ::anno::display_name("Dirt Balance"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 dirt_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Dirt Scale"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// Smudges + uniform float smudges_weight = 0.0f [[ + ::anno::description("Controls the visibility of the smudge layer."), + ::anno::display_name("Smudge Layer Weight"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_1_weight = 0.95f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges 1 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_2_weight = 0.3f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Smudges 2 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudge_balance = 0.2f [[ + ::anno::description("Balances the coverage of the smudges. A low value makes them more visible, higher make leave only stronger smudges visible."), + ::anno::display_name("Smudge Balance"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +//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"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Spandrel - Warm Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "spandrel", "construction", "outdoor", "indoor", "shiny", "AEC", "smooth", "reflective", "gray", "neutral")) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1( + smudges_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] * smudges_1_weight, float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] * smudges_2_weight), ::math::lerp(1.f, 3.f, smudge_balance)) * smudges_weight, ::df::microfacet_ggx_smith_bsdf(0.275000006f, 0.275000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5( + float3(0.f), + 1.f, + normal); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +// ------------------------------- 8. Glazing Spandrel ------------------------------- + +// 8.2 +export material Glass_Glazing_Spandrel_Evergreen(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Spandrel - Evergreen"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Evergreen.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "spandrel", "construction", "outdoor", "indoor", "shiny", "AEC", "smooth", "reflective", "green")) +]] = Glass_Glazing_Spandrel +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 1.f, + frit_color: color(0.044553f, 0.124741f, 0.089194f), + frit_size: 1.0f, + frit_roughness: 0.0f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.194f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 8.3 +export material Glass_Glazing_Spandrel_Dark_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Spandrel - Dark Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Gray.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "spandrel", "construction", "outdoor", "indoor", "shiny", "AEC", "smooth", "reflective", "gray", "dark")) +]] = Glass_Glazing_Spandrel +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 1.f, + frit_color: color(0.067725f, 0.063815f, 0.056374f), + frit_size: 1.0f, + frit_roughness: 0.0f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.194f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 8.4 +export material Glass_Glazing_Spandrel_Bronze(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Spandrel - Bronze"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Bronze.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "spandrel", "construction", "outdoor", "indoor", "shiny", "AEC", "smooth", "reflective", "bronze")) +]] = Glass_Glazing_Spandrel +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 1.f, + frit_color: color(0.101145f, 0.067725f, 0.042987f), + frit_size: 1.0f, + frit_roughness: 0.0f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.194f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + + +// 8.5 +export material Glass_Glazing_Spandrel_Dark_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Spandrel - Dark Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Blue.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "spandrel", "construction", "outdoor", "indoor", "shiny", "AEC", "smooth", "reflective", "blue", "cool", "dark")) +]] = Glass_Glazing_Spandrel +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 1.f, + frit_color: color(0.016988f, 0.049433f, 0.101145f), + frit_size: 1.0f, + frit_roughness: 0.0f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.194f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 8.6 +export material Glass_Glazing_Spandrel_White(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Spandrel - White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_White.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "spandrel", "construction", "outdoor", "indoor", "shiny", "AEC", "smooth", "reflective", "white", "light", "neutral")) +]] = Glass_Glazing_Spandrel +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 1.f, + frit_color: color(0.612066f), + frit_size: 1.0f, + frit_roughness: 0.0f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.194f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 8.8 +export material Glass_Glazing_Spandrel_Cool_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Spandrel - Cool Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Cool_Gray.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "spandrel", "construction", "outdoor", "indoor", "shiny", "AEC", "smooth", "reflective", "gray", "cool")) +]] = Glass_Glazing_Spandrel +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 1.f, + frit_color: color(0.612066f), + frit_size: 1.0f, + frit_roughness: 0.0f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.194f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Glass/Glass_Glazing_Tinted.mdl b/code/third_party/vMaterials_2/Glass/Glass_Glazing_Tinted.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6cb22ce8333f8792d6610a83e21d8925ba2188bf --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glass_Glazing_Tinted.mdl @@ -0,0 +1,1319 @@ +/****************************************************************************** + * 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 = "Versatile glass material with features such as ceramic frit, coating, dirt and smudges."; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +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 transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization +} + + +// 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)); +} + +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); +} + +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 + )); +} + + + +// ------------------------------- 5. Fritted Glass ------------------------------- + +// 5.1 + +// Glass_V1 + +export material Glass_Glazing_Tinted( +// Appearance + 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") + ]], + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.48f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 0.f), + ::anno::hard_range(0.f, 20.f) + ]], + uniform float abbe_number = 0.0f [[ + ::anno::description("Dispersion in relation to index of refraction."), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 1.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform color transmittance = color(0.517401f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + + +// Coating + float coating_reflectivity = 0.0f [[ + ::anno::description("Adjusts the reflectivity of the coating - the amount of light that gets reflected before it transfers through the glass surface."), + ::anno::display_name("Coating Reflectivity"), + ::anno::in_group("Appearance", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + color coating_tint = color(1.f, 1.f, 1.f) [[ + ::anno::display_name("Coating Tint"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("coating_reflectivity > 0.0"), + ::anno::in_group("Appearance", "Coating") + ]], + +// Frit + uniform float frit_weight = 0.0f [[ + ::anno::description("Controls the weight of the frit layer."), + ::anno::display_name("Frit Layer Weight"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + color frit_color = color(0.5f) [[ + ::anno::display_name("Frit Color"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit") + ]], + float frit_size = 0.4f [[ + ::anno::description("Controls the size of the frit circles."), + ::anno::display_name("Frit Size"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float frit_roughness = 0.286f [[ + ::anno::description("Controls the roughness of the frit layer."), + ::anno::display_name("Frit Roughness"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 frit_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Frit Scale"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + float reflection_transmission_balance = 0.f [[ + ::anno::description("Makes the frit translucent."), + ::anno::display_name("Frit Translucency"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Dirt + uniform float dirt_layer_weight = 0.0f [[ + ::anno::description("Controls the visibility of the dirt layer."), + ::anno::display_name("Dirt Layer Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_brightness = 0.75f [[ + ::anno::description("Sets the brightness of the dirt."), + ::anno::display_name("Dirt Brightness"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_1 = 0.9f [[ + ::anno::description("Dirty dried droplets."), + ::anno::display_name("Dirt 1 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_2 = 0.3f [[ + ::anno::description("Dirt with the appearance of a dust layer."), + ::anno::display_name("Dirt 2 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_3 = 0.f [[ + ::anno::description("Dirt which shows some driet water flow stains."), + ::anno::display_name("Dirt 3 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_balance = 0.374f [[ + ::anno::description("Controls the balance of the dirt textures. A low value makes the dirt more visible, higher values make it less visible while maintaining its contours."), + ::anno::display_name("Dirt Balance"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 dirt_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Dirt Scale"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// Smudges + uniform float smudges_weight = 0.0f [[ + ::anno::description("Controls the visibility of the smudge layer."), + ::anno::display_name("Smudge Layer Weight"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_1_weight = 0.95f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges 1 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_2_weight = 0.3f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Smudges 2 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudge_balance = 0.2f [[ + ::anno::description("Balances the coverage of the smudges. A low value makes them more visible, higher make leave only stronger smudges visible."), + ::anno::display_name("Smudge Balance"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +//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"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Light Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "light", "gray", "neutral")) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1( + smudges_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] * smudges_1_weight, float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] * smudges_2_weight), ::math::lerp(1.f, 3.f, smudge_balance)) * smudges_weight, ::df::microfacet_ggx_smith_bsdf(0.275000006f, 0.275000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5( + float3(0.f), + 1.f, + normal); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +// ------------------------------- 7. Glazing Tinted ------------------------------- + +// 7.2 +export material Glass_Glazing_Tinted_Medium_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Medium Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Medium_Gray.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "gray", "neutral")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.259027f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.3 +export material Glass_Glazing_Tinted_Dark_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Dark Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Gray.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "dark", "gray", "neutral")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.132868f, 0.132868f, 0.132868f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.4 +export material Glass_Glazing_Tinted_Cool_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Cool Gray"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Cool_Gray.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "gray", "cool")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.201096f, 0.275833f, 0.353741f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.5 +export material Glass_Glazing_Tinted_Blue_Sky(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Blue Sky"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Blue_Sky.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "sky", "blue", "cool")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.133209f, 0.297653f, 0.481952f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.6 +export material Glass_Glazing_Tinted_Smoked_Sky(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Smoked Sky"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Smoked_Sky.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "sky", "blue", "cool")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.063815f, 0.136099f, 0.219520f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.7 +export material Glass_Glazing_Tinted_Dark_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Dark Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Blue.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "blue", "cool", "dark")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.027755f, 0.124741f, 0.271577f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.8 +export material Glass_Glazing_Tinted_Petrol(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Petrol"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Petrol.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "petrol", "blue", "cool")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.170138f, 0.306635f, 0.315763f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.9 +export material Glass_Glazing_Tinted_Teal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Teal"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Teal.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "teal", "blue", "cool")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.071761f, 0.339223f, 0.267358f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.10 +export material Glass_Glazing_Tinted_Evergreen(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Evergreen"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Evergreen.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "green")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.086901f, 0.186989f, 0.124741f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + + +// 7.11 +export material Glass_Glazing_Tinted_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Green.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "green")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.173439f, 0.404541f, 0.259027f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.12 +export material Glass_Glazing_Tinted_Soft_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Soft Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Soft_Green.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "green")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.325037f, 0.645555f, 0.447871f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.13 +export material Glass_Glazing_Tinted_Light_Bronze(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Light Bronze"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Light_Bronze.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "bronze", "light")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.579547f, 0.453456f, 0.325037f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.14 +export material Glass_Glazing_Tinted_Bronze(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Bronze"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Bronze.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "bronze")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.325037f, 0.242796f, 0.180144f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 7.15 +export material Glass_Glazing_Tinted_Dark_Bronze(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Glazing Tinted - Dark Bronze"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Bronze.png"), + ::anno::key_words(string[]("glass", "layered", "glazing", "facade", "tinted", "construction", "outdoor", "indoor", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "bronze", "dark")) +]] = Glass_Glazing_Tinted +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48f, + abbe_number: 0.0f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(0.163641f, 0.121986f, 0.089194f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Glass/Glass_Optical.mdl b/code/third_party/vMaterials_2/Glass/Glass_Optical.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4a3f4bc5771c037ea0288292892cf1ff7fb78b9a --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glass_Optical.mdl @@ -0,0 +1,1587 @@ +/****************************************************************************** + * 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 = "Versatile glass material with features such as ceramic frit, coating, dirt and smudges."; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]]{ + color absorption_coefficient; + color scattering_coefficient; +}; + + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +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 transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization +} + + +// 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)); +} + +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); +} + +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 + )); +} + + + + +// 5.1 + +// Glass_V1 + +export material Glass_Optical( +// Appearance + 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") + ]], + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.55447f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 0.f), + ::anno::hard_range(0.f, 20.f) + ]], + uniform float abbe_number = 63.23f [[ + ::anno::description("Dispersion in relation to index of refraction."), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 1.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform color transmittance = color(1.0f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + + +// Coating + float coating_reflectivity = 0.0f [[ + ::anno::description("Adjusts the reflectivity of the coating - the amount of light that gets reflected before it transfers through the glass surface."), + ::anno::display_name("Coating Reflectivity"), + ::anno::in_group("Appearance", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + color coating_tint = color(1.f, 1.f, 1.f) [[ + ::anno::display_name("Coating Tint"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("coating_reflectivity > 0.0"), + ::anno::in_group("Appearance", "Coating") + ]], + +// Frit + uniform float frit_weight = 0.0f [[ + ::anno::description("Controls the weight of the frit layer."), + ::anno::display_name("Frit Layer Weight"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + color frit_color = color(0.5f) [[ + ::anno::display_name("Frit Color"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit") + ]], + float frit_size = 0.4f [[ + ::anno::description("Controls the size of the frit circles."), + ::anno::display_name("Frit Size"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float frit_roughness = 0.286f [[ + ::anno::description("Controls the roughness of the frit layer."), + ::anno::display_name("Frit Roughness"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 frit_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Frit Scale"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + float reflection_transmission_balance = 0.f [[ + ::anno::description("Makes the frit translucent."), + ::anno::display_name("Frit Translucency"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Dirt + uniform float dirt_layer_weight = 0.0f [[ + ::anno::description("Controls the visibility of the dirt layer."), + ::anno::display_name("Dirt Layer Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_brightness = 0.75f [[ + ::anno::description("Sets the brightness of the dirt."), + ::anno::display_name("Dirt Brightness"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_1 = 0.9f [[ + ::anno::description("Dirty dried droplets."), + ::anno::display_name("Dirt 1 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_2 = 0.3f [[ + ::anno::description("Dirt with the appearance of a dust layer."), + ::anno::display_name("Dirt 2 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_3 = 0.f [[ + ::anno::description("Dirt which shows some driet water flow stains."), + ::anno::display_name("Dirt 3 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_balance = 0.374f [[ + ::anno::description("Controls the balance of the dirt textures. A low value makes the dirt more visible, higher values make it less visible while maintaining its contours."), + ::anno::display_name("Dirt Balance"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 dirt_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Dirt Scale"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// Smudges + uniform float smudges_weight = 0.0f [[ + ::anno::description("Controls the visibility of the smudge layer."), + ::anno::display_name("Smudge Layer Weight"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_1_weight = 0.95f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges 1 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_2_weight = 0.3f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Smudges 2 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudge_balance = 0.2f [[ + ::anno::description("Balances the coverage of the smudges. A low value makes them more visible, higher make leave only stronger smudges visible."), + ::anno::display_name("Smudge Balance"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +//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"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Master Material"), + ::anno::description("Master template material. This material should be hidden. " + "If you see this material, the integration is not hiding it correctly."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical.png"), + ::anno::key_words(string[]("glass", "master", "layered", "optics", "optical", "PSK", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")), + ::anno::hidden() +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1( + smudges_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] * smudges_1_weight, float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] * smudges_2_weight), ::math::lerp(1.f, 3.f, smudge_balance)) * smudges_weight, ::df::microfacet_ggx_smith_bsdf(0.275000006f, 0.275000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5( + float3(0.f), + 1.f, + normal); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +// ------------------------------- 6. Optical Glass ------------------------------- +// All Optical glasses are completely transparent but have appropriate settings for +// their IOR and abbe numbers + +// 6.1 +export material Glass_Optical_PSK(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Phosphate Dense Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_PSK.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")), + ::anno::hidden() +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.5544f, + abbe_number: 63.23f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.2 +export material Glass_Optical_FK(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Flourine Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_FK.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.48914f, + abbe_number: 70.23f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.3 +export material Glass_Optical_PK(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Phosphate Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_PK.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.53019, + abbe_number: 76.58f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.4 +export material Glass_Optical_BK(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Boron Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_BK.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.51872f, + abbe_number: 63.96f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.5 +export material Glass_Optical_LAK(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Lanthanum Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_LAK.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.65425, + abbe_number: 58.26f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.6 +export material Glass_Optical_SK(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Dense Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_SK.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.59142, + abbe_number: 61.02f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.7 +export material Glass_Optical_SSK(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Extra Dense Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_SSK.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.62508, + abbe_number: 52.99f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.8 +export material Glass_Optical_BAK(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Barium Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_BAK.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.57125f, + abbe_number: 55.7f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + + +// 6.9 +export material Glass_Optical_BALF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Barium Light Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_BALF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.58212, + abbe_number: 53.59f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.10 +export material Glass_Optical_K(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Crown"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_K.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.52458f, + abbe_number: 59.22f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.11 +export material Glass_Optical_KF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Crown Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_KF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "crown", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.52588f, + abbe_number: 51.26f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.12 +export material Glass_Optical_LASF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Lanthanum Dense Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_LASF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.83935, + abbe_number: 37.04f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.13 +export material Glass_Optical_SF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Dense Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_SF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.76164, + abbe_number: 27.16f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.14 +export material Glass_Optical_LAF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Lanthanum Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_LAF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.75459f, + abbe_number: 34.56f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.15 +export material Glass_Optical_BAF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Barium Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_BAF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.60897f, + abbe_number: 43.43f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.16 +export material Glass_Optical_BASF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Barium Heavy Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_BASF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.66883f, + abbe_number: 35.73f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.17 +export material Glass_Optical_F(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_F.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.60718f, + abbe_number: 37.77f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.18 +export material Glass_Optical_LF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Light Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_LF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.58144f, + abbe_number: 40.57f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 6.19 +export material Glass_Optical_LLF(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Extra Light Flint"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Optical.Glass_Optical_LLF.png"), + ::anno::key_words(string[]("glass", "layered", "optics", "optical", "abbe", "measured", "lens", "shiny", "AEC", "transparent", "clear", "smooth", "refractive", "reflective", "flint")) +]] = Glass_Optical +( + infinite_tiling: false, + thin_walled: false, + ior: 1.55099f, + abbe_number: 45.47f, + roughness: 0.f, + units_absorption_thickness: unit_cm , + absorption_thickness: 1.f, + transmittance: color(1.0f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(.5f), + frit_size: 0.3f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.0f, + smudges_1_weight: 0.95f, + smudges_2_weight: 0.4f, + smudge_balance: 0.2f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Glass/Glass_Smudged.mdl b/code/third_party/vMaterials_2/Glass/Glass_Smudged.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f51a6b09cef30841de400d84dbe3e17fca19c87c --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glass_Smudged.mdl @@ -0,0 +1,679 @@ +/****************************************************************************** + * 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 = "Versatile glass material with features such as ceramic frit, coating, dirt and smudges."; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +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 transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization +} + + +// 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)); +} + +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); +} + +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 + )); +} + + + +// ------------------------------- 4. Smudged Glass ------------------------------- +// 4.1 + +// Glass_V1 + +export material Glass_Smudged( +// Appearance + 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") + ]], + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.47f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 0.f), + ::anno::hard_range(0.f, 20.f) + ]], + uniform float abbe_number = 0.f [[ + ::anno::description("Dispersion in relation to index of refraction."), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_m [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 1.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::enable_if("thin_walled == false"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform color transmittance = color(0.388910f, 0.932277f, 0.781751f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + + +// Coating + float coating_reflectivity = 0.0f [[ + ::anno::description("Adjusts the reflectivity of the coating - the amount of light that gets reflected before it transfers through the glass surface."), + ::anno::display_name("Coating Reflectivity"), + ::anno::in_group("Appearance", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + color coating_tint = color(1.f, 1.f, 1.f) [[ + ::anno::display_name("Coating Tint"), + ::anno::description("Adds a color to the coating layer."), + ::anno::enable_if("coating_reflectivity > 0.0"), + ::anno::in_group("Appearance", "Coating") + ]], + +// Frit + uniform float frit_weight = 0.f [[ + ::anno::description("Controls the weight of the frit layer."), + ::anno::display_name("Frit Layer Weight"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + color frit_color = color(0.78f) [[ + ::anno::display_name("Frit Color"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit") + ]], + float frit_size = 0.363f [[ + ::anno::description("Controls the size of the frit circles."), + ::anno::display_name("Frit Size"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float frit_roughness = 0.286f [[ + ::anno::description("Controls the roughness of the frit layer."), + ::anno::display_name("Frit Roughness"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 frit_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Frit Scale"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + float reflection_transmission_balance = 0.f [[ + ::anno::description("Makes the frit translucent."), + ::anno::display_name("Frit Translucency"), + ::anno::enable_if("frit_weight > 0.0"), + ::anno::in_group("Appearance", "Frit"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Dirt + uniform float dirt_layer_weight = 0.0f [[ + ::anno::description("Controls the visibility of the dirt layer."), + ::anno::display_name("Dirt Layer Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_brightness = 0.75f [[ + ::anno::description("Sets the brightness of the dirt."), + ::anno::display_name("Dirt Brightness"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_1 = 0.9f [[ + ::anno::description("Dirty dried droplets."), + ::anno::display_name("Dirt 1 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_2 = 0.3f [[ + ::anno::description("Dirt with the appearance of a dust layer."), + ::anno::display_name("Dirt 2 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_weight_3 = 0.f [[ + ::anno::description("Dirt which shows some driet water flow stains."), + ::anno::display_name("Dirt 3 Amount"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_balance = 0.374f [[ + ::anno::description("Controls the balance of the dirt textures. A low value makes the dirt more visible, higher values make it less visible while maintaining its contours."), + ::anno::display_name("Dirt Balance"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 dirt_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Dirt Scale"), + ::anno::enable_if("dirt_layer_weight > 0.0"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// Smudges + uniform float smudges_weight = 0.141f [[ + ::anno::description("Controls the visibility of the smudge layer."), + ::anno::display_name("Smudge Layer Weight"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_1_weight = 0.95f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges 1 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges_2_weight = 0.3f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Smudges 2 Weight"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudge_balance = 0.2f [[ + ::anno::description("Balances the coverage of the smudges. A low value makes them more visible, higher make leave only stronger smudges visible."), + ::anno::display_name("Smudge Balance"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::enable_if("smudges_weight > 0.0"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +//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"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Light Smudges"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Smudged.Glass_Smudged.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "design", "shiny", "AEC", "transparent", "clear", "smooth", "smudged", "dirty", "refractive", "reflective")) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1( + smudges_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] * smudges_1_weight, float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.0590000004f, 0.050999999f, 0.125f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_smudges_clouds_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] * smudges_2_weight), ::math::lerp(1.f, 3.f, smudge_balance)) * smudges_weight, ::df::microfacet_ggx_smith_bsdf(0.275000006f, 0.275000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : dirt_layer_weight > 0.f ? ::df::weighted_layer(::math::pow(::math::max(::math::max(dirt_weight_1 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_weight_2 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), dirt_weight_3 * float3(infinite_tiling ? endless_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0370000005f, 0.0759999976f, 0.0189999994f), 8.f, false) : ::base::file_texture(texture_2d("./textures/glass_dirt_multi_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, dirt_scale * texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::lerp(1.f, 4.f, dirt_balance)) * dirt_layer_weight, ::df::weighted_layer(0.603000045f, ::df::diffuse_transmission_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(color(0.00309600006f, 0.00284500001f, 0.00266300002f), color(0.522521973f, 0.43264699f, 0.373656988f), ::base::color_layer_blend, dirt_brightness, true).tint, 0.f, ""), ::state::normal()), ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()), ::state::normal()) : ::df::weighted_layer(coating_reflectivity, ::df::specular_bsdf(coating_tint, ::df::scatter_reflect, ""), frit_weight > 0.f ? ::df::weighted_layer(histogram_scan_big(::base::file_texture(texture_2d("./textures/glass_frit_dist.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * (frit_scale * 0.00999999978f), ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.0199999996f, 1.f - frit_size * 0.870000005f) * frit_weight, ::df::weighted_layer(reflection_transmission_balance * 0.400000006f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), ::df::custom_curve_layer(0.0580000021f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(frit_roughness * frit_roughness, frit_roughness * frit_roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(frit_color, 0.f, ""), ::state::normal()), ::state::normal()), thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::state::normal()) : thin_walled ? ::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect_transmit, ""), ::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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5( + float3(0.f), + 1.f, + normal); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +// 4.2 +export material Glass_Clear_Light_Smudges_Variation(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Light Smudges Variation"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Smudged.Glass_Clear_Light_Smudges_Variation.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "design", "shiny", "AEC", "transparent", "clear", "smooth", "smudged", "dirty", "refractive", "reflective")) +]] = Glass_Smudged +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.325f, + smudges_1_weight: 0.714f, + smudges_2_weight: 0.995f, + smudge_balance: 0.422f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); + + +// 4.3 +export material Glass_Clear_Heavy_Smudges(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Glass Clear - Heavy Smudges"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Glass_Smudged.Glass_Clear_Heavy_Smudges.png"), + ::anno::key_words(string[]("glass", "layered", "construction", "design", "shiny", "AEC", "transparent", "clear", "smooth", "smudged", "dirty", "refractive", "reflective")) +]] = Glass_Smudged +( + infinite_tiling: false, + thin_walled: false, + ior: 1.47f, + abbe_number: 0.f, + roughness: 0.f, + units_absorption_thickness: unit_m , + absorption_thickness: 1.f, + transmittance: color(0.388910f, 0.932277f, 0.781751f), +// Coating + coating_reflectivity: 0.0f, + coating_tint: color(1.f, 1.f, 1.f), +// Frit + frit_weight: 0.f, + frit_color: color(0.78f), + frit_size: 0.363f, + frit_roughness: 0.286f, + frit_scale: float2(1.f), + reflection_transmission_balance: 0.f, +// Dirt + dirt_layer_weight: 0.0, + dirt_brightness: 0.75f, + dirt_weight_1: 0.9f, + dirt_weight_2: 0.3f, + dirt_weight_3: 0.f, + dirt_balance: 0.374f, + dirt_scale: float2(1.f), +// Smudges + smudges_weight: 0.553f, + smudges_1_weight: 0.956f, + smudges_2_weight: 0.893f, + smudge_balance: 0.141f, + smudge_scale: float2(1.f), +//Transform + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), +// Advanced + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Glass/Glazing_Clear.mdl b/code/third_party/vMaterials_2/Glass/Glazing_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..25aa7b28c8cf1dd54712df235675e45c3a123863 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glazing_Clear.mdl @@ -0,0 +1,79 @@ +/***************************************************************************** +* Copyright 2024 NVIDIA Corporation. All rights reserved. +****************************************************************************** + + MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT, + WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR, + 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 ::state::*; +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"; + +export material Glazing_Clear( + uniform color glass_color = color(0.92,0.93,0.92) + [[ + ::anno::display_name("Color"), + ::anno::description("Choose the color of the glass."), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.0 + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.518f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]], + uniform float clarity = 1.f + [[ + ::anno::display_name("Clarity"), + ::anno::description("Smaller values darken the glass."), + ::anno::soft_range(0.1,10.0), + ::anno::in_group("Advanced") + ]] +) [[ + ::anno::display_name("Glazing - Clear Glass"), + ::anno::description("Glazing material for construction and architecture"), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("aec", "glass", "glazing", "architecture", "window", "translucent", "clear")), + ::anno::thumbnail("./.thumbs/Glazing_Clear.Glazing_Clear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = + +::nvidia::core_definitions::thick_glass_v2( + transmission_color: color ( 1.f , 1.f , 1.f), + glass_color: glass_color, + roughness: reflection_roughness, + ior: ior, + base_thickness: clarity +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Glass/Glazing_Float.mdl b/code/third_party/vMaterials_2/Glass/Glazing_Float.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0d57d9d544a3e92001f7f327e562d2046a0a65c2 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Glazing_Float.mdl @@ -0,0 +1,101 @@ +/***************************************************************************** +* Copyright 2024 NVIDIA Corporation. All rights reserved. +****************************************************************************** + + MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT, + WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR, + 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 ::nvidia::core_definitions::*; +import ::state::normal; + +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"; + +export material Glazing_Float( + uniform color glass_color = color ( 0.212231f , 0.913099f , 0.520996f) + [[ + ::anno::display_name("Color"), + ::anno::description("Color of the glass."), + ::anno::in_group("Appearance") + ]], + uniform color tint_color = color ( 1.f , 1.f , 1.f) + [[ + ::anno::display_name("Tint"), + ::anno::description("Choose the tint of the glass."), + ::anno::in_group("Appearance") + ]], + uniform float reflection_weight = 1.f + [[ + ::anno::display_name("Reflection Weight"), + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::hard_range(0.0,1.), + ::anno::in_group("Appearance") + ]], + uniform float reflection_roughness = 0.f + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.0,1.), + ::anno::in_group("Appearance") + ]], + uniform float clarity = 1.f + [[ + ::anno::display_name("Clarity"), + ::anno::description("Smaller values darken the glass."), + ::anno::soft_range(1.0,10.0), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.518f + [[ + ::anno::display_name("IOR"), + ::anno::description("Index of refraction."), + ::anno::soft_range(1.0,4.0), + ::anno::in_group("Advanced") + ]]) +[[ + ::anno::display_name("Glazing - Float Glass"), + ::anno::description("Float glass material for construction and architecture"), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("aec", "glass", "glazing", "architecture", "window", "translucent", "etched", "patterned", "pattern")), + ::anno::thumbnail("./.thumbs/Glazing_Float.Glazing_Float.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= +::nvidia::core_definitions::flex_material_v2( + base_color: color ( 1.f , 1.f , 1.f), + diffuse_roughness: 0.f, + is_metal: false, + reflectivity: reflection_weight, + reflection_roughness: reflection_roughness, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 1.f, + transmission_color: tint_color, + volume_color: glass_color, + transmission_roughness: 0.f, + base_thickness: clarity, + ior: ior * 3.33f, + thin_walled: false, + normal: ::state::normal()); diff --git a/code/third_party/vMaterials_2/Glass/Mirror.mdl b/code/third_party/vMaterials_2/Glass/Mirror.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cab5fc3f7c3e83db7e0d41d1c787c86d6cb3741e --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/Mirror.mdl @@ -0,0 +1,249 @@ +/***************************************************************************** +* Copyright 2024 NVIDIA Corporation. All rights reserved. +****************************************************************************** + + MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT, + WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR, + 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 ::nvidia::core_definitions::flex_material_v2; +import ::state::normal; + +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"; + +export material Mirror( + color base_color = color ( 0.7969177f, 0.7969177f, 0.7969177f ) + [[ + ::anno::display_name("Color"), + ::anno::description("Choose the color of the mirror."), + ::anno::in_group("Appearance") + ]], + float reflection_weight = 1.f + [[ + ::anno::display_name("Reflection Weight"), + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]]) +[[ + ::anno::display_name("Mirror - No Tint"), + ::anno::description("A plain and simple mirror material"), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("aec", "glass", "mirror", "architecture", "bathroom", "reflective")), + ::anno::thumbnail("./.thumbs/Mirror.Mirror.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= +::nvidia::core_definitions::flex_material_v2( + base_color: base_color, + diffuse_roughness: 0.f, + is_metal: true, + reflectivity: reflection_weight, + reflection_roughness: 0.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::state::normal ()); + + + + + +export material Mirror_Warm_Tint( + color base_color = color ( 0.8122431f, 0.708298f, 0.5989411f ) + [[ + ::anno::display_name("Color"), + ::anno::description("Choose the color of the mirror."), + ::anno::in_group("Appearance") + ]], + float reflection_weight = 1.f + [[ + ::anno::display_name("Reflection Weight"), + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]]) +[[ + ::anno::display_name("Mirror - Warm Tint"), + ::anno::description("A plain and simple mirror material with a warm golden tint"), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("aec", "glass", "mirror", "architecture", "bathroom", "reflective", "tint", "tinted", "warm", "gold")), + ::anno::thumbnail("./.thumbs/Mirror.mirror_warm_tint.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= +::nvidia::core_definitions::flex_material_v2( + base_color: base_color, + diffuse_roughness: 0.f, + is_metal: true, + reflectivity: reflection_weight, + reflection_roughness: 0.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::state::normal ()); + + + + + + + +export material Mirror_Cool_Tint( + color base_color = color ( 0.3736157f, 0.5356432f, 0.5795451f) + [[ + ::anno::display_name("Color"), + ::anno::description("Choose the color of the mirror."), + ::anno::in_group("Appearance") + ]], + float reflection_weight = 1.f + [[ + ::anno::display_name("Reflection Weight"), + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]]) +[[ + ::anno::display_name("Mirror - Cool Tint"), + ::anno::description("A plain and simple mirror material with a cool blue tint"), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("aec", "glass", "mirror", "architecture", "bathroom", "reflective", "tint", "tinted", "cool", "blue")), + ::anno::thumbnail("./.thumbs/Mirror.mirror_cool_tint.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= +::nvidia::core_definitions::flex_material_v2( + base_color: base_color, + diffuse_roughness: 0.f, + is_metal: true, + reflectivity: reflection_weight, + reflection_roughness: 0.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::state::normal ()); + + + +export material Mirror_Smoked_Light( + color base_color = color ( 0.4045412f, 0.4045412f, 0.4045412f ) + [[ + ::anno::display_name("Color"), + ::anno::description("Choose the color of the mirror."), + ::anno::in_group("Appearance") + ]], + float reflection_weight = 1.f + [[ + ::anno::display_name("Reflection Weight"), + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]]) +[[ + ::anno::display_name("Mirror - Smoked Light"), + ::anno::description("A plain and simple mirror material with a light smoked reflection property"), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("aec", "glass", "mirror", "architecture", "bathroom", "reflective", "tint", "tinted", "smoked", "light")), + ::anno::thumbnail("./.thumbs/Mirror.mirror_smoked_light.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= +::nvidia::core_definitions::flex_material_v2( + base_color: base_color, + diffuse_roughness: 0.f, + is_metal: true, + reflectivity: reflection_weight, + reflection_roughness: 0.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::state::normal ()); + + + + + + + +export material Mirror_Smoked_Dark( + color base_color = color ( 0.1419804f, 0.1419804f, 0.1419804f ) + [[ + ::anno::display_name("Color"), + ::anno::description("Choose the color of the mirror."), + ::anno::in_group("Appearance") + ]], + float reflection_weight = 1.f + [[ + ::anno::display_name("Reflection Weight"), + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::hard_range(0.0,1.0), + ::anno::in_group("Appearance") + ]]) +[[ + ::anno::display_name("Mirror - Smoked Dark"), + ::anno::description("A plain and simple mirror material with a heavy smoked reflection property"), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("aec", "glass", "mirror", "architecture", "bathroom", "reflective", "tint", "tinted", "smoked", "dark")), + ::anno::thumbnail("./.thumbs/Mirror.mirror_smoked_dark.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= +::nvidia::core_definitions::flex_material_v2( + base_color: base_color, + diffuse_roughness: 0.f, + is_metal: true, + reflectivity: reflection_weight, + reflection_roughness: 0.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + transparency: 0.f, + transmission_color: color ( 1.f , 1.f , 1.f), + volume_color: color ( 1.f , 1.f , 1.f), + transmission_roughness: 0.f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::state::normal ()); + diff --git a/code/third_party/vMaterials_2/Glass/textures/glass_dirt_multi_mask.jpg b/code/third_party/vMaterials_2/Glass/textures/glass_dirt_multi_mask.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7e8a1b1fd0d9f5c7446742afbf9094fb76209940 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/textures/glass_dirt_multi_mask.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e85a43dd58367a9ddd08957f8ddeda1f7193c5b88b8bef20a45efbcd4038ed1 +size 5242750 diff --git a/code/third_party/vMaterials_2/Glass/textures/glass_frit_dist.png b/code/third_party/vMaterials_2/Glass/textures/glass_frit_dist.png new file mode 100644 index 0000000000000000000000000000000000000000..5eaf1bbb12a94b000ab26bf65395e4a9452f9863 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/textures/glass_frit_dist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bed81e250c80c6992c11eb41ed8403b6b7bf4021fad226135493fb2c233d742f +size 1571505 diff --git a/code/third_party/vMaterials_2/Glass/textures/glass_smudges_clouds_multi.jpg b/code/third_party/vMaterials_2/Glass/textures/glass_smudges_clouds_multi.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9bf42f6d751a14d9fcac8aaf2d8ec2a583fc2568 --- /dev/null +++ b/code/third_party/vMaterials_2/Glass/textures/glass_smudges_clouds_multi.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:024fa34c026bc6beee1ed5c2d660bd9b687305ce9b0bb91a74785366f9b02b68 +size 2406562 diff --git a/code/third_party/vMaterials_2/Ground/Asphalt_Fine.mdl b/code/third_party/vMaterials_2/Ground/Asphalt_Fine.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7ef279e3bb4adac183a4d804bebd1e953f9dfd3a --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Asphalt_Fine.mdl @@ -0,0 +1,700 @@ +/****************************************************************************** + * 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 ground material for streets."; + +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) ); + +} +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 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)); +} + + +// Water / Wetness modifier function +struct puddle_return { + color diffuse_out; + float roughness_out; + float ao_out; + float3 normal_out; + float water_transition_out; +}; + + +puddle_return puddles( + color diffuse_in + [[ + ::anno::description("The diffuse map which will have its color changed due to the water. The water effect may also tint the surface as the water can be adjusted to be dirty.") + ]], + float roughness_in + [[ + ::anno::description("The roughness map. The water effect causes the roughness to become reflective.") + ]], + float3 normal_in + [[ + ::anno::description("The normal map input. The normal is changed as the water level rises and puddles form on the material.") + ]], + float ao_in + [[ + ::anno::description("Ambient occlusion which is used to break up the intensity of the reflection. As water appears on ." + "the surface, the AO values are faded to white in the output map.") + ]], + float height_in + [[ + ::anno::description("The height map input. It is used to caluculate the water effect as the water level is rising.") + ]], + + float water_level = 0.5f + [[ + ::anno::description("Controls the water level on the surface. Feed this input with a grayscale map that features blurred spots to simulate water puddles.") + ]], + float water_level_softness = 0.2f, + float murky_water_depth_fade= 0.7f, + color murky_water_color = color(0.7f, 0.62f, 0.44f), + float max_murky_water_tint_opacity = 1.0f, + float pow_wet_diffuse = 2.1f, + float fade_dry_to_wet = 0.0f +) +[[ + ::anno::description("Takes the lookup of 5 maps as input and produces wet layers or puddles as an effect. \n.") +]] +{ + puddle_return result; + result.water_transition_out = ::math::smoothstep(water_level - water_level_softness - 0.001, + water_level + water_level_softness, + height_in + ); + + float wetness = ::math::lerp(result.water_transition_out, 0.0f, fade_dry_to_wet); + + // Roughness map for wet specular. Fading between the original 'dry' roughness and 0.0 which is the reflectivity for complete + // wetness. In theory the 0.0 could be also exposed, in case we would like to leave the some controls for the specular value of + // the wet surface + result.roughness_out = ::math::lerp(0.0f, roughness_in, wetness); + + float water_transluceny = (water_level - height_in) > 0.0f ? (water_level - height_in) * murky_water_depth_fade : 0.0f; + float clamped_water_transluceny = ::math::clamp(water_transluceny, 0.0f, max_murky_water_tint_opacity); + + color dry_wet_diffuse = ::math::lerp(::math::pow(diffuse_in, pow_wet_diffuse), + diffuse_in, + wetness + ); + + // lerping the water color with the wet-dry-diffuse map + result.diffuse_out = ::math::lerp(dry_wet_diffuse, murky_water_color, clamped_water_transluceny); + result.ao_out = ::math::lerp(1.0f, ao_in, result.water_transition_out); + result.normal_out = ::math::lerp(::state::normal(), normal_in, result.water_transition_out); + return result; +} + +export material Asphalt_Fine( + float asphalt_roughness = 0.6f [[ + ::anno::display_name("Asphalt Roughness"), + ::anno::description("Sets the general roughness of the asphalt material."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float asphalt_wetness = 0.0f [[ + ::anno::display_name("Asphalt Wetness"), + ::anno::description("Makes the entire surface wet."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float asphalt_brightness = 0.8f [[ + ::anno::display_name("Asphalt Brightness"), + ::anno::description("Adjusts the brightness of the asphalt material."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float asphalt_bump_strength = 1.f [[ + ::anno::display_name("Asphalt Bump Strength"), + ::anno::description("Controls the strength of the asphalt bump."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float water_level_height = 0.f [[ + ::anno::display_name("Water Level Height"), + ::anno::description("Higher values raise the water level that covers the surface."), + ::anno::in_group("Appearance", "Puddles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float2 puddles_scale = float2(1.3f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Puddles Scale"), + ::anno::in_group("Appearance", "Puddles") + ]], + int puddle_map = 0 [[ + ::anno::description("Selects between 3 different puddle maps, which can be indexed with the numbers 0, 1 and 2."), + ::anno::display_name("Puddle Map"), + ::anno::in_group("Appearance", "Puddles"), + ::anno::hard_range(0, 2) + ]], + float puddles_amount = .0f [[ + ::anno::display_name("Puddles Amount"), + ::anno::description("The amount of water puddles scattered across the material."), + ::anno::in_group("Appearance", "Puddles"), + ::anno::hard_range(0.f, 1.f) + ]], + float puddle_transition_softness = 0.3f [[ + ::anno::description("Controsl the softness of the transition of the wet puddles to the dry asphalt."), + ::anno::display_name("Puddle Transition Softness"), + ::anno::in_group("Appearance", "Puddles"), + ::anno::hard_range(0.f, 1.f) + ]], + float murky_water_depth_fade = 0.33f [[ + ::anno::display_name("Puddles Dirt Fade"), + ::anno::description("Controls the color that the water puddles fade to."), + ::anno::in_group("Appearance", "Puddles"), + ::anno::hard_range(0.f, 1.f) + ]], + color murky_water_color = color(0.7f, 0.62f, 0.44f) [[ + ::anno::display_name("Puddles Water Color"), + ::anno::description("Controls the color that the water puddles fade to."), + ::anno::in_group("Appearance", "Puddles") + ]], + uniform float2 texture_translate = float2(0.0f) [[ + ::anno::display_name("Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2(1.0f) [[ + ::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 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 = 4.f [[ + ::anno::description("Radius of the rounded corners in millimeters (mm)."), + ::anno::display_name("Radius mm"), + ::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::display_name("Asphalt Fine - Dry"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("asphalt", "road", "street", "ground", "multimaterial", "infinite tiling", "gray")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Asphalt_Fine.Asphalt_Fine.png") +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.0204000007f, 1.f, 5.f, puddles(::nvidia::core_definitions::blend_colors(endless_texture(texture_2d("./textures/asphalt_fine_tarred_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.497999996f, 0.451000005f, 0.423999995f), 8.f, true), color(asphalt_brightness * 0.349999994f + 0.649999976f), ::base::color_layer_multiply, 1.f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[0], 0.807000041f, asphalt_roughness * 0.25f + 0.699999988f), endless_normal(texture_2d("./textures/asphalt_fine_tarred_norm.jpg", ::tex::gamma_linear), asphalt_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.5f, 0.5f, 1.f), 10.f), float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[1], float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[2], water_level_height + float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_puddles.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, 0.f, puddles_scale * texture_scale, ::base::texture_coordinate_uvw, 0), 2.f, float3(0.0419999994f), 3.62800026f, false))[puddle_map] * puddles_amount, puddle_transition_softness, murky_water_depth_fade, murky_water_color, 0.933000028f, 2.0999999f, asphalt_wetness).ao_out, ::df::microfacet_ggx_smith_bsdf(puddles(::nvidia::core_definitions::blend_colors(endless_texture(texture_2d("./textures/asphalt_fine_tarred_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.497999996f, 0.451000005f, 0.423999995f), 8.f, true), color(asphalt_brightness * 0.349999994f + 0.649999976f), ::base::color_layer_multiply, 1.f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[0], 0.807000041f, asphalt_roughness * 0.25f + 0.699999988f), endless_normal(texture_2d("./textures/asphalt_fine_tarred_norm.jpg", ::tex::gamma_linear), asphalt_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.5f, 0.5f, 1.f), 10.f), float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[1], float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[2], water_level_height + float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_puddles.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, 0.f, puddles_scale * texture_scale, ::base::texture_coordinate_uvw, 0), 2.f, float3(0.0419999994f), 3.62800026f, false))[puddle_map] * puddles_amount, puddle_transition_softness, murky_water_depth_fade, murky_water_color, 0.933000028f, 2.0999999f, asphalt_wetness).roughness_out * puddles(::nvidia::core_definitions::blend_colors(endless_texture(texture_2d("./textures/asphalt_fine_tarred_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.497999996f, 0.451000005f, 0.423999995f), 8.f, true), color(asphalt_brightness * 0.349999994f + 0.649999976f), ::base::color_layer_multiply, 1.f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[0], 0.807000041f, asphalt_roughness * 0.25f + 0.699999988f), endless_normal(texture_2d("./textures/asphalt_fine_tarred_norm.jpg", ::tex::gamma_linear), asphalt_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.5f, 0.5f, 1.f), 10.f), float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[1], float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[2], water_level_height + float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_puddles.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, 0.f, puddles_scale * texture_scale, ::base::texture_coordinate_uvw, 0), 2.f, float3(0.0419999994f), 3.62800026f, false))[puddle_map] * puddles_amount, puddle_transition_softness, murky_water_depth_fade, murky_water_color, 0.933000028f, 2.0999999f, asphalt_wetness).roughness_out, puddles(::nvidia::core_definitions::blend_colors(endless_texture(texture_2d("./textures/asphalt_fine_tarred_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.497999996f, 0.451000005f, 0.423999995f), 8.f, true), color(asphalt_brightness * 0.349999994f + 0.649999976f), ::base::color_layer_multiply, 1.f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[0], 0.807000041f, asphalt_roughness * 0.25f + 0.699999988f), endless_normal(texture_2d("./textures/asphalt_fine_tarred_norm.jpg", ::tex::gamma_linear), asphalt_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.5f, 0.5f, 1.f), 10.f), float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[1], float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[2], water_level_height + float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_puddles.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, 0.f, puddles_scale * texture_scale, ::base::texture_coordinate_uvw, 0), 2.f, float3(0.0419999994f), 3.62800026f, false))[puddle_map] * puddles_amount, puddle_transition_softness, murky_water_depth_fade, murky_water_color, 0.933000028f, 2.0999999f, asphalt_wetness).roughness_out * puddles(::nvidia::core_definitions::blend_colors(endless_texture(texture_2d("./textures/asphalt_fine_tarred_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.497999996f, 0.451000005f, 0.423999995f), 8.f, true), color(asphalt_brightness * 0.349999994f + 0.649999976f), ::base::color_layer_multiply, 1.f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[0], 0.807000041f, asphalt_roughness * 0.25f + 0.699999988f), endless_normal(texture_2d("./textures/asphalt_fine_tarred_norm.jpg", ::tex::gamma_linear), asphalt_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.5f, 0.5f, 1.f), 10.f), float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[1], float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[2], water_level_height + float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_puddles.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, 0.f, puddles_scale * texture_scale, ::base::texture_coordinate_uvw, 0), 2.f, float3(0.0419999994f), 3.62800026f, false))[puddle_map] * puddles_amount, puddle_transition_softness, murky_water_depth_fade, murky_water_color, 0.933000028f, 2.0999999f, asphalt_wetness).roughness_out, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(puddles(::nvidia::core_definitions::blend_colors(endless_texture(texture_2d("./textures/asphalt_fine_tarred_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.497999996f, 0.451000005f, 0.423999995f), 8.f, true), color(asphalt_brightness * 0.349999994f + 0.649999976f), ::base::color_layer_multiply, 1.f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[0], 0.807000041f, asphalt_roughness * 0.25f + 0.699999988f), endless_normal(texture_2d("./textures/asphalt_fine_tarred_norm.jpg", ::tex::gamma_linear), asphalt_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.5f, 0.5f, 1.f), 10.f), float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[1], float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[2], water_level_height + float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_puddles.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, 0.f, puddles_scale * texture_scale, ::base::texture_coordinate_uvw, 0), 2.f, float3(0.0419999994f), 3.62800026f, false))[puddle_map] * puddles_amount, puddle_transition_softness, murky_water_depth_fade, murky_water_color, 0.933000028f, 2.0999999f, asphalt_wetness).diffuse_out, 0.f), bsdf(), puddles(::nvidia::core_definitions::blend_colors(endless_texture(texture_2d("./textures/asphalt_fine_tarred_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.497999996f, 0.451000005f, 0.423999995f), 8.f, true), color(asphalt_brightness * 0.349999994f + 0.649999976f), ::base::color_layer_multiply, 1.f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[0], 0.807000041f, asphalt_roughness * 0.25f + 0.699999988f), endless_normal(texture_2d("./textures/asphalt_fine_tarred_norm.jpg", ::tex::gamma_linear), asphalt_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.5f, 0.5f, 1.f), 10.f), float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[1], float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[2], water_level_height + float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_puddles.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, 0.f, puddles_scale * texture_scale, ::base::texture_coordinate_uvw, 0), 2.f, float3(0.0419999994f), 3.62800026f, false))[puddle_map] * puddles_amount, puddle_transition_softness, murky_water_depth_fade, murky_water_color, 0.933000028f, 2.0999999f, asphalt_wetness).normal_out), puddles(::nvidia::core_definitions::blend_colors(endless_texture(texture_2d("./textures/asphalt_fine_tarred_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.497999996f, 0.451000005f, 0.423999995f), 8.f, true), color(asphalt_brightness * 0.349999994f + 0.649999976f), ::base::color_layer_multiply, 1.f, true).tint, histogram_range(float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[0], 0.807000041f, asphalt_roughness * 0.25f + 0.699999988f), endless_normal(texture_2d("./textures/asphalt_fine_tarred_norm.jpg", ::tex::gamma_linear), asphalt_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.5f, 0.5f, 1.f), 10.f), float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[1], float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, 0), 10.f, float3(0.344999999f, 0.875f, 0.579999983f), 10.f, false))[2], water_level_height + float3(endless_texture(texture_2d("./textures/asphalt_fine_tarred_multi_puddles.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, 0.f, puddles_scale * texture_scale, ::base::texture_coordinate_uvw, 0), 2.f, float3(0.0419999994f), 3.62800026f, false))[puddle_map] * puddles_amount, puddle_transition_softness, murky_water_depth_fade, murky_water_color, 0.933000028f, 2.0999999f, asphalt_wetness).normal_out), + 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.001f, 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 Dried with puddles +export material Asphalt_Fine_Dry_With_Puddles(*) +[[ + ::anno::display_name("Asphalt Fine - Dry with Puddles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("asphalt", "road", "street", "ground", "multimaterial", "infinite tiling", "dry", "puddles", "water", "gray")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Asphalt_Fine.Asphalt_Fine_Dry_With_Puddles.png") +]] = Asphalt_Fine( + asphalt_roughness: 0.5f, + asphalt_wetness: 0.0f, + asphalt_brightness: 0.7f, + asphalt_bump_strength: 1.0f, + water_level_height: 0.0f, + puddles_scale: float2(1.3f), + puddle_map: 2, + puddles_amount: 1.0f, + puddle_transition_softness: 0.1f, + murky_water_depth_fade: 0.368f, + murky_water_color: color(0.7f, 0.62f, .44f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 5.0f, + across_materials: true +); + +// 3 Dried with strong puddles +export material Asphalt_Fine_Dry_With_Strong_Puddles(*) +[[ + ::anno::display_name("Asphalt Fine - Dry with many Puddles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("asphalt", "road", "street", "ground", "multimaterial", "infinite tiling", "puddles", "water", "gray")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Asphalt_Fine.Asphalt_Fine_Dry_With_Strong_Puddles.png") +]] = Asphalt_Fine( + asphalt_roughness: 0.5f, + asphalt_wetness: 0.0f, + asphalt_brightness: 0.5f, + asphalt_bump_strength: 1.0f, + water_level_height: 0.3f, + puddles_scale: float2(1.3f), + puddle_map: 2, + puddles_amount: 1.0f, + puddle_transition_softness: 0.1f, + murky_water_depth_fade: 0.368f, + murky_water_color: color(0.7f, 0.62f, .44f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 5.0f, + across_materials: true +); + +// 4 Moist +export material Asphalt_Fine_Moist(*) +[[ + ::anno::display_name("Asphalt Fine - Moist"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("asphalt", "road", "street", "ground", "multimaterial", "infinite tiling", "wet", "moist", "water", "gray")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Asphalt_Fine.Asphalt_Fine_Moist.png") +]] = Asphalt_Fine( + asphalt_roughness: 0.6f, + asphalt_wetness: 0.3f, + asphalt_brightness: 0.3f, + asphalt_bump_strength: 1.0f, + water_level_height: 0.0f, + puddles_scale: float2(1.3f), + puddle_map: 0, + puddles_amount: 0.0f, + puddle_transition_softness: 0.3f, + murky_water_depth_fade: 0.368f, + murky_water_color: color(0.7f, 0.62f, .44f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 5.0f, + across_materials: true +); + +// 5 Medium Wet +export material Asphalt_Fine_Medium_Wet(*) +[[ + ::anno::display_name("Asphalt Fine - Medium Wet"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("asphalt", "road", "street", "ground", "multimaterial", "infinite tiling", "wet", "water", "gray")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Asphalt_Fine.Asphalt_Fine_Medium_Wet.png") +]] = Asphalt_Fine( + asphalt_roughness: 0.6f, + asphalt_wetness: 0.3f, + asphalt_brightness: 0.5f, + asphalt_bump_strength: 1.0f, + water_level_height: 0.45f, + puddles_scale: float2(1.3f), + puddle_map: 0, + puddles_amount: 0.0f, + puddle_transition_softness: 0.3f, + murky_water_depth_fade: 0.368f, + murky_water_color: color(0.7f, 0.62f, .44f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 5.0f, + across_materials: true +); + +// 6 Moist with Puddles +export material Asphalt_Fine_Moist_With_Puddles(*) +[[ + ::anno::display_name("Asphalt Fine - Moist with Puddles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("asphalt", "road", "street", "ground", "multimaterial", "infinite tiling", "wet", "moist", "water", "gray")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Asphalt_Fine.Asphalt_Fine_Moist_With_Puddles.png") +]] = Asphalt_Fine( + asphalt_roughness: 0.5f, + asphalt_wetness: 0.0f, + asphalt_brightness: 0.5f, + asphalt_bump_strength: 1.0f, + water_level_height: 0.45f, + puddles_scale: float2(1.3f), + puddle_map: 0, + puddles_amount: 1.0f, + puddle_transition_softness: 0.3f, + murky_water_depth_fade: 0.368f, + murky_water_color: color(0.7f, 0.62f, .44f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 5.0f, + across_materials: true +); + +// 7 Wet +export material Asphalt_Fine_Wet(*) +[[ + ::anno::display_name("Asphalt Fine - Wet"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("asphalt", "road", "street", "ground", "multimaterial", "infinite tiling", "wet", "moist", "water", "gray")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Asphalt_Fine.Asphalt_Fine_Wet.png") +]] = Asphalt_Fine( + asphalt_roughness: 0.6f, + asphalt_wetness: 0.3f, + asphalt_brightness: 0.3f, + asphalt_bump_strength: 1.0f, + water_level_height: 0.6f, + puddles_scale: float2(1.3f), + puddle_map: 2, + puddles_amount: 0.0f, + puddle_transition_softness: 0.6f, + murky_water_depth_fade: 0.368f, + murky_water_color: color(0.7f, 0.62f, .44f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 5.0f, + across_materials: true +); + +// 8 Wet with puddles +export material Asphalt_Wet_Puddles(*) +[[ + ::anno::display_name("Asphalt Fine - Wet Puddles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("asphalt", "road", "street", "ground", "puddles", "multimaterial", "infinite tiling", "wet", "moist", "water", "gray")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Asphalt_Fine.Asphalt_Wet_Puddles.png") +]] = Asphalt_Fine( + asphalt_roughness: 0.6f, + asphalt_wetness: 0.3f, + asphalt_brightness: 0.3f, + asphalt_bump_strength: 1.0f, + water_level_height: 0.6f, + puddles_scale: float2(1.3f), + puddle_map: 2, + puddles_amount: 1.0f, + puddle_transition_softness: 0.6f, + murky_water_depth_fade: 0.368f, + murky_water_color: color(0.7f, 0.62f, .44f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 5.0f, + across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Ground/Cobblestone_Big_and_Loose.mdl b/code/third_party/vMaterials_2/Ground/Cobblestone_Big_and_Loose.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5f2360f0fb775d4ad949e1d389f7e9390877e2b2 --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Cobblestone_Big_and_Loose.mdl @@ -0,0 +1,306 @@ +/****************************************************************************** + * 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"; + + + + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor))); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +export material Cobblestone_Big_and_Loose( + float brightness = 0.6f [[ + ::anno::description("Adjusts the general brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float bricks_roughness = 1.0f [[ + ::anno::description("Adjusts the roughness of the bricks."), + ::anno::display_name("Bricks Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float water_height = 0.0f [[ + ::anno::description("Raise the level of water surrounding the bricks."), + ::anno::display_name("Water Level"), + ::anno::in_group("Appearance", "Water"), + ::anno::hard_range(0.f, 1.f) + ]], + float water_transition_softness = 0.0f [[ + ::anno::description("Adjusts the softness of the transition from dry material to water. A softer transition will show areas, where the material gets moist first before being submerged in water."), + ::anno::display_name("Water Transition Softness"), + ::anno::in_group("Appearance", "Water"), + ::anno::hard_range(0.f, 1.f) + ]], + float bump_strength = 1.45f [[ + ::anno::description("Specifies the strength of the bump, lowering this value males the surface appear flat."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 2.f) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.8f, 1.8f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index_1 = 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("Cobblestone Big and Loose - Rough"), + ::anno::description("A cobblestone material with large stones and wide gaps."), + ::anno::key_words(string[]("stone", "stones", "cobblestone", "paving", "outdoor", "architecture", "ground", "matte", "bumped", "weathered", "gray")), + ::anno::thumbnail("./.thumbs/Cobblestone_Big_and_Loose.Cobblestone_Big_and_Loose.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.04f, 1.f, 5.f, ::math::lerp(1.f, histogram_scan_big(::math::pow(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 3.30900025f), 0.97f, 0.50f), ::math::smoothstep(water_height * 0.8f - (water_transition_softness * 0.44f + 0.01f), water_height * 0.8f + (water_transition_softness * 0.44f + 0.01f), float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::df::microfacet_ggx_vcavities_bsdf(::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855f), histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408f, bricks_roughness * 0.694f + 0.306000024f), ::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_mask.png", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(water_height * 0.8f - (water_transition_softness * 0.44f + 0.01f), water_height * 0.8f + (water_transition_softness * 0.44f + 0.01f), float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])) * ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.41f, bricks_roughness * 0.69f + 0.306000024f), ::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_mask.png", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(water_height * 0.8f - (water_transition_softness * 0.44f + 0.01f), water_height * 0.8f + (water_transition_softness * 0.44f + 0.01f), float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.41f, bricks_roughness * 0.69f + 0.306000024f), ::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_mask.png", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(water_height * 0.8f - (water_transition_softness * 0.44f + 0.01f), water_height * 0.8f + (water_transition_softness * 0.44f + 0.01f), float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])) * ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.41f, bricks_roughness * 0.69f + 0.306000024f), ::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_mask.png", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(water_height * 0.8f - (water_transition_softness * 0.44f + 0.01f), water_height * 0.8f + (water_transition_softness * 0.44f + 0.01f), float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(::nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), ::math::lerp(color(0.51f, 0.51f, 0.51f), color(1.f, 1.f, 1.f), ::math::smoothstep(water_height * 0.8f - (water_transition_softness * 0.44f + 0.01f), water_height * 0.8f + (water_transition_softness * 0.44f + 0.01f), float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.349999994f, 0.f, brightness), true).tint, color(0.284646988f, 0.245784f, 0.231759995f), ::base::color_layer_screen, ::math::smoothstep(water_height * 0.8f - (water_transition_softness * 0.44f + 0.01f), water_height * 0.8f + (water_transition_softness * 0.44f + 0.01f), float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (1.f - ::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_mask.png", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * 0.248000011f, true).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, + normalmap_normal(texture_2d("./textures/cobblestone_big_and_loose_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, bump_strength, ::math::smoothstep(water_height * 0.8f - (water_transition_softness * 0.44f + 0.01f), water_height * 0.8f + (water_transition_softness * 0.44f + 0.01f), float3(::base::file_texture(texture_2d("./textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Cobblestone_Big_and_Loose_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cobblestone Big and Loose - Shiny"), + ::anno::description("A cobblestone material with large stones and wide gaps."), + ::anno::key_words(string[]("stone", "stones", "cobblestone", "paving", "outdoor", "architecture", "ground", "shiny", "bumped", "weathered", "gray")), + ::anno::thumbnail("./.thumbs/Cobblestone_Big_and_Loose.Cobblestone_Big_and_Loose_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Cobblestone_Big_and_Loose +( + brightness: 0.8f, + bricks_roughness: 0.3f, + water_height: 0.0f, + water_transition_softness: 0.0f, + bump_strength: 1.45f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index_1: 0 +); + + + +export material Cobblestone_Big_and_Loose_Wet_Grout(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cobblestone Big and Loose - Wet Grout"), + ::anno::description("A cobblestone material with large stones and wide gaps."), + ::anno::key_words(string[]("stone", "stones", "cobblestone", "paving", "outdoor", "architecture", "ground", "shiny", "bumped", "weathered", "wet", "water", "moist", "gray")), + ::anno::thumbnail("./.thumbs/Cobblestone_Big_and_Loose.Cobblestone_Big_and_Loose_Wet_Grout.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Cobblestone_Big_and_Loose +( + brightness: 0.121f, + bricks_roughness: 0.7f, + water_height: 0.61f, + water_transition_softness: 0.5, + bump_strength: 1.45f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index_1: 0 +); + + + +export material Cobblestone_Big_and_Loose_Wet(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cobblestone Big and Loose - Wet"), + ::anno::description("A cobblestone material with large stones and wide gaps."), + ::anno::key_words(string[]("stone", "stones", "cobblestone", "paving", "outdoor", "architecture", "ground", "shiny", "bumped", "weathered", "wet", "water", "moist", "gray")), + ::anno::thumbnail("./.thumbs/Cobblestone_Big_and_Loose.Cobblestone_Big_and_Loose_Wet.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Cobblestone_Big_and_Loose +( + brightness: 0.0f, + bricks_roughness: 0.166f, + water_height: 0.68f, + water_transition_softness: 0.9, + bump_strength: 1.45f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index_1: 0 +); + + + + + diff --git a/code/third_party/vMaterials_2/Ground/Cobblestone_Medieval.mdl b/code/third_party/vMaterials_2/Ground/Cobblestone_Medieval.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ec4cdeb0ce7258a65e2e5ffc30899e26e746edea --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Cobblestone_Medieval.mdl @@ -0,0 +1,461 @@ +/****************************************************************************** + * 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 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 1 + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization + */ + + // 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)); +} + +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_small(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(0.0, 1.0 - width, position), + ::math::lerp(width, 1.0 , position)), + 0.0, + 1.0); +} + + +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 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ ::anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 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; + + 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(); +} + + +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 Cobblestone_Medieval( + 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 diffuse_brightness = 0.7f [[ + ::anno::description("Adjusts the diffuse brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float diffuse_dirt = 0.05f [[ + ::anno::description("Adds some dirt and darkens the material."), + ::anno::display_name("Diffuse Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float reflection_roughness = 0.26f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float reflection_weight = 1.0f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 1.0f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 3.f), + ::anno::soft_range(0.f, 1.f), + ::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(0.625f, 0.625f)), + ::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 = 10.f [[ + ::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, 20.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("Use selected UV space for the material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::description("A manual laid stone material with concrete inbetween."), + ::anno::display_name("Medieval Cobblestone"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cobblestone_Medieval.Cobblestone_Medieval.png"), + ::anno::key_words(string[]("cobblestone", "ground", "rock", "paving", "infinite tiling", "gray", "exterior", "architecture", "new", "rough")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0599999987f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.50999999f, float3(0.764999986f, 0.552941024f, 0.482353002f), 3.50999999f, false) : ::base::file_texture(texture_2d("./textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, ::math::lerp(0.560000002f, 0.f, reflection_weight)), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.50999999f, float3(0.764999986f, 0.552941024f, 0.482353002f), 3.50999999f, false) : ::base::file_texture(texture_2d("./textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.659999967f, reflection_roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.50999999f, float3(0.764999986f, 0.552941024f, 0.482353002f), 3.50999999f, false) : ::base::file_texture(texture_2d("./textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.659999967f, reflection_roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/cobblestone_medieval_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.50999999f, float3(0.596077979f, 0.576470971f, 0.549019992f), 3.50999999f, true) : ::base::file_texture(texture_2d("./textures/cobblestone_medieval_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.300000012f + 0.300000012f).tint, color(histogram_scan_small(float3(infinite_tiling ? endless_texture(texture_2d("./textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.50999999f, float3(0.764999986f, 0.552941024f, 0.482353002f), 3.50999999f, false) : ::base::file_texture(texture_2d("./textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.610000014f, 0.f)), ::base::color_layer_colorburn, diffuse_dirt * 0.5f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/cobblestone_medieval_norm.jpg", ::tex::gamma_linear), 1.f, false, true, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.50999999f, float3(0.521569014f, 0.517647028f, 0.976471007f), 3.50999999f) : ::base::tangent_space_normal_texture(texture_2d("./textures/cobblestone_medieval_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/cobblestone_medieval_norm.jpg", ::tex::gamma_linear), 1.f, false, true, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.50999999f, float3(0.521569014f, 0.517647028f, 0.976471007f), 3.50999999f) : ::base::tangent_space_normal_texture(texture_2d("./textures/cobblestone_medieval_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 Cobblestone_Medieval_Dark_Dirt(*) +[[ + ::anno::description("A manual laid stone material with concrete inbetween."), + ::anno::display_name("Medieval Cobblestone - Dark Dirt"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Cobblestone_Medieval.Cobblestone_Medieval_Dark_Dirt.png"), + ::anno::key_words(string[]("cobblestone", "ground", "rock", "paving", "infinite tiling", "gray", "exterior", "architecture", "dirty", "rough")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Cobblestone_Medieval( + infinite_tiling: true, + diffuse_brightness: 0.65f, + diffuse_dirt: 0.83f, + reflection_roughness: 0.86f, + reflection_weight: 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: 10.f, + roundcorners_across_materials: false +); + + + + + diff --git a/code/third_party/vMaterials_2/Ground/Gravel_Track_Ballast.mdl b/code/third_party/vMaterials_2/Ground/Gravel_Track_Ballast.mdl new file mode 100644 index 0000000000000000000000000000000000000000..caba0ffff45e87b44b17c39901813d50841f677f --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Gravel_Track_Ballast.mdl @@ -0,0 +1,349 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.4; + + +import ::base::*; +import ::anno::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + + + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + 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)); +} + + +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 Gravel_Track_Ballast( + uniform bool infinite_tiling = true [[ + ::anno::display_name("Infinite Tiling"), + ::anno::description("Enables infinite tiling feature which removes tiling artifacts."), + ::anno::in_group("Appearance") + ]], + float infinite_texture_scale = .25f [[ + ::anno::display_name("Infinite Tiling Clarity"), + ::anno::description("Adjusts the patch size of the infinite tiling. Lower values result in larger patches."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float gravel_brightness = 0.5f [[ + ::anno::display_name("Gravel Brightness"), + ::anno::description("Adjusts the brightness of the gravel."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float gravel_roughnes = 0.5f [[ + ::anno::display_name("Gravel Roughness"), + ::anno::description("Adjusts the roughness of the gravel."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float bump_factor = 1.0f [[ + ::anno::display_name("Bump Factor"), + ::anno::description("Determines the degree of bumpiness."), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::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 = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gravel Track Ballast"), + ::anno::description("Track ballast material made from crushed rocks."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gravel_Track_Ballast.Gravel_Track_Ballast.png"), + ::anno::key_words(string[]("aec", "gravel", "ground", "construction", "exterior", "crushed", "rocks", "stones", "hard", "track", "ballast", "gray")) +]] + = + let { + + float infinite_texture_scale_remap = 1.0f + infinite_texture_scale * 49.0f; + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), infinite_texture_scale_remap, float3(0.549000025f), infinite_texture_scale_remap, false) : ::base::file_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.632000029f, 0.762000024f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), infinite_texture_scale_remap, float3(0.549000025f), infinite_texture_scale_remap, false) : ::base::file_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.5f, 0.899999976f, gravel_roughnes)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), infinite_texture_scale_remap, float3(0.549000025f), infinite_texture_scale_remap, false) : ::base::file_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.5f, 0.899999976f, gravel_roughnes)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), infinite_texture_scale_remap, float3(0.549000025f), infinite_texture_scale_remap, false) : ::base::file_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.5f, 0.899999976f, gravel_roughnes)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), infinite_texture_scale_remap, float3(0.549000025f), infinite_texture_scale_remap, false) : ::base::file_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.5f, 0.899999976f, gravel_roughnes)), 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(infinite_tiling ? endless_texture(texture_2d("./textures/gravel_track_ballast_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), infinite_texture_scale_remap, float3(0.513999999f, 0.476000011f, 0.43900001f), infinite_texture_scale_remap, true) : ::base::file_texture(texture_2d("./textures/gravel_track_ballast_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), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::lerp(0.621000051f, 1.f, gravel_brightness)), ::base::color_layer_multiply, 1.f).tint, color(float3(infinite_tiling ? endless_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), infinite_texture_scale_remap, float3(0.549000025f), infinite_texture_scale_remap, false) : ::base::file_texture(texture_2d("./textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::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)); + 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/gravel_track_ballast_norm.jpg", ::tex::gamma_linear), bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space), infinite_texture_scale_remap, float3(0.5f, 0.5f, 1.f), infinite_texture_scale_remap) : normalmap_normal(texture_2d("./textures/gravel_track_ballast_norm.jpg", ::tex::gamma_linear), bump_factor, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: color(1.f, 1.f, 1.f), + volume: tmp4, + geometry: tmp5); + diff --git a/code/third_party/vMaterials_2/Ground/Ground_Aggregate_Exposed.mdl b/code/third_party/vMaterials_2/Ground/Ground_Aggregate_Exposed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a53ad2bd95b6a854eb838c3336bf79c7af8f7d4 --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Ground_Aggregate_Exposed.mdl @@ -0,0 +1,467 @@ +/****************************************************************************** + * 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 = "An aggregate stone material with an additional moss layer growing on top."; + + +float3 hsv2rgb(float3 c) +{ + float4 K = float4(1.0, 2.0/3.0, 1.0/3.0, 3.0); + float3 p = ::math::abs(::math::frac(float3(c.x) + float3(K.x, K.y, K.z)) * 6.0 - float3(K.w)); + return c.z * ::math::lerp(float3(K.x), ::math::clamp(p - float3(K.x), 0.0, 1.0), c.y); +} + + +color hue_shift( + color input = color(1.0, 0.0, 0.0), + float hue_adjust = 0.0f +) +{ + float3 in_color = float3(input); + float3 kRGBToYPrime = float3 (0.299, 0.587, 0.114); + float3 kRGBToI = float3 (0.596, -0.275, -0.321); + float3 kRGBToQ = float3 (0.212, -0.523, 0.311); + + + float3 kYIQToR = float3 (1.0, 0.956, 0.621); + float3 kYIQToG = float3 (1.0, -0.272, -0.647); + float3 kYIQToB = float3 (1.0, -1.107, 1.704); + + float YPrime = ::math::dot(in_color, kRGBToYPrime); + float I = ::math::dot(in_color, kRGBToI); + float Q = ::math::dot(in_color, kRGBToQ); + float hue = ::math::atan2(Q, I); + float chroma = ::math::sqrt(I * I + Q * Q); + + hue += hue_adjust; + + Q = chroma * ::math::sin(hue); + I = chroma * ::math::cos(hue); + + float3 yIQ = float3 (YPrime, I, Q); + + return color(::math::dot (yIQ, kYIQToR),::math::dot (yIQ, kYIQToG), ::math::dot (yIQ, kYIQToB) ); +} + + +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 remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_small(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(0.0, 1.0 - width, position), + ::math::lerp(width, 1.0 , position)), + 0.0, + 1.0); +} + + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +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)); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::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 Ground_Aggregate_Exposed( + float stone_brightness = 1.f [[ + ::anno::description("Adjusts the lightness of the stones and pebbles."), + ::anno::display_name("Stone Brightness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Stone") + ]], + float pebble_tip_roughness = 0.f [[ + ::anno::description("Controls the roughness of the pebble tips."), + ::anno::display_name("Pebble Tip Roughness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Stone") + ]], + float stones_bump_factor = 1.0f [[ + ::anno::description("Drives the bumpiness of the stones."), + ::anno::display_name("Stone Bump Factor"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Stone") + ]], + float moss_height_growth = 0.599000037f [[ + ::anno::description("Controls the growth of the moss material."), + ::anno::display_name("Moss Growth"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Moss") + ]], + float evem_moss_distribution_amount = 0.423000008f [[ + ::anno::description("A lower value makes the moss grow more unevenly across the surface."), + ::anno::display_name("Moss Coverage"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Moss") + ]], + float moss_saturation = 0.0420000032f [[ + ::anno::description("Controls the saturation of the moss."), + ::anno::display_name("Moss Saturation"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Moss") + ]], + float moss_brightness = 0.78700006f [[ + ::anno::description("Adjusts the brightness of the moss."), + ::anno::display_name("Moss Brightness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Moss") + ]], + float moss_moisture = 0.f [[ + ::anno::description("It describes how damp the moss is."), + ::anno::display_name("Moss Moisture"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Moss") + ]], + float moss_weight = 1.f [[ + ::anno::description("Decreasing this parameter makes the moss layer more transparent."), + ::anno::display_name("Moss Weight"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Moss") + ]], + // for some reason this parameter got exported twice form the substance graph, I + // could not yet figure out why + // float moss_weight_1 = 1.f [[ + // ::anno::description("Decreasing this parameter makes the moss layer more transparent."), + // ::anno::display_name("Moss Weight"), + // ::anno::in_group("Appearance", "Moss") + // ]], + uniform float moss_bump_factor = 1.f [[ + ::anno::description("Determines the degree of bumpiness of the moss."), + ::anno::display_name("Moss Bump Factor"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance", "Moss") + ]], + 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(0.5f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.4, 0.4)) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV Space."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Ground Aggregate Mossy"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Exposed.png"), + ::anno::key_words(string[]("stone", "pebbles", "aggregate", "weathered", "rough", "construction", "architecture", "moss", "mossy", "nature", "layered", "outdoor", "ground", "multimaterial", "worn", "gray")) +]] + = + let { + bool tmp0 = false; + float moss_weight_1 = 1.f; + float moss_brightness_remap = moss_brightness * 2.0; + + material_surface tmp1(::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(::math::lerp(0.459000021f, 1.f, ::base::file_texture(texture_2d("./textures/aggregate_exposed_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), 0.901000023f - ::math::clamp(remap(::base::file_texture(texture_2d("./textures/ground_aggregate_exposed_curv.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.f, 0.f, pebble_tip_roughness), histogram_scan_small(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.179000005f, 0.553000033f)), histogram_range(float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.580000043f, ::math::lerp(0.800000012f, 0.180000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(::base::file_texture(texture_2d("./textures/HiLowNoise_D.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, evem_moss_distribution_amount)), 0.f, ::math::clamp(histogram_scan_big(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), moss_weight_1)) * ::math::lerp(::math::lerp(::math::lerp(0.459000021f, 1.f, ::base::file_texture(texture_2d("./textures/aggregate_exposed_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), 0.901000023f - ::math::clamp(remap(::base::file_texture(texture_2d("./textures/ground_aggregate_exposed_curv.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.f, 0.f, pebble_tip_roughness), histogram_scan_small(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.179000005f, 0.553000033f)), histogram_range(float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.580000043f, ::math::lerp(0.800000012f, 0.180000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(::base::file_texture(texture_2d("./textures/HiLowNoise_D.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, evem_moss_distribution_amount)), 0.f, ::math::clamp(histogram_scan_big(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), moss_weight_1)), ::math::lerp(::math::lerp(::math::lerp(0.459000021f, 1.f, ::base::file_texture(texture_2d("./textures/aggregate_exposed_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), 0.901000023f - ::math::clamp(remap(::base::file_texture(texture_2d("./textures/ground_aggregate_exposed_curv.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.f, 0.f, pebble_tip_roughness), histogram_scan_small(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.179000005f, 0.553000033f)), histogram_range(float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.580000043f, ::math::lerp(0.800000012f, 0.180000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(::base::file_texture(texture_2d("./textures/HiLowNoise_D.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, evem_moss_distribution_amount)), 0.f, ::math::clamp(histogram_scan_big(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), moss_weight_1)) * ::math::lerp(::math::lerp(::math::lerp(0.459000021f, 1.f, ::base::file_texture(texture_2d("./textures/aggregate_exposed_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), 0.901000023f - ::math::clamp(remap(::base::file_texture(texture_2d("./textures/ground_aggregate_exposed_curv.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.f, 0.f, pebble_tip_roughness), histogram_scan_small(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.179000005f, 0.553000033f)), histogram_range(float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.580000043f, ::math::lerp(0.800000012f, 0.180000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(::base::file_texture(texture_2d("./textures/HiLowNoise_D.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, evem_moss_distribution_amount)), 0.f, ::math::clamp(histogram_scan_big(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), moss_weight_1)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::math::lerp(::base::file_texture(texture_2d("./textures/aggregate_exposed_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(::math::lerp(stone_brightness, 0.400000006f, 0.75f)), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, hue_shift(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/moss_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::pow(hsv2rgb(float3(0.2214614f, ::math::lerp(0.f, 0.699999988f, moss_saturation), ::math::lerp(0.175000012f, 0.699999988f, moss_brightness_remap))), 2.20000005f)), ::base::color_layer_overlay, 1.f).tint, 5.95100021f), moss_weight * ::math::lerp(histogram_scan_big(::base::file_texture(texture_2d("./textures/HiLowNoise_D.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, evem_moss_distribution_amount)), 0.f, ::math::clamp(histogram_scan_big(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), 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, add_detail_normal(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./textures/moss_norm.jpg", ::tex::gamma_linear), moss_bump_factor, false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), moss_weight * ::math::lerp(histogram_scan_big(::base::file_texture(texture_2d("./textures/HiLowNoise_D.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, evem_moss_distribution_amount)), 0.f, ::math::clamp(histogram_scan_big(::base::file_texture(texture_2d("./textures/aggregate_exposed_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), normalmap_normal(texture_2d("./textures/aggregate_exposed_norm.jpg", ::tex::gamma_linear), stones_bump_factor, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Ground_Aggregate_Exposed_Matte(*) +[[ + ::anno::display_name("Ground Aggregate Exposed - Matte"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Exposed_Matte.png"), + ::anno::key_words(string[]("stone", "pebbles", "aggregate", "weathered", "rough", "construction", "architecture", "moss", "mossy", "nature", "layered", "outdoor", "ground", "multimaterial", "worn", "gray")) +]] += Ground_Aggregate_Exposed( + stone_brightness: .6f, + pebble_tip_roughness: 1.0f, + stones_bump_factor: 1.00f, + moss_height_growth: 0.0f, + evem_moss_distribution_amount: 0.0f, + moss_saturation: 0.8f, + moss_brightness: 0.8f, + moss_moisture: 0.0f, + moss_weight: 0.0f, + moss_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Ground_Aggregate_Slightly_Mossy(*) +[[ + ::anno::display_name("Ground Aggregate Exposed - Slighty Mossy"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Slightly_Mossy.png"), + ::anno::key_words(string[]("stone", "pebbles", "aggregate", "weathered", "rough", "construction", "architecture", "moss", "mossy", "nature", "layered", "outdoor", "ground", "multimaterial", "worn", "gray", "green", "multicolor")) +]] += Ground_Aggregate_Exposed( + stone_brightness: 1.0f, + pebble_tip_roughness: 0.5f, + stones_bump_factor: 1.00f, + moss_height_growth: 0.55f, + evem_moss_distribution_amount: 1.0f, + moss_saturation: 0.88f, + moss_brightness: 0.8f, + moss_moisture: 0.0f, + moss_weight: 1.0f, + moss_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Ground_Aggregate_Heavy_Moss(*) +[[ + ::anno::display_name("Ground Aggregate Exposed - Heavy Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Heavy_Moss.png"), + ::anno::key_words(string[]("stone", "pebbles", "aggregate", "weathered", "rough", "construction", "architecture", "moss", "mossy", "nature", "layered", "outdoor", "ground", "multimaterial", "worn", "gray", "green", "multicolor")) +]] += Ground_Aggregate_Exposed( + stone_brightness: 1.0f, + pebble_tip_roughness: 0.5f, + stones_bump_factor: 1.00f, + moss_height_growth: 0.875f, + evem_moss_distribution_amount: 1.0f, + moss_saturation: 0.0f, + moss_brightness: 0.8f, + moss_moisture: 0.0f, + moss_weight: 1.0f, + moss_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Ground_Aggregate_Saturated_Moss_Patches(*) +[[ + ::anno::display_name("Ground Aggregate Exposed - Moss Patches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Saturated_Moss_Patches.png"), + ::anno::key_words(string[]("stone", "pebbles", "aggregate", "weathered", "rough", "construction", "architecture", "moss", "mossy", "nature", "layered", "outdoor", "ground", "multimaterial", "worn", "gray", "green", "multicolor")) +]] += Ground_Aggregate_Exposed( + stone_brightness: 1.0f, + pebble_tip_roughness: 0.0f, + stones_bump_factor: 1.00f, + moss_height_growth: 0.9f, + evem_moss_distribution_amount: 0.524f, + moss_saturation: 0.85f, + moss_brightness: 0.8f, + moss_moisture: 0.0f, + moss_weight: 1.0f, + moss_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Ground_Aggregate_Charred_Moss(*) +[[ + ::anno::display_name("Ground Aggregate Exposed - Charred Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Charred_Moss.png"), + ::anno::key_words(string[]("stone", "pebbles", "aggregate", "weathered", "rough", "construction", "architecture", "moss", "mossy", "dried", "nature", "layered", "outdoor", "ground", "multimaterial", "worn", "gray", "dark", "multicolor")) +]] += Ground_Aggregate_Exposed( + stone_brightness: 1.0f, + pebble_tip_roughness: 0.8f, + stones_bump_factor: 1.00f, + moss_height_growth: 0.68f, + evem_moss_distribution_amount: 0.96f, + moss_saturation: 0.2f, + moss_brightness: 0.2f, + moss_moisture: 0.0f, + moss_weight: 1.0f, + moss_bump_factor: 1.0f, + 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/Ground/Ground_Hard_Court.mdl b/code/third_party/vMaterials_2/Ground/Ground_Hard_Court.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8919036f62510ee10e2355aa910d5ab6d91427ac --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Ground_Hard_Court.mdl @@ -0,0 +1,570 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +const string DESCRIPTION = "A hard court material for sports activities"; + +// Taken from https://www.shadertoy.com/view/4tlBWB +float3 hsv2rgb(float3 c) +{ + float4 K = float4(1.0, 2.0/3.0, 1.0/3.0, 3.0); + float3 p = ::math::abs(::math::frac(float3(c.x) + float3(K.x, K.y, K.z)) * 6.0 - float3(K.w)); + return c.z * ::math::lerp(float3(K.x), ::math::clamp(p - float3(K.x), 0.0, 1.0), c.y); +} + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +export material Ground_Hard_Court( + uniform bool infinite_tiling = true [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float ground_hue = 0.02f [[ + ::anno::description("Selects the Hue for the Ground cort material. You can select any hue that you want, though we recommend to stick to colors that are actually used in real life."), + ::anno::display_name("Ground Hue"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float ground_saturation = 0.85f [[ + ::anno::description("Adjust the saturation of the hard court material color. Default is 0.8, Beware that setting the saturation to the maximum value will result in unrealistic looking saturation."), + ::anno::display_name("Ground Saturation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float ground_brightness = 0.6f [[ + ::anno::description("Adjusts the overall brightness of the hard court material. Default is 0.6."), + ::anno::display_name("Ground Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 1.f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness_variation = 0.f [[ + ::anno::description("Breaks up the roughness pattern and makes it less uniform."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflectivity = 1.f [[ + ::anno::description("The overall reflectivity of the surface."), + ::anno::display_name("Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 3.f) + ]], + uniform float2 texture_translate = 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"), + ::anno::soft_range(0.f, 360.f) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0, 1.0)), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enabling creates the impression of rounded corners across hard edges. Comes at a slight performance cost as additional raytracing calls are required to evaluate the effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorners_radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 1.f) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("When enabled, the effect is across different materials, otherwise just the same material."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "red", "saturated", "warm")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::weighted_layer(1.f, ::df::custom_curve_layer(0.0350400023f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.722000062f, ::math::lerp(0.674000025f, 0.238000005f, reflectivity)), ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.600000024f, roughness)) + roughness_variation * 0.197000012f * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] - 0.108000003f)) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.600000024f, roughness)) + roughness_variation * 0.197000012f * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] - 0.108000003f)), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.600000024f, roughness)) + roughness_variation * 0.197000012f * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] - 0.108000003f)) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.600000024f, roughness)) + roughness_variation * 0.197000012f * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] - 0.108000003f)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(::nvidia::core_definitions::blend_colors(color(::math::pow(hsv2rgb(::math::lerp(float3(0.f, 0.f, 0.5f), float3(1.f, 0.800000012f, 0.899999976f), float3(ground_hue, ground_saturation, ground_brightness))), 2.20000005f)), infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_mono_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.63499999f), 1.99800014f, true) : color(::math::pow(::base::file_texture(texture_2d("./textures/hard_court_mono_diff.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 2.20000005f)), ::base::color_layer_multiply, 1.f).tint, color(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./textures/hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 2.20000005f)), ::base::color_layer_multiply, 0.f).tint, 0.f), infinite_tiling ? endless_normal(texture_2d("./textures/hard_court_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.497999996f, 0.50999999f, 0.92900002f), 1.99800014f) : normalmap_normal(texture_2d("./textures/hard_court_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/hard_court_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.497999996f, 0.50999999f, 0.92900002f), 1.99800014f) : normalmap_normal(texture_2d("./textures/hard_court_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(roundcorners_radius / 1000.f, roundcorners_across_materials, 1.f) : ::state::normal()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + +// 2 +export material Ground_Hard_Court_Red_Desaturated(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Red Desaturated"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Red_Desaturated.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "red", "warm")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.02f, + ground_saturation: 0.65f, + ground_brightness: 0.6f, + roughness: 1.0f, + roughness_variation:1.0f, + reflectivity: 1.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +//3 +export material Ground_Hard_Court_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Blue.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "blue", "cool", "saturated")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.589f, + ground_saturation: 0.9f, + ground_brightness: 0.5f, + roughness: 0.41f, + roughness_variation:1.0f, + reflectivity: 0.5f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +//4 +export material Ground_Hard_Court_Faded_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Faded Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Faded_Blue.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "blue", "cool", "desaturated")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.58f, + ground_saturation: 0.65f, + ground_brightness: 0.65f, + roughness: 1.0f, + roughness_variation:1.0f, + reflectivity: 1.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +//5 +export material Ground_Hard_Court_Light_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Light Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Light_Green.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "green", "light")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.3f, + ground_saturation: 0.68f, + ground_brightness: 0.623f, + roughness: 0.41f, + roughness_variation:0.0f, + reflectivity: 0.5f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 6 +export material Ground_Hard_Court_Dark_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Dark Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Dark_Green.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "green", "dark")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.3f, + ground_saturation: 0.8f, + ground_brightness: 0.0f, + roughness: 0.41f, + roughness_variation:0.0f, + reflectivity: 0.5f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +// 7 +export material Ground_Hard_Court_Olive_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Olive Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Olive_Green.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "green", "olive")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.22f, + ground_saturation: 0.495f, + ground_brightness: 0.25f, + roughness: 0.5f, + roughness_variation:0.0f, + reflectivity: 0.5f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + + + diff --git a/code/third_party/vMaterials_2/Ground/Ground_Leaves.mdl b/code/third_party/vMaterials_2/Ground/Ground_Leaves.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5bf9337d9fd66b77766e50af4bbf7511e21e4cf1 --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Ground_Leaves.mdl @@ -0,0 +1,1122 @@ +/***************************************************************************** +* Copyright 2024 NVIDIA Corporation. All rights reserved. +****************************************************************************** + + MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT, + WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR, + 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 ::nvidia::core_definitions::*; +import ::tex::*; +import ::state::*; + +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"; + +export material Ground_Leaves( + + /* Appearance */ + color hue_shift = color (0.0461, 0.349, 0.263 ) + [[ + ::anno::display_name ("Hue Shift"), + ::anno::description("Determine the color of the leaves."), + ::anno::in_group("Appearance") + ]], + uniform float blend_undercoat = 1.0f + [[ + ::anno::display_name("Leaf Saturation"), + ::anno::description("Makes the Hue Shift more saturated."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + uniform float reflection_roughness = 1.0 + [[ + ::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") + ]], + uniform float bump_strength = 1.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::soft_range(0.f, 2.f), + ::anno::in_group("Appearance") + ]], + /* Transform */ + 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."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], +/* Advanced */ + uniform float displacement_scale = 0.1f + [[ + ::anno::display_name("Displacement Scale"), + ::anno::description("Determine the amount of displacement. A displacement value of 0 turns off displacement."), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::in_group("Advanced"), + ::anno::hard_range(0, 3) + ]] +) + [[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Leaves - Forest Green"), + ::anno::description("A ground material covered with leaves."), + ::anno::thumbnail("./.thumbs/Ground_Leaves.Ground_Leaves.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("aec", "ground", "leaves", "nature", "multicolor", "soil", "foliage", "organic", "natural", "forest", "green")) + ]]= + ::nvidia::core_definitions::add_displacement( + base: ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_diff.jpg" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/leaves_grayscale_diff.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale , + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: hue_shift, + mode: ::base::color_layer_overlay, + weight: 1.0f).tint, + mode: ::base::color_layer_overlay, + weight: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: blend_undercoat * 2.0f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ao.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: 1.0f).tint, + diffuse_roughness: 0.0f, + is_metal: false, + reflectivity: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + reflection_roughness: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_rou.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: reflection_roughness, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + anisotropy: 0.0f, + anisotropy_rotation: 0.0f, + transparency: 0.0f, + transmission_color: color(1.0f, 1.0f, 1.0f), + volume_color: color(1.0f, 1.0f, 1.0f), + transmission_roughness: 0.0f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d("./textures/leaves_norm.png" , ::tex::gamma_linear), + factor: bump_strength, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index)), + displacement: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_dis.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.0f, + contrast: 1.0f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + displacement_scale: displacement_scale); + + +export material ground_leaves_green( + + /* Appearance */ + color hue_shift = color (0.00604f , 1.f , 0.f ) + [[ + ::anno::display_name ("Hue Shift"), + ::anno::description("Determine the color of the leaves."), + ::anno::in_group("Appearance") + ]], + uniform float blend_undercoat = 0.75f + [[ + ::anno::display_name("Leaf Saturation"), + ::anno::description("Makes the Hue Shift more saturated."), + ::anno::in_group("Appearance"), + ::anno::hard_range( 0 , 1) + ]], + uniform float reflection_roughness = 1.0 + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + /* Transform */ + 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."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + /* Advanced */ + uniform float displacement_scale = 0.1f + [[ + ::anno::display_name("Displacement Scale"), + ::anno::description("Determine the amount of displacement. A displacement value of 0 turns off displacement."), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::in_group("Advanced"), + ::anno::hard_range(0, 3) + ]] + ) + [[ + ::anno::display_name("Leaves - Green"), + ::anno::description("A ground material covered with leaves."), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Ground_Leaves.ground_leaves_green.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("aec", "ground", "leaves", "nature", "multicolor", "soil", "foliage", "organic", "natural", "forest", "green")) + ]]= + ::nvidia::core_definitions::add_displacement( + base: ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_diff.jpg" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/leaves_grayscale_diff.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale , + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: hue_shift, + mode: ::base::color_layer_overlay, + weight: 1.0f).tint, + mode: ::base::color_layer_overlay, + weight: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: blend_undercoat * 2.0f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ao.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: 1.0f).tint, + diffuse_roughness: 0.0f, + is_metal: false, + reflectivity: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + reflection_roughness: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_rou.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: reflection_roughness, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + anisotropy: 0.0f, + anisotropy_rotation: 0.0f, + transparency: 0.0f, + transmission_color: color(1.0f, 1.0f, 1.0f), + volume_color: color(1.0f, 1.0f, 1.0f), + transmission_roughness: 0.0f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d("./textures/leaves_norm.png" , ::tex::gamma_linear), + factor: bump_strength, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index)), + displacement: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_dis.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.0f, + contrast: 1.0f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + displacement_scale: displacement_scale); + + +export material ground_leaves_yellow( + + /* Appearance */ + color hue_shift = color (1.f , 0.883f , 0.0104f ) + [[ + ::anno::display_name ("Hue Shift"), + ::anno::description("Determine the color of the leaves."), + ::anno::in_group("Appearance") + ]], + uniform float blend_undercoat = 0.5f + [[ + ::anno::display_name("Leaf Saturation"), + ::anno::description("Makes the Hue Shift more saturated."), + ::anno::in_group("Appearance"), + ::anno::hard_range( 0 , 1) + ]], + uniform float reflection_roughness = 1.0 + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + /* Transform */ + 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."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + /* Advanced */ + uniform float displacement_scale = 0.1f + [[ + ::anno::display_name("Displacement Scale"), + ::anno::description("Determine the amount of displacement. A displacement value of 0 turns off displacement."), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::in_group("Advanced"), + ::anno::hard_range(0, 3) + ]] + ) + [[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Leaves - Forest Yellow"), + ::anno::description("A ground material covered with leaves."), + ::anno::thumbnail("./.thumbs/Ground_Leaves.ground_leaves_yellow.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("aec", "ground", "leaves", "nature", "multicolor", "soil", "foliage", "organic", "natural", "forest", "yellow")) + ]]= + ::nvidia::core_definitions::add_displacement( + base: ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_diff.jpg" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/leaves_grayscale_diff.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale , + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: hue_shift, + mode: ::base::color_layer_overlay, + weight: 1.0f).tint, + mode: ::base::color_layer_overlay, + weight: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: blend_undercoat * 2.0f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ao.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: 1.0f).tint, + diffuse_roughness: 0.0f, + is_metal: false, + reflectivity: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + reflection_roughness: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_rou.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: reflection_roughness, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + anisotropy: 0.0f, + anisotropy_rotation: 0.0f, + transparency: 0.0f, + transmission_color: color(1.0f, 1.0f, 1.0f), + volume_color: color(1.0f, 1.0f, 1.0f), + transmission_roughness: 0.0f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d("./textures/leaves_norm.png" , ::tex::gamma_linear), + factor: bump_strength, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index)), + displacement: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_dis.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.0f, + contrast: 1.0f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + displacement_scale: displacement_scale); + + +export material ground_leaves_orange( + + /* Appearance */ + color hue_shift = color (1.f, 0.267f, 0.0385f ) + [[ + ::anno::display_name ("Hue Shift"), + ::anno::description("Determine the color of the leaves."), + ::anno::in_group("Appearance") + ]], + uniform float blend_undercoat = 0.75f + [[ + ::anno::display_name("Leaf Saturation"), + ::anno::description("Makes the Hue Shift more saturated."), + ::anno::in_group("Appearance"), + ::anno::hard_range( 0 , 1) + ]], + uniform float reflection_roughness = 1.0 + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + /* Transform */ + 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."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + /* Advanced */ + uniform float displacement_scale = 0.1f + [[ + ::anno::display_name("Displacement Scale"), + ::anno::description("Determine the amount of displacement. A displacement value of 0 turns off displacement."), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::in_group("Advanced"), + ::anno::hard_range(0, 3) + ]] + ) + [[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Leaves - Orange"), + ::anno::description("A ground material covered with leaves."), + ::anno::thumbnail("./.thumbs/Ground_Leaves.ground_leaves_orange.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("aec", "ground", "leaves", "nature", "multicolor", "soil", "foliage", "organic", "natural", "forest", "orange", "brown")) + ]]= + ::nvidia::core_definitions::add_displacement( + base: ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_diff.jpg" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/leaves_grayscale_diff.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale , + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: hue_shift, + mode: ::base::color_layer_overlay, + weight: 1.0f).tint, + mode: ::base::color_layer_overlay, + weight: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: blend_undercoat * 2.0f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ao.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: 1.0f).tint, + diffuse_roughness: 0.0f, + is_metal: false, + reflectivity: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + reflection_roughness: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_rou.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: reflection_roughness, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + anisotropy: 0.0f, + anisotropy_rotation: 0.0f, + transparency: 0.0f, + transmission_color: color(1.0f, 1.0f, 1.0f), + volume_color: color(1.0f, 1.0f, 1.0f), + transmission_roughness: 0.0f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d("./textures/leaves_norm.png" , ::tex::gamma_linear), + factor: bump_strength, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index)), + displacement: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_dis.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.0f, + contrast: 1.0f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + displacement_scale: displacement_scale); + + +export material ground_leaves_red( + + /* Appearance */ + color hue_shift = color (0.459f , 0.0278f , 0.0278f) + [[ + ::anno::display_name ("Hue Shift"), + ::anno::description("Determine the color of the leaves."), + ::anno::in_group("Appearance") + ]], + uniform float blend_undercoat = 1.0f + [[ + ::anno::display_name("Leaf Saturation"), + ::anno::description("Makes the Hue Shift more saturated."), + ::anno::in_group("Appearance"), + ::anno::hard_range( 0 , 1) + ]], + uniform float reflection_roughness = 1.0 + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + /* Transform */ + 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."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + /* Advanced */ + uniform float displacement_scale = 0.1f + [[ + ::anno::display_name("Displacement Scale"), + ::anno::description("Determine the amount of displacement. A displacement value of 0 turns off displacement."), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::in_group("Advanced"), + ::anno::hard_range(0, 3) + ]] + ) + [[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Leaves - Red"), + ::anno::description("A ground material covered with leaves."), + ::anno::thumbnail("./.thumbs/Ground_Leaves.ground_leaves_red.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("aec", "ground", "leaves", "nature", "multicolor", "soil", "foliage", "organic", "natural", "forest", "red", "brown")) + ]]= + ::nvidia::core_definitions::add_displacement( + base: ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_diff.jpg" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/leaves_grayscale_diff.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale , + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: hue_shift, + mode: ::base::color_layer_overlay, + weight: 1.0f).tint, + mode: ::base::color_layer_overlay, + weight: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: blend_undercoat * 2.0f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ao.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: 1.0f).tint, + diffuse_roughness: 0.0f, + is_metal: false, + reflectivity: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + reflection_roughness: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_rou.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: reflection_roughness, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + anisotropy: 0.0f, + anisotropy_rotation: 0.0f, + transparency: 0.0f, + transmission_color: color(1.0f, 1.0f, 1.0f), + volume_color: color(1.0f, 1.0f, 1.0f), + transmission_roughness: 0.0f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d("./textures/leaves_norm.png" , ::tex::gamma_linear), + factor: bump_strength, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index)), + displacement: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_dis.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.0f, + contrast: 1.0f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + displacement_scale: displacement_scale); + +export material ground_leaves_blue( + + /* Appearance */ + color hue_shift = color (0.0104f, 0.136f, 0.828f) + [[ + ::anno::display_name ("Hue Shift"), + ::anno::description("Determine the color of the leaves."), + ::anno::in_group("Appearance") + ]], + uniform float blend_undercoat = 1.0f + [[ + ::anno::display_name("Leaf Saturation"), + ::anno::description("Makes the Hue Shift more saturated."), + ::anno::in_group("Appearance"), + ::anno::hard_range( 0 , 1) + ]], + uniform float reflection_roughness = 1.0 + [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 1.0 + [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::in_group("Appearance") + ]], + /* Transform */ + 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."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], +/* Advanced */ + uniform float displacement_scale = 0.1f + [[ + ::anno::display_name("Displacement Scale"), + ::anno::description("Determine the amount of displacement. A displacement value of 0 turns off displacement."), + ::anno::in_group("Advanced") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV space index."), + ::anno::in_group("Advanced"), + ::anno::hard_range(0, 3) + ]] + ) + [[ + ::anno::display_name("Leaves - Blue"), + ::anno::description("A ground material covered with leaves."), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Ground_Leaves.ground_leaves_blue.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("aec", "ground", "leaves", "nature", "multicolor", "soil", "foliage", "organic", "natural", "forest", "blue", "brown")) + ]]= + ::nvidia::core_definitions::add_displacement( + base: ::nvidia::core_definitions::flex_material_v2( + base_color: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_diff.jpg" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: ::nvidia::core_definitions::blend_colors( + color_1: ::nvidia::core_definitions::file_texture( + texture: texture_2d ( "./textures/leaves_grayscale_diff.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale , + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + color_2: hue_shift, + mode: ::base::color_layer_overlay, + weight: 1.0f).tint, + mode: ::base::color_layer_overlay, + weight: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: blend_undercoat * 2.0f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono).tint, + color_2: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ao.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).tint, + mode: ::base::color_layer_multiply, + weight: 1.0f).tint, + diffuse_roughness: 0.0f, + is_metal: false, + reflectivity: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_ref.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.f, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + reflection_roughness: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_rou.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: reflection_roughness, + contrast: 1.f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + anisotropy: 0.0f, + anisotropy_rotation: 0.0f, + transparency: 0.0f, + transmission_color: color(1.0f, 1.0f, 1.0f), + volume_color: color(1.0f, 1.0f, 1.0f), + transmission_roughness: 0.0f, + base_thickness: 0.1f, + ior: 1.5f, + thin_walled: false, + normal: ::nvidia::core_definitions::normalmap_texture( + texture: texture_2d("./textures/leaves_norm.png" , ::tex::gamma_linear), + factor: bump_strength, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index)), + displacement: ::nvidia::core_definitions::file_texture( + texture: texture_2d("./textures/leaves_dis.png" , ::tex::gamma_srgb), + mono_source: ::base::mono_average, + brightness: 1.0f, + contrast: 1.0f, + scaling: 1.f / texture_scale, + translation: texture_translate, + rotation: texture_rotate, + clip: false, + texture_space: uv_space_index, + invert: false).mono, + displacement_scale: displacement_scale); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Ground/Ground_Leaves_Oak.mdl b/code/third_party/vMaterials_2/Ground/Ground_Leaves_Oak.mdl new file mode 100644 index 0000000000000000000000000000000000000000..00e91dd55268e3280e5e5706d63c4420800c180a --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Ground_Leaves_Oak.mdl @@ -0,0 +1,375 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + + +export material Ground_Leaves_Oak( + uniform bool infinite_tiling = false [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float brightness = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.5f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Rougness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflectivity = 0.5f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float2 texture_translate = 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("Rotation angle of the texture in degrees."), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(2.0f, 2.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 0.f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = true [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Leaves Oak"), + ::anno::description("A ground material of fallen leaves."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Leaves_Oak.Ground_Leaves_Oak.png"), + ::anno::key_words(string[]("ground", "oak", "leaves", "exterior", "nature", "soil", "organic", "brown")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.78700006f, ::math::lerp(0.75f, 0.529999971f, reflectivity)), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.605000019f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.605000019f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.605000019f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.605000019f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/ground_leaves_oak_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.651000023f, 0.423999995f, 0.226999998f), 3.f, true) : ::base::file_texture(texture_2d("./textures/ground_leaves_oak_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.699999988f, 0.200000003f, brightness)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/ground_leaves_oak_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.5f, 0.5f, 1.f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/ground_leaves_oak_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/ground_leaves_oak_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.5f, 0.5f, 1.f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/ground_leaves_oak_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Ground_Leaves_Oak_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Leaves Oak - Shiny"), + ::anno::description("A ground material of fallen leaves."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Leaves_Oak.Ground_Leaves_Oak_Shiny.png"), + ::anno::key_words(string[]("ground", "oak", "leaves", "exterior", "nature", "soil", "shiny", "organic", "brown")) +]] = Ground_Leaves_Oak( + infinite_tiling: false, + brightness: 0.5f, + roughness: 0.0f, + reflectivity: 0.25f, + texture_translate: 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/Ground/Large_Granite_Paving.mdl b/code/third_party/vMaterials_2/Ground/Large_Granite_Paving.mdl new file mode 100644 index 0000000000000000000000000000000000000000..dcf80e6c1da37a28b2f846e97af09d2c96a628a3 --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Large_Granite_Paving.mdl @@ -0,0 +1,142 @@ +/***************************************************************************** +* Copyright 2024 NVIDIA Corporation. All rights reserved. +****************************************************************************** + + MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT, + WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR, + 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 ::tex::*; +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"; + +float remap(float input, float low, float high) +{ + return low + input * (high - low); +} + +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 remap(input, low, high); +} + +export material Large_Granite_Paving( + float roughness = 0.59f [[ + ::anno::display_name("Roughness"), + ::anno::description("Adjusts the overall roughness of the surface."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float roughness_variation = 0.46f [[ + ::anno::display_name("Roughness Variation"), + ::anno::description("Low values will result in a more uniform reflection, high value will add more variation."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + uniform float stones_brightness = 0.5f [[ + ::anno::display_name("Brightness"), + ::anno::description("Adjustment to make the material darker/brighter."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + + // Adjustments Group + uniform float2 texture_translate = float2(0.f) [[ + ::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.f) [[ + ::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("Exquisit Paving"), + ::anno::description("A paving material of a european boardwalk."), + ::anno::key_words(string[]("stone", "pavement", "tile", "paving", "architecture", "new", "gray", "cool")), + ::anno::thumbnail("./.thumbs/Large_Granite_Paving.Large_Granite_Paving.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = false; + + float2 corrected_scale = 1.0f / texture_scale; + + material_surface tmp1( + ::df::custom_curve_layer(0.0430000015f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, ::math::lerp(0.426000029f, 1.f, roughness_variation), ::math::lerp(0.355000019f, 0.66f, roughness)), 0.898000062f, ::base::file_texture(texture_2d("./textures/Large_Granite_Paving_mask.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(histogram_range(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, ::math::lerp(0.426000029f, 1.f, roughness_variation), ::math::lerp(0.355000019f, 0.621000051f, roughness)), 0.898000062f, ::base::file_texture(texture_2d("./textures/Large_Granite_Paving_mask.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(histogram_range(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, ::math::lerp(0.426000029f, 1.f, roughness_variation), ::math::lerp(0.355000019f, 0.621000051f, roughness)), 0.898000062f, ::base::file_texture(texture_2d("./textures/Large_Granite_Paving_mask.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(histogram_range(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, ::math::lerp(0.426000029f, 1.f, roughness_variation), ::math::lerp(0.355000019f, 0.621000051f, roughness)), 0.898000062f, ::base::file_texture(texture_2d("./textures/Large_Granite_Paving_mask.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(::math::lerp(0.3f, 0.65200001f, stones_brightness)), ::base::mono_alpha, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).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, + ::base::tangent_space_normal_texture(texture_2d("./textures/Large_Granite_Paving_norm.jpg", ::tex::gamma_linear), 1.f, false, true, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material large_granite_paving_shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Exquisit Paving - Shiny"), + ::anno::description("A paving material of a european boardwalk with a shiny appearance."), + ::anno::key_words(string[]("stone", "pavement", "tile", "paving", "architecture", "construction", "new", "gray", "cool")), + ::anno::thumbnail("./.thumbs/Large_Granite_Paving.large_granite_paving_shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Large_Granite_Paving( + roughness: 0.0f, + roughness_variation: 1.0f, + stones_brightness: 0.3f, + texture_translate: float2(0.f, 0.f), + texture_rotate: 0.0f, + texture_scale: float2(1.f, 1.f) +); diff --git a/code/third_party/vMaterials_2/Ground/Mulch.mdl b/code/third_party/vMaterials_2/Ground/Mulch.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c723a0828c23e5a3a2306bad91439722423dd0d4 --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Mulch.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 ::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 mulch material"; + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ ::anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + 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); +} + +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 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 Mulch( + uniform bool infinite_tiling = false [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float brightness = 1.0f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.8f [[ + ::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 reflectivity = 0.0f [[ + ::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) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + 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(2.0f, 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 = 0.f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = true [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + 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::display_name("Mulch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "tiling", "wood", "nature", "tree", "bark", "mulch", "brown", "organic", "ground", "exterior", "rough", "plant", "gardening", "autumn")), + ::anno::thumbnail("./.thumbs/Mulch.Mulch.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.617999971f, 0.880999982f, 0.499000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.800000012f, ::math::lerp(0.400000006f, 0.600000024f, reflectivity)), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.617999971f, 0.880999982f, 0.499000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.449999988f, 0.789999962f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.617999971f, 0.880999982f, 0.499000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.449999988f, 0.789999962f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.617999971f, 0.880999982f, 0.499000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.449999988f, 0.789999962f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.617999971f, 0.880999982f, 0.499000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.449999988f, 0.789999962f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/mulch_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.568000019f, 0.404000014f, 0.293000013f), 8.f, true) : ::base::file_texture(texture_2d("./textures/mulch_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(histogram_range(0.099999994f, 1.f, float3(infinite_tiling ? endless_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.617999971f, 0.880999982f, 0.499000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/mulch_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::base::color_layer_multiply, ::math::lerp(1.f, 0.f, brightness)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/mulch_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.497999996f, 0.465999991f, 0.878000021f), 8.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/mulch_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/mulch_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.497999996f, 0.465999991f, 0.878000021f), 8.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/mulch_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_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 Mulch_Dry(*) +[[ + ::anno::display_name("Mulch - Dry"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "tiling", "wood", "nature", "tree", "bark", "mulch", "brown", "organic", "ground", "exterior", "rough", "plant", "gardening", "autumn", "dry")), + ::anno::thumbnail("./.thumbs/Mulch.Mulch_Dry.png"), + ::anno::author("NVIDIA vMaterials") +]] += Mulch +( + infinite_tiling: false, + brightness: 0.7f, + roughness: 0.8f, + reflectivity: 0.4f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Mulch_Dry_Contrast(*) +[[ + ::anno::display_name("Mulch - Dry Contrast"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "tiling", "wood", "nature", "tree", "bark", "mulch", "brown", "organic", "ground", "exterior", "rough", "plant", "gardening", "autumn", "dry", "contrast")), + ::anno::thumbnail("./.thumbs/Mulch.Mulch_Dry_Contrast.png"), + ::anno::author("NVIDIA vMaterials") +]] += Mulch +( + infinite_tiling: false, + brightness: 0.15f, + roughness: 1.0f, + reflectivity: 0.9f, + bump_strength: 0.8f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Mulch_Mist_Damp(*) +[[ + ::anno::display_name("Mulch - Mist Damp"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "tiling", "wood", "nature", "tree", "bark", "mulch", "brown", "organic", "ground", "exterior", "rough", "plant", "gardening", "autumn", "mist", "damp")), + ::anno::thumbnail("./.thumbs/Mulch.Mulch_Mist_Damp.png"), + ::anno::author("NVIDIA vMaterials") +]] += Mulch +( + infinite_tiling: false, + brightness: 0.0f, + roughness: 0.15f, + reflectivity: 0.9f, + bump_strength: 0.75f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Mulch_Wet(*) +[[ + ::anno::display_name("Mulch - Wet"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "tiling", "wood", "nature", "tree", "bark", "mulch", "brown", "organic", "ground", "exterior", "rough", "plant", "gardening", "autumn", "wet")), + ::anno::thumbnail("./.thumbs/Mulch.Mulch_Wet.png"), + ::anno::author("NVIDIA vMaterials") +]] += Mulch +( + infinite_tiling: false, + brightness: 0.0f, + roughness: 0.0f, + reflectivity: 0.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Mulch_Sun(*) +[[ + ::anno::display_name("Mulch - Sun"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "tiling", "wood", "nature", "tree", "bark", "mulch", "brown", "organic", "ground", "exterior", "rough", "plant", "gardening", "autumn", "bright", "sun")), + ::anno::thumbnail("./.thumbs/Mulch.Mulch_Sun.png"), + ::anno::author("NVIDIA vMaterials") +]] += Mulch +( + infinite_tiling: false, + brightness: 0.8f, + roughness: 0.0f, + reflectivity: 0.7f, + bump_strength: 0.7f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Ground/Paving_Stones.mdl b/code/third_party/vMaterials_2/Ground/Paving_Stones.mdl new file mode 100644 index 0000000000000000000000000000000000000000..59a1f1c6b43028f198fccd8e87330bf51940e46e --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Paving_Stones.mdl @@ -0,0 +1,341 @@ +/****************************************************************************** + * 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 ground 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); +} + +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 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 1 + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization + */ + + // 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)); +} +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 Paving_Stones( + float brightness = 1.f [[ + ::anno::description("Adjusts the general brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float bricks_roughness = 1.f [[ + ::anno::description("Adjusts the roughness of the paving blocks."), + ::anno::display_name("Paving Blocks Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float water_height = 0.f [[ + ::anno::description("Raise the level of water surrounding the bricks."), + ::anno::display_name("Water Level"), + ::anno::in_group("Appearance", "Water"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float water_transition_softness = 0.f [[ + ::anno::description("Adjusts the softness of the transition from dry material to water. A softer transition will show areas, where the material gets moist first before being submerged in water."), + ::anno::display_name("Water Transition Softness"), + ::anno::in_group("Appearance", "Water"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump, lowering this value males the surface appear flat."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = float2(0.5f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(2.f, 2.f)), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Bright Dry Paving Stones"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "rock", "grey")), + ::anno::thumbnail("./.thumbs/Paving_Stones.Paving_Stones.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::lerp(1.f, ::histogram_scan_big(::math::pow(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 3.30900025f), 0.971000075f, 0.506000042f), ::math::smoothstep(water_height * 0.800000012f - (water_transition_softness * 0.440000027f + 0.00999999978f), water_height * 0.800000012f + (water_transition_softness * 0.440000027f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::df::microfacet_ggx_vcavities_bsdf(::math::lerp(0.f, ::math::lerp(::histogram_range(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), ::histogram_range(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.694000006f + 0.306000024f), ::base::file_texture(texture_2d("./textures/paving_stones_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(water_height * 0.800000012f - (water_transition_softness * 0.440000027f + 0.00999999978f), water_height * 0.800000012f + (water_transition_softness * 0.440000027f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])) * ::math::lerp(0.f, ::math::lerp(::histogram_range(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), ::histogram_range(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.694000006f + 0.306000024f), ::base::file_texture(texture_2d("./textures/paving_stones_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(water_height * 0.800000012f - (water_transition_softness * 0.440000027f + 0.00999999978f), water_height * 0.800000012f + (water_transition_softness * 0.440000027f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::math::lerp(0.f, ::math::lerp(::histogram_range(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), ::histogram_range(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.694000006f + 0.306000024f), ::base::file_texture(texture_2d("./textures/paving_stones_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(water_height * 0.800000012f - (water_transition_softness * 0.440000027f + 0.00999999978f), water_height * 0.800000012f + (water_transition_softness * 0.440000027f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])) * ::math::lerp(0.f, ::math::lerp(::histogram_range(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), ::histogram_range(float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.694000006f + 0.306000024f), ::base::file_texture(texture_2d("./textures/paving_stones_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(water_height * 0.800000012f - (water_transition_softness * 0.440000027f + 0.00999999978f), water_height * 0.800000012f + (water_transition_softness * 0.440000027f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/paving_stones_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), ::math::lerp(color(0.507079005f, 0.507079005f, 0.507079005f), color(1.f, 1.f, 1.f), ::math::smoothstep(water_height * 0.800000012f - (water_transition_softness * 0.440000027f + 0.00999999978f), water_height * 0.800000012f + (water_transition_softness * 0.440000027f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.5f, .5f, brightness)).tint, color(0.284646988f, 0.245784f, 0.231759995f), ::base::color_layer_screen, ::math::smoothstep(water_height * 0.800000012f - (water_transition_softness * 0.440000027f + 0.00999999978f), water_height * 0.800000012f + (water_transition_softness * 0.440000027f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (1.f - ::base::file_texture(texture_2d("./textures/paving_stones_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * 0.248000011f).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_geometry tmp5(float3(0.f), 1.f, ::normalmap_normal(texture_2d("./textures/paving_stones_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, bump_strength, ::math::smoothstep(water_height * 0.800000012f - (water_transition_softness * 0.440000027f + 0.00999999978f), water_height * 0.800000012f + (water_transition_softness * 0.440000027f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Bright_Shiny_Paving_Stones(*) +[[ + ::anno::display_name("Bright Shiny Paving Stones"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "rock")), + ::anno::thumbnail("./.thumbs/Paving_Stones.Bright_Shiny_Paving_Stones.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Paving_Stones +( + brightness: 0.3f, + bricks_roughness: 0.f, + water_height: 0.f, + water_transition_softness: 0.f, + bump_strength: 1.f, + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Wet_Grouts_Paving_Stones(*) +[[ + ::anno::display_name("Wet Grouts Paving Stones"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "wet", "grouts", "paving", "level")), + ::anno::thumbnail("./.thumbs/Paving_Stones.Wet_Grouts_Paving_Stones.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Paving_Stones +( + brightness: 0.f, + bricks_roughness: .8f, + water_height: 0.6f, + water_transition_softness: 0.0f, + bump_strength: 1.f, + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Wet_Paving_Stones(*) +[[ + ::anno::display_name("Wet Paving Stones"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "wet", "paving", "level")), + ::anno::thumbnail("./.thumbs/Paving_Stones.Wet_Paving_Stones.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Paving_Stones +( + brightness: 0.3f, + bricks_roughness: .8f, + water_height: 0.85f, + water_transition_softness: 0.8f, + bump_strength: 1.f, + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Wet_Spots_Paving_Stones(*) +[[ + ::anno::display_name("Wet Spots Paving Stones"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "spots", "wet", "paving", "level")), + ::anno::thumbnail("./.thumbs/Paving_Stones.Wet_Spots_Paving_Stones.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Paving_Stones +( + brightness: 0.f, + bricks_roughness: .0f, + water_height: 0.45f, + water_transition_softness: 0.3f, + bump_strength: 1.f, + 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/Ground/Rough_Gravel.mdl b/code/third_party/vMaterials_2/Ground/Rough_Gravel.mdl new file mode 100644 index 0000000000000000000000000000000000000000..babd6ab9dfea9829f2020fbf9ae24b1f2d4cc07f --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Rough_Gravel.mdl @@ -0,0 +1,139 @@ +/****************************************************************************** + * 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 ::state::*; +import ::tex::*; +import ::math::*; +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, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +export material Rough_Gravel( + float diffuse_brightness = 1.f [[ + ::anno::display_name("Diffuse Brightness"), + ::anno::description("Adjust the overall brightness of the texture."), + ::anno::hard_range(0.f, 1.f), + ::anno::usage("") + ]], + uniform float bump_factor = 1.f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Factor") + ]], + + // Adjustments Group + uniform float2 texture_translate = float2(0.0f) + [[ + ::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(2.0f) + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.2f, 1.2f)), + ::anno::in_group("Transform") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Rough Gravel"), + ::anno::description("A floor material of rough an uneven gravel and dust."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Rough_Gravel.Rough_Gravel.png"), + ::anno::key_words(string[]("gravel", "pebbles", "ground", "outdoor", "construction", "gray")) +]] + = + let { + + uniform texture_2d DIFFTEX = texture_2d("./textures/rough_gravel_diff.jpg", ::tex::gamma_srgb); + uniform texture_2d NORMTEX = texture_2d("./textures/rough_gravel_norm.jpg", ::tex::gamma_linear); + uniform texture_2d ROUGHTEX = texture_2d("./textures/rough_gravel_rough.jpg", ::tex::gamma_linear); + + ::base::texture_coordinate_info UVW = ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.0, 0.0, texture_rotate/180.*::math::PI ), float3(texture_translate.x, texture_translate.y, 0.f), float3(texture_scale.x, texture_scale.y, 1.0)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))); + + float hist_position = 0.9f; + + float tt = histogram_range(::base::file_texture(ROUGHTEX, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, UVW, float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 1.f, hist_position); + + + material_surface tmp1( + ::df::custom_curve_layer(0.04f, 1.f, 3.31f, 0.3f, ::df::microfacet_ggx_smith_bsdf(tt * tt, tt * tt, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::base::file_texture(DIFFTEX, color(0.f, 0.f, 0.f), color(diffuse_brightness), ::base::mono_alpha, UVW, float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, 0.600000024f, ""), ::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, + ::base::tangent_space_normal_texture(NORMTEX, bump_factor, false, true, UVW, float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)); + } in + material( + thin_walled: false, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); diff --git a/code/third_party/vMaterials_2/Ground/Small_Cobblestone.mdl b/code/third_party/vMaterials_2/Ground/Small_Cobblestone.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f409360186bfa91850a00328181f7b95928d68cf --- /dev/null +++ b/code/third_party/vMaterials_2/Ground/Small_Cobblestone.mdl @@ -0,0 +1,335 @@ +/****************************************************************************** + * 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 ground stone 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); +} + +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 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)); +} + +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 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 Small_Cobblestone( + float brightness = .65f [[ + ::anno::description("Adjusts the general brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float bricks_roughness = .8f [[ + ::anno::description("Adjusts the roughness of the paving blocks."), + ::anno::display_name("Paving Blocks Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float water_height = 0.f [[ + ::anno::description("Raise the level of water surrounding the bricks."), + ::anno::display_name("Water Level"), + ::anno::in_group("Appearance", "Water"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float water_transition_softness = 0.f [[ + ::anno::description("Adjusts the softness of the transition from dry material to water. A softer transition will show areas, where the material gets moist first before being submerged in water."), + ::anno::display_name("Water Transition Softness"), + ::anno::in_group("Appearance", "Water"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump, lowering this value males the surface appear flat."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + 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(.3f, .3f)), + ::anno::ui_order(7) + ]], + uniform int uv_space_index_1 = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(8) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Small Cobblestone"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "cobblestone", "small", "rock", "yellow", "brown", "grey")), + ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::lerp(1.f, histogram_scan_big(::math::pow(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 3.30900025f), 0.971000075f, 0.506000042f), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::df::microfacet_ggx_vcavities_bsdf(::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.519999981f + 0.479999989f), ::base::file_texture(texture_2d("./textures/cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])) * ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.519999981f + 0.479999989f), ::base::file_texture(texture_2d("./textures/cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.519999981f + 0.479999989f), ::base::file_texture(texture_2d("./textures/cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])) * ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.519999981f + 0.479999989f), ::base::file_texture(texture_2d("./textures/cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/cobblestone_tiny_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), ::math::lerp(color(0.507079005f, 0.507079005f, 0.507079005f), color(1.f, 1.f, 1.f), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.620000005f, -0.239999995f, brightness)).tint, color(0.284646988f, 0.245784f, 0.231759995f), ::base::color_layer_screen, ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (1.f - ::base::file_texture(texture_2d("./textures/cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * 0.f).tint, 0.f), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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, normalmap_normal(texture_2d("./textures/cobblestone_tiny_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, bump_strength * 2.f, ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./textures/cobblestone_tiny_multi.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + + +export material Small_Cobblestone_Bright(*) +[[ + ::anno::display_name("Small Cobblestone Bright"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level" , "cobblestone", "small", "rock", "yellow", "brown", "grey")), + ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone_Bright.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Small_Cobblestone +( + brightness: 1.f, + bricks_roughness: .2f, + water_height: 0.f, + water_transition_softness: 0.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index_1: 0 +); + +export material Small_Cobblestone_Wet_Grouts(*) +[[ + ::anno::display_name("Small Cobblestone Wet Grouts"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "wet", "grouts", "cobblestone", "small", "rock", "yellow", "brown", "grey")), + ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone_Wet_Grouts.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Small_Cobblestone +( + brightness: 1.f, + bricks_roughness: .2f, + water_height: .35f, + water_transition_softness: 0.f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index_1: 0 +); + +export material Small_Cobblestone_Flooded_Grouts(*) +[[ + ::anno::display_name("Small Cobblestones Flooded Grouts"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "wet", "grouts", "cobblestone", "flooded", "small", "rock", "yellow", "brown", "grey")), + ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone_Flooded_Grouts.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Small_Cobblestone +( + brightness: 1.f, + bricks_roughness: .2f, + water_height: .75f, + water_transition_softness: 0.2f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index_1: 0 +); + +export material Small_Cobblestone_Water_Flooded(*) +[[ + ::anno::display_name("Small Cobblestone Water Flooded"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "wet", "grouts", "cobblestone", "flooded", "water", "small", "rock", "yellow", "brown", "grey")), + ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone_Water_Flooded.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Small_Cobblestone +( + brightness: 1.f, + bricks_roughness: 0.f, + water_height: 1.f, + water_transition_softness: 0.3f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + uv_space_index_1: 0 +); diff --git a/code/third_party/vMaterials_2/Leather/ABS_Hard_Leather.mdl b/code/third_party/vMaterials_2/Leather/ABS_Hard_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ba570b0893f075fdf0d708c88be9b66ebd7be0e0 --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/ABS_Hard_Leather.mdl @@ -0,0 +1,1648 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A synthetic leather material."; +const string DESCRIPTION_PUNCHED = "A synthetic leather material with punched holes. Available punch shapes are circles, lines, rectangles and squares."; + +annotation preview_scale( float f); + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Chose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=float2(0.5f) +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += float2(0.5f); + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + return ::math::lerp(low, high, input); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 + //bool srgb2rgb = false, + //bool rgb2srgb = false +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(transformed_tangent_u * tangent_space_normal.x + + transformed_tangent_v * tangent_space_normal.y + + state::normal()*1.0); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} +export material ABS_Hard_Leather( + uniform bool infinite_tiling = false [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color leather_color = color(0.02f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Leather Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float brightness_ao_cavity = 0.2f [[ + ::anno::description("Adjusts the lightness of the cavity."), + ::anno::display_name("Cavity Brightness"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = .6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float reflectivity = 1.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 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)), + ::preview_scale(3.0f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "design", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + + texture_2d rough_height_ao_tex = texture_2d("./textures/abs_hard_leather_multi_R_rough_G_height_B_ao.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/abs_hard_leather_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1], 0.389999986f, math::lerp(0.f, 0.560000002f, math::pow(reflectivity, 0.349999994f))), 1.49000001f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.300000012f, math::lerp(0.300000012f, 0.859999955f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.300000012f, math::lerp(0.300000012f, 0.859999955f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.300000012f, math::lerp(0.300000012f, 0.859999955f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.300000012f, math::lerp(0.300000012f, 0.859999955f, roughness)), color(1.f, 1.f, 1.f), nvidia::core_definitions::blend_colors(leather_color, color(histogram_range(0.100000001f, 0.289999992f, float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(brightness_ao_cavity, 0.f, 20.f)), true).tint, state::texture_tangent_u(0), df::scatter_reflect), df::weighted_layer(1.f, df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(leather_color, color(histogram_range(0.100000001f, 0.289999992f, float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(brightness_ao_cavity, 0.f, 20.f)), true).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.505882025f, 0.494118005f, 0.92156899f), 13.f) : base::tangent_space_normal_texture(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), infinite_tiling ? endless_normal(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.505882025f, 0.494118005f, 0.92156899f), 13.f) : base::tangent_space_normal_texture(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? state::rounded_corner_normal(radius, across_materials, 1.f) : state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material ABS_Hard_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "brown", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0718f, 0.0316f, 0.001f), + brightness_ao_cavity: .3f, + roughness: .5f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Grey(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Grey"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "grey", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Grey.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.06f), + brightness_ao_cavity: .2f, + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Peach(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Peach"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "warm", "peach", "orange")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Peach.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.274677f, 0.078187f, 0.004777f), + brightness_ao_cavity: .2f, + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Vintage_Rose(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Rose Vintage"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "vintage", "hard", "leather", "car", "dashboard", "cloth", "furniture", "warm", "rose")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Vintage_Rose.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.135633f, 0.059511f, 0.059511f), + brightness_ao_cavity: .2f, + roughness: .25f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Moss(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Moss"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "green", "moss")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Moss.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0546f, 0.0582f, 0.00775f), + brightness_ao_cavity: .2f, + roughness: .4f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Sky(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Sky"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "blue", "sky", "baby")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Sky.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.042311f, 0.116971f, 0.187821f), + brightness_ao_cavity: .2f, + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Turquoise(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Pop Turquoise"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "pop", "turquoise", "blue")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Turquoise.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0399f, 0.448f, 0.364f), + brightness_ao_cavity: .1f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Pink(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Pop Pink"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "pop", "pink")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Pink.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.567f, 0.0494f, 0.216f), + brightness_ao_cavity: .1f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Lime(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Pop Lime"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "pop", "lime", "green")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Lime.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.254152f, 0.533276f, 0.042311f), + brightness_ao_cavity: .1f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Ocean(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Deep Ocean"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "ocean", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Ocean.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0097f, 0.0316f, 0.128f), + brightness_ao_cavity: .1f, + roughness: .3f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Green(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Deep Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "green", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Green.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0179f, 0.0738f, 0.0478f), + brightness_ao_cavity: .1f, + roughness: .2f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Violet(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Deep Violet"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "violet", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Violet.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.043f, 0.00902f, 0.142f), + brightness_ao_cavity: .1f, + roughness: .5f, + reflectivity: .3f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + + + +// ----------------- Punched Leather ----------------- +export material ABS_Hard_Leather_Punched( + +// Leather parameters + uniform bool infinite_tiling = false [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color leather_color = color(0.012983f, 0.012983f, 0.012983f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Leather Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float roughness = .6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float reflectivity = 1.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(10) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(11) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(13) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(15) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(16) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(17) + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(18) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("enable_round_corners==true"), + ::anno::ui_order(19) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("enable_round_corners==true"), + ::anno::ui_order(20) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "design", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = let +{ + float brightness_ao_cavity = 0.2f; + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = ABS_Hard_Leather( + infinite_tiling: infinite_tiling, + leather_color: leather_color, + brightness_ao_cavity: brightness_ao_cavity, + roughness: roughness, + reflectivity: reflectivity, + bump_strength: bump_strength, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./textures/leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + volume: base_mat.volume, + ior: base_mat.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base_mat.geometry.displacement, + normal: final_normal, + cutout_opacity: cutout + ) +); + + + +export material ABS_Hard_Leather_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "brown", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Brown_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = ABS_Hard_Leather_Punched( + infinite_tiling: false, + leather_color: color(0.0718f, 0.0316f, 0.001f), + roughness: .5f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Grey_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Grey Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "grey", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Grey_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.06f), + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Peach_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Peach Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "warm", "peach", "orange")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Peach_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.274677f, 0.078187f, 0.004777f), + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Vintage_Rose_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Rose Vintage Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "vintage", "hard", "leather", "car", "dashboard", "cloth", "furniture", "warm", "rose")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Vintage_Rose_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.135633f, 0.059511f, 0.059511f), + roughness: .25f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Moss_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Moss Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "green", "moss")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Moss_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0546f, 0.0582f, 0.00775f), + roughness: .4f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Sky_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Sky Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "blue", "sky", "baby")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Sky_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.042311f, 0.116971f, 0.187821f), + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Turquoise_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Pop Turquoise Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "pop", "turquoise", "blue")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Turquoise_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0399f, 0.448f, 0.364f), + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Pink_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Pop Pink Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "pop", "pink")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Pink_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.567f, 0.0494f, 0.216f), + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Lime_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Pop Lime Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "pop", "lime", "green")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Lime_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.254152f, 0.533276f, 0.042311f), + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Ocean_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Deep Ocean Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "ocean", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Ocean_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0097f, 0.0316f, 0.128f), + roughness: .3f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Green_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Deep Green Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "green", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Green_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0179f, 0.0738f, 0.0478f), + roughness: .2f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Violet_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Deep Violet Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "violet", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Violet_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.043f, 0.00902f, 0.142f), + roughness: .5f, + reflectivity: .3f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + + diff --git a/code/third_party/vMaterials_2/Leather/ABS_Quilted_Leather.mdl b/code/third_party/vMaterials_2/Leather/ABS_Quilted_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c20a8daa4f23a0d4c90c0790f4260a40bb92a36b --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/ABS_Quilted_Leather.mdl @@ -0,0 +1,620 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A synthetic leather material."; + + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + return ::math::lerp(low, high, input); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +export material ABS_Quilted_Leather( + color leather_color = color(0.366253f, 0.226966f, 0.012983f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Leather Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color seam_color = color(0.238398f, 0.097587f, 0.029557f) [[ + ::anno::description("Choose the color of the seam."), + ::anno::display_name("Seam Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float brightness_ao_cavity = 0.45f [[ + ::anno::description("Adjusts the lightness of the cavity."), + ::anno::display_name("Cavity Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = .25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float roughness_variation = .1f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = .5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 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 enable_round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Mustard"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "mustard", "soft", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_big(float3(endless_texture(texture_2d("./textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.698038995f, 0.815685987f, 0.686275005f), 3.f, false))[0], 1.f, math::lerp(0.f, 0.729999959f, math::pow(roughness_variation, 0.289999992f))), 1.49000001f), df::microfacet_ggx_smith_bsdf(nvidia::core_definitions::blend_colors(color(float3(base::file_texture(texture_2d("./textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2]), color(histogram_range(math::lerp(1.f, 0.f, float3(base::file_texture(texture_2d("./textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1]), 0.769999981f, math::lerp(0.400000006f, 0.969999969f, roughness))), base::color_layer_add, 1.f, true).mono, nvidia::core_definitions::blend_colors(color(float3(base::file_texture(texture_2d("./textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2]), color(histogram_range(math::lerp(1.f, 0.f, float3(base::file_texture(texture_2d("./textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1]), 0.769999981f, math::lerp(0.400000006f, 0.969999969f, roughness))), base::color_layer_add, 1.f, true).mono, 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(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(leather_color, color(histogram_range(0.140000001f, 1.f, float3(base::file_texture(texture_2d("./textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(math::pow(brightness_ao_cavity, 3.f), 0.f, 10.f)), true).tint, nvidia::core_definitions::blend_colors(color(histogram_range(float3(base::file_texture(texture_2d("./textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2], 1.f, 0.469999999f)), seam_color, base::color_layer_multiply, 1.f, true).tint, base::color_layer_blend, float3(base::file_texture(texture_2d("./textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2], false).tint, 0.f), bsdf(), base::tangent_space_normal_texture(texture_2d("./textures/abs_quilted_leather_norm.jpg", ::tex::gamma_linear), math::lerp(0.f, 1.89999998f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), base::tangent_space_normal_texture(texture_2d("./textures/abs_quilted_leather_norm.jpg", ::tex::gamma_linear), math::lerp(0.f, 1.89999998f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? state::rounded_corner_normal(radius, across_materials, 1.f) : state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material ABS_Quilted_Leather_Radish(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Radish"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "radish", "dark", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Radish.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.027321f, 0.004777f, 0.012983f), + seam_color: color(0.034340f, 0.076185f, 0.034340f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Quilted_Leather_Purple(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Purple"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "purple", "dark", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Purple.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.025187f, 0.004777f, 0.027321f), + seam_color: color(0.034340f, 0.076185f, 0.034340f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Quilted_Leather_Dark_Purple(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Dark Purple"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "purple", "dark", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Dark_Purple.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.010960f, 0.004777f, 0.026241f), + seam_color: color(0.034340f, 0.076185f, 0.034340f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Quilted_Leather_Dark_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Dark Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "blue", "cool", "dark", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Dark_Blue.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.004777f, 0.009721f, 0.027321f), + seam_color: color(0.715694f, 0.610496f, 0.004025f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Quilted_Leather_Dark_Turquoise(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Dark Turquoise"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "turquoise", "cool", "dark", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Dark_Turquoise.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.004777f, 0.019382f, 0.027321f), + seam_color: color(0.337164f, 0.262251f, 0.012983f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Quilted_Leather_Moss(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Moss"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "moss", "cool", "dark", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Moss.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.017642f, 0.027321f, 0.004777f), + seam_color: color(0.337164f, 0.099899f, 0.012983f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Quilted_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "brown", "warm", "dark", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.026241f, 0.012983f, 0.012983f), + seam_color: color(0.012983f, 0.012983f, 0.012983f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Quilted_Leather_Black(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "black", "dark", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Black.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.012983f, 0.012983f, 0.012983f), + seam_color: color(0.564712f, 0.552011f, 0.361307f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Quilted_Leather_Red(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Quilted Leather - Red"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "quilted", "artifical", "red", "warm", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Red.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Quilted_Leather +( + leather_color: color(0.201556f, 0.012983f, 0.012983f), + seam_color: color(0.791298f, 0.693872f, 0.012983f), + brightness_ao_cavity: .45f, + roughness: .25f, + roughness_variation: .1f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Leather/ABS_Soft_Leather.mdl b/code/third_party/vMaterials_2/Leather/ABS_Soft_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9915e4c7b27cb38db63066dc4d81fba1abe1487e --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/ABS_Soft_Leather.mdl @@ -0,0 +1,1645 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A synthetic leather material."; +const string DESCRIPTION_PUNCHED = "A synthetic leather material with punched holes. Available punch shapes are circles, lines, rectangles and squares."; + +annotation preview_scale( float f); + + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Choose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=float2(0.5f) +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += float2(0.5f); + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + return ::math::lerp(low, high, input); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 + //bool srgb2rgb = false, + //bool rgb2srgb = false +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(transformed_tangent_u * tangent_space_normal.x + + transformed_tangent_v * tangent_space_normal.y + + state::normal()*1.0); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} +export material ABS_Soft_Leather( + uniform bool infinite_tiling = false [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color color_2 = color( 0.012983f, 0.012983f, 0.012983f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float brightness_ao_cavity = 0.2f [[ + ::anno::description("Adjusts the lightness of the cavity."), + ::anno::display_name("Cavity Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = .6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float reflectivity = 1.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "black", "soft", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + + texture_2d rough_height_ao_tex = texture_2d("./textures/abs_soft_leather_multi_R_rough_G_height_B_ao.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/abs_soft_leather_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_big(nvidia::core_definitions::blend_colors(color(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1]), color(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2]), base::color_layer_blend, 0.600000024f, true).mono, 1.f, math::lerp(0.f, 0.550000012f, math::pow(reflectivity, 0.349999994f))), 1.49000001f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.269999981f, math::lerp(0.300000012f, 1.f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.269999981f, math::lerp(0.300000012f, 1.f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.269999981f, math::lerp(0.300000012f, 1.f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.269999981f, math::lerp(0.300000012f, 1.f, roughness)), color(1.f, 1.f, 1.f), nvidia::core_definitions::blend_colors(color_2, color(histogram_range(0.100000001f, 0.289999992f, float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(brightness_ao_cavity, 0.f, 10.f)), true).tint, state::texture_tangent_u(0), df::scatter_reflect), df::weighted_layer(1.f, df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_2, color(histogram_range(0.100000001f, 0.289999992f, float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(brightness_ao_cavity, 0.f, 10.f)), true).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(norm_tex, math::lerp(0.f, 2.f, bump_strength), true, true, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.501960993f, 0.501960993f, 0.972549021f), 13.f) : base::tangent_space_normal_texture(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), infinite_tiling ? endless_normal(norm_tex, math::lerp(0.f, 2.f, bump_strength), true, true, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.501960993f, 0.501960993f, 0.972549021f), 13.f) : base::tangent_space_normal_texture(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? state::rounded_corner_normal(radius, across_materials, 1.f) : state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material ABS_Soft_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "warm", "brown")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.106f, 0.0528f, 0.021f), + brightness_ao_cavity: .3f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Ash(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Ash"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "ash", "gray", "grey", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Ash.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.099899f, 0.099899f, 0.099899f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Bone(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Bone"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "bone", "brown", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Bone.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.599f, 0.511f, 0.431f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Salmon(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Salmon"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "salmon", "warm", "red")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Salmon.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.632f, 0.216f, 0.184f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Cognac(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Cognac"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "warm", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "brown", "red", "cognac", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Cognac.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.231f, 0.0461f, 0.0356f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Beige(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Beige"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "warm", "brown", "beige")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Beige.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.205079f, 0.132868f, 0.064803f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Orange(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Pop Orange"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "warm", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "orange", "light", "gaudy", "saturated")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Orange.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.659f, 0.114f, 0.022f), + brightness_ao_cavity: .2f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Purple(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Pop Purple"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "purple", "violet", "bright", "gaudy")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Purple.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.201f, 0.017f, 0.659f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Grapefruit(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Pop Grapefruit"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "grapefruit", "bright", "gaudy", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Grapefruit.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.646f, 0.0582f, 0.037f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Deep Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "blue", "dark", "intense")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Blue.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.021f, 0.037f, 0.32f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Mint(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Deep Mint"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "mint", "green", "dark", "intense")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Mint.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.0161f, 0.122f, 0.0478f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Radish(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Deep Radish"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "radish", "red", "dark", "intense", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Radish.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.16f, 0.0127f, 0.0254f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: .25f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +// ----------------- Punched Leather ----------------- +export material ABS_Soft_Leather_Punched( + +// Leather parameters + uniform bool infinite_tiling = false [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color leather_color = color( 0.012983f, 0.012983f, 0.012983f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Leather Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float roughness = .6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float reflectivity = 1.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(4) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(9) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(10) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(11) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(13) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(14) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(15) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(16) + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(17) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("enable_round_corners==true"), + ::anno::ui_order(18) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("enable_round_corners==true"), + ::anno::ui_order(19) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "design", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = let +{ + float brightness_ao_cavity = 0.2f; + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = ABS_Soft_Leather( + infinite_tiling: infinite_tiling, + color_2: leather_color, + brightness_ao_cavity: brightness_ao_cavity, + roughness: roughness, + reflectivity: reflectivity, + bump_strength: bump_strength, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./textures/leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + volume: base_mat.volume, + ior: base_mat.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base_mat.geometry.displacement, + normal: final_normal, + cutout_opacity: cutout + ) +); + + +export material ABS_Soft_Leather_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "warm","artifical", "brown", "soft", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Brown_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.106f, 0.0528f, 0.021f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Ash_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Ash Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "ash", "gray", "grey", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Ash_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.099899f, 0.099899f, 0.099899f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Bone_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Bone Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "bone", "brown", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Bone_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.599f, 0.511f, 0.431f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Salmon_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Salmon Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "salmon", "warm", "red")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Salmon_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.632f, 0.216f, 0.184f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Cognac_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Cognac Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "warm", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "brown", "red", "cognac", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Cognac_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.231f, 0.0461f, 0.0356f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Beige_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Beige Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "warm", "brown", "beige")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Beige_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.205079f, 0.132868f, 0.064803f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Orange_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Pop Orange Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "warm", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "orange", "light", "gaudy", "saturated")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Orange_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.659f, 0.114f, 0.022f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Purple_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Pop Purple Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "purple", "violet", "bright", "gaudy")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Purple_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.201f, 0.017f, 0.659f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Grapefruit_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Pop Grapefruit Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "grapefruit", "bright", "gaudy", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Grapefruit_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.646f, 0.0582f, 0.037f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Blue_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Deep Blue Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "blue", "dark", "intense")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Blue_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.021f, 0.037f, 0.32f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Mint_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Deep Mint Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "mint", "green", "dark", "intense")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Mint_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0161f, 0.122f, 0.0478f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Radish_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Deep Radish Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "radish", "red", "dark", "intense", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Radish.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.16f, 0.0127f, 0.0254f), + roughness: 0.f, + reflectivity: .25f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + diff --git a/code/third_party/vMaterials_2/Leather/ABS_Woven_Leather.mdl b/code/third_party/vMaterials_2/Leather/ABS_Woven_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..29cdccfa75f47ec278e67c464815cdc161276925 --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/ABS_Woven_Leather.mdl @@ -0,0 +1,764 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A synthetic leather material."; + +annotation preview_scale( float f); + + + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +::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); + //Hack: try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +export material ABS_Woven_Leather( + color leather_color = color(0.012983f, 0.012983f, 0.012983f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Leather Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float brightness_ao_cavity = 0.35f [[ + ::anno::description("Adjusts the lightness of the cavity."), + ::anno::display_name("Cavity Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness = 1.f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float reflectivity = 0.3f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + uniform float bump_strength = 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) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(2.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], + 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(9) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + 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(11) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Dark Woven Velvety"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "velvety", "ABS", "artifical", "black", "soft", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Woven_Leather.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_big(float3(endless_texture(texture_2d("./textures/abs_woven_leather_multi_R_rough_G_grunge_B_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.200000003f, base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.698038995f, 0.815685987f, 0.686275005f), 3.f, false))[1], 1.f, math::lerp(0.f, 0.669999957f, math::pow(reflectivity, 0.48999998f))), 1.49000001f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(base::file_texture(texture_2d("./textures/abs_woven_leather_multi_R_rough_G_grunge_B_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 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)[0], 0.300000012f, math::lerp(0.469999999f, 0.979999959f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/abs_woven_leather_multi_R_rough_G_grunge_B_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 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)[0], 0.300000012f, math::lerp(0.469999999f, 0.979999959f, roughness)), histogram_range(float3(base::file_texture(texture_2d("./textures/abs_woven_leather_multi_R_rough_G_grunge_B_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 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)[0], 0.300000012f, math::lerp(0.469999999f, 0.979999959f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/abs_woven_leather_multi_R_rough_G_grunge_B_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 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)[0], 0.300000012f, math::lerp(0.469999999f, 0.979999959f, roughness)), color(1.f, 1.f, 1.f), nvidia::core_definitions::blend_colors(leather_color, color(histogram_range(0.229999989f, 1.f, float3(base::file_texture(texture_2d("./textures/abs_woven_leather_multi_R_rough_G_grunge_B_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 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)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, math::pow(brightness_ao_cavity, 1.5f)), true).tint, state::texture_tangent_u(0), df::scatter_reflect), df::weighted_layer(1.f, df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(leather_color, color(histogram_range(0.229999989f, 1.f, float3(base::file_texture(texture_2d("./textures/abs_woven_leather_multi_R_rough_G_grunge_B_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 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)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, math::pow(brightness_ao_cavity, 1.5f)), true).tint, 0.f), bsdf(), base::tangent_space_normal_texture(texture_2d("./textures/abs_woven_leather_norm.jpg", ::tex::gamma_linear), math::lerp(0.f, 1.68999994f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 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, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), base::tangent_space_normal_texture(texture_2d("./textures/abs_woven_leather_norm.jpg", ::tex::gamma_linear), math::lerp(0.f, 1.68999994f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 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, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? state::rounded_corner_normal(radius, across_materials, 1.f) : state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material ABS_Velvety_Woven_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Brown Woven Velvety"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "brown", "soft", "woven", "leather", "car", "dashboard", "cloth", "velvety", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Velvety_Woven_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.090842f, 0.038204f, 0.012983f), + brightness_ao_cavity: .6f, + roughness: 1.f, + reflectivity: .2f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Spotty_Woven_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Brown Woven Spotty"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "brown", "soft", "woven", "leather", "car", "dashboard", "cloth", "spotty", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Spotty_Woven_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.090842f, 0.038204f, 0.012983f), + brightness_ao_cavity: .3f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Woven_Leather_Dark(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Dark Woven"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "dark", "soft", "woven", "leather", "car", "dashboard", "cloth", "velvety", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Dark.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.012983f, 0.012983f, 0.012983f), + brightness_ao_cavity: 0.f, + roughness: .5f, + reflectivity: 0.f, + bump_strength: .4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Woven_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Brown Woven Soft"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "brown", "soft", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.090842f, 0.038204f, 0.012983f), + brightness_ao_cavity: .6f, + roughness: .5f, + reflectivity: 0.f, + bump_strength: .4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Woven_Leather_Ash(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Ash Woven Soft"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "ash", "grey", "soft", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Ash.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.127438f, 0.127438f, 0.127438f), + brightness_ao_cavity: .6f, + roughness: .6f, + reflectivity: .0f, + bump_strength: .4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Spotty_Woven_Leather_Ash(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Ash Woven Spotty"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "ash", "grey", "soft", "spotty", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Spotty_Woven_Leather_Ash.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.127438f, 0.127438f, 0.127438f), + brightness_ao_cavity: .3f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Spotty_Woven_Leather_Dark(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Dark Woven Spotty"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "dark", "black", "soft", "spotty", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Spotty_Woven_Leather_Dark.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.012983f, 0.012983f, 0.012983f), + brightness_ao_cavity: .3f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Puffy_Woven_Leather_Dark(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Dark Woven Puffy"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "puffy", "woven", "leather", "car", "dashboard", "cloth", "furniture", "dark", "black")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Puffy_Woven_Leather_Dark.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.012983f, 0.012983f, 0.012983f), + brightness_ao_cavity: 1.f, + roughness: .0f, + reflectivity: .1f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Puffy_Woven_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Brown Woven Puffy"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "puffy", "woven", "leather", "car", "dashboard", "cloth", "furniture", "brown")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Puffy_Woven_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.090842f, 0.038204f, 0.012983f), + brightness_ao_cavity: .55f, + roughness: .0f, + reflectivity: .2f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Puffy_Woven_Leather_Ash(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Ash Woven Puffy"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "ash","grey", "soft", "puffy", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Puffy_Woven_Leather_Ash.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.127438f, 0.127438f, 0.127438f), + brightness_ao_cavity: .55f, + roughness: .0f, + reflectivity: .3f, + bump_strength: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Woven_Leather_Baby_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Baby Blue Woven Soft "), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "baby", "blue", "cold", "soft", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Baby_Blue.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.194618f, 0.309469f, 0.456411f), + brightness_ao_cavity: 1.f, + roughness: 0.f, + reflectivity: .6f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Woven_Leather_Mint(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Mint Woven Soft"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "green", "mint", "cold", "soft", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Mint.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.194618f, 0.456411f, 0.242281f), + brightness_ao_cavity: 1.f, + roughness: 0.f, + reflectivity: .5f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Woven_Leather_Sand(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Sand Woven Soft"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "sand", "beige", "warm", "soft", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Sand.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.456411f, 0.407240f, 0.194618f), + brightness_ao_cavity: 1.f, + roughness: 0.f, + reflectivity: .6f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Woven_Leather_Lavender(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Lavender Woven Soft"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "purple", "violet", "lavender", "cold", "soft", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Lavender.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.230740f, 0.194618f, 0.456411f), + brightness_ao_cavity: 1.f, + roughness: 0.f, + reflectivity: .3f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Woven_Leather_Salmon(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Leather - Salmon Woven Soft"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "salmon", "pink", "warm", "soft", "woven", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Salmon.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Woven_Leather +( + leather_color: color(0.456411f, 0.194618f, 0.194618f), + brightness_ao_cavity: 1.f, + roughness: 0.f, + reflectivity: .5f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Leather/Aniline_Leather.mdl b/code/third_party/vMaterials_2/Leather/Aniline_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..91a2bb879fea3ba5639cce179585a097d29fd456 --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/Aniline_Leather.mdl @@ -0,0 +1,1610 @@ +/****************************************************************************** + * 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 = "An aniline leather material"; +const string DESCRIPTION_PUNCHED = "An aniline leather material with punched holes. Various shapes for the punching such as circles, lines, rectangles and squares can be chosen."; + +annotation preview_scale( float f); + + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Choose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=float2(0.5f) +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += float2(0.5f); + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + + +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) ); + +} +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 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); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + + + +float3 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 1 + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization + */ + + // 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 Aniline_Leather( + 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 bump_strength = 0.7f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.089194f, 0.038473f, 0.011126f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_grunge = 0.005f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_dust = 0.0923f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_smudges = 0.4f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back = color(0.075926f, 0.032876f, 0.009696f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.65f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = false [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023104f, 0.023104f, 0.023104f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Dirt Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float dirt_softness = 0.9f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float position_dirt = 0.35f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::in_group("Transform") + ]], +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather.png") +]] + = + let { + float2 texture_scale_rescaled = texture_scale / 10.0f; + bool tmp0 = true; + + texture_2d front_albedo_tex = texture_2d("./textures/aniline_front_albedo.jpg", ::tex::gamma_linear); + texture_2d front_normal_tex = texture_2d("./textures/aniline_front_normal.jpg", ::tex::gamma_linear); + texture_2d multi_tex = texture_2d("./textures/aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear); + texture_2d multi_tex2 = texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear); + texture_2d back_multi_tex = texture_2d("./textures/aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear); + texture_2d back_albedo_tex = texture_2d("./textures/aniline_back_albedo.jpg", ::tex::gamma_linear); + texture_2d back_normal_tex = texture_2d("./textures/aniline_back_normal.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, position_dirt) - dirt_softness, ::math::lerp(1.f, 0.f, position_dirt) + dirt_softness, float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.601999998f, 0.393999994f, 0.83099997f), 8.5f, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.601999998f, 0.393999994f, 0.83099997f), 8.5f, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.660000026f), ::df::microfacet_ggx_smith_bsdf(((float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.601999998f, 0.393999994f, 0.83099997f), 8.5f, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.419999987f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.601999998f, 0.393999994f, 0.83099997f), 8.5f, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.419999987f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges), ((float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.601999998f, 0.393999994f, 0.83099997f), 8.5f, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.419999987f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.601999998f, 0.393999994f, 0.83099997f), 8.5f, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.419999987f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(multi_tex2, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(multi_tex2, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_front, (infinite_tiling ? endless_texture(front_albedo_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.560000002f, 0.559000015f, 0.52700001f), 8.5f, false) : ::base::file_texture(front_albedo_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.25f, 4.f, diffuse_brightness_front)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.601999998f, 0.393999994f, 0.83099997f), 8.5f, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.796000063f, 0.784000039f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(front_normal_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.421000004f, 0.455000013f, 0.984000027f), 8.5f) : normalmap_normal(front_normal_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(front_normal_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.421000004f, 0.455000013f, 0.984000027f), 8.5f) : normalmap_normal(front_normal_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2(dirt_back_on_off ? ::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, position_dirt) - dirt_softness, ::math::lerp(1.f, 0.f, position_dirt) + dirt_softness, float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.601999998f, 0.393999994f, 0.83099997f), 8.5f, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back, (infinite_tiling ? endless_texture(back_albedo_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.564999998f, 0.569000006f, 0.556999981f), 8.5f, false) : ::base::file_texture(back_albedo_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.100000001f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_normal_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.488000005f, 0.486999989f, 0.998000026f), 8.5f) : normalmap_normal(back_normal_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_normal_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.488000005f, 0.486999989f, 0.998000026f), 8.5f) : normalmap_normal(back_normal_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()) : ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back, (infinite_tiling ? endless_texture(back_albedo_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.564999998f, 0.569000006f, 0.556999981f), 8.5f, false) : ::base::file_texture(back_albedo_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.100000001f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(back_multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.852999985f, 0.893999994f, 0.647000015f), 8.5f, false) : ::base::file_texture(back_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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_normal_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.488000005f, 0.486999989f, 0.998000026f), 8.5f) : normalmap_normal(back_normal_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_normal_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.5f, float3(0.488000005f, 0.486999989f, 0.998000026f), 8.5f) : normalmap_normal(back_normal_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Aniline_Leather_Black(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "shiny", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "black", "dark", "neutral")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Black.png") +]] += Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.009021f, 0.009021f ,0.009021f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.0f, + imperfection_grunge: 0.005f, + imperfection_dust: 0.923f, + imperfection_smudges: 0.4f, + color_back: color(0.034230f,0.034230f,0.034230f), + diffuse_brightness_back: 0.22f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.18f, 0.18f, 0.18f), + dirt_softness: 0.9f, + position_dirt: 0.35f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Aniline_Leather_Shiny_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Brown Shiny"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "shiny", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Shiny_Brown.png") +]] += Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.29f, 0.161f ,0.098f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.0f, + imperfection_grunge: 0.005f, + imperfection_dust: 0.923f, + imperfection_smudges: 0.4f, + color_back: color(0.541f,0.275f,0.204f), + diffuse_brightness_back: 0.22f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.18f, 0.18f, 0.18f), + dirt_softness: 0.9f, + position_dirt: 0.35f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Aniline_Leather_Soft_Light_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Light Brown Soft"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "soft", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "light", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Soft_Light_Brown.png") +]] += Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.29f, 0.161f ,0.098f), + diffuse_brightness_front: 0.75f, + reflection_roughness_front: 0.36f, + imperfection_grunge: 0.064f, + imperfection_dust: 0.158f, + imperfection_smudges: 0.178f, + color_back: color(0.729f,0.588f,0.463f), + diffuse_brightness_back: 0.3f, + reflection_roughness_back: 1.0f, + dirt_back_on_off: true, + dirt_color: color(0.180f, 0.180f, 0.180f), + dirt_softness: 0.8f, + position_dirt: 0.21f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Aniline_Leather_Spotted_Yellow(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Yellow Spotted"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "spotted", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "yellow", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Spotted_Yellow.png") +]] += Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.598f, 0.293f ,0.003f), + diffuse_brightness_front: 0.125f, + reflection_roughness_front: 0.089f, + imperfection_grunge: 0.124f, + imperfection_dust: 0.218f, + imperfection_smudges: 0.4f, + color_back: color(0.891f,0.459f,0.089f), + diffuse_brightness_back: 0.45f, + reflection_roughness_back: 0.614f, + dirt_back_on_off: true, + dirt_color: color(0.415f, 0.111f, 0.016f), + dirt_softness: 0.75f, + position_dirt: 0.6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Aniline_Leather_Grunge(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Brown Grunge"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "grunge", "dirt", "infinite", "tiling", "used", "natural", "bumped", "interior", "cloth", "soft", "aniline", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Grunge.png") +]] += Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.065f, 0.017f ,0.006f), + diffuse_brightness_front: 0.566f, + reflection_roughness_front: 0.25f, + imperfection_grunge: 0.412f, + imperfection_dust: 0.856f, + imperfection_smudges: 0.929f, + color_back: color(0.523f,0.447f,0.415f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.071f, 0.031f, 0.004f), + dirt_softness: 0.654f, + position_dirt: 0.648f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Aniline_Leather_Cognac_Red(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Cognac Red"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "dirt", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "cognac", "red", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Cognac_Red.png") +]] += Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.091f, 0.011f ,0.006f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.089f, + imperfection_grunge: 0.126f, + imperfection_dust: 0.379f, + imperfection_smudges: 0.753f, + color_back: color(0.242f,0.032f,0.016f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.614f, + dirt_back_on_off: true, + dirt_color: color(0.415f, 0.111f, 0.016f), + dirt_softness: 0.9f, + position_dirt: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Aniline_Leather_Dark_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Dark Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "brown", "warm", "dark")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Dark_Brown.png") +]] += Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.0582f, 0.02f, 0.0127f), + diffuse_brightness_front: 0.11f, + reflection_roughness_front: 0.104f, + imperfection_grunge: 0.054f, + imperfection_dust: 0.104f, + imperfection_smudges: 0.218f, + color_back: color(0.042f,0.028f,0.028f), + diffuse_brightness_back: 0.418f, + reflection_roughness_back: 0.45f, + dirt_back_on_off: true, + dirt_color: color(0.183f, 0.173f, 0.160f), + dirt_softness: 0.922f, + position_dirt: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + + +// ----------------- Punched Leather ----------------- +export material Aniline_Leather_Punched( + +// Leather 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(0) + ]], + float bump_strength = 0.7f [[ + ::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(1) + ]], + color color_front = color(0.089194f, 0.038473f, 0.011126f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::ui_order(2) + ]], + float diffuse_brightness_front = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float reflection_roughness_front = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float imperfection_grunge = 0.005f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float imperfection_dust = 0.0923f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float imperfection_smudges = 0.4f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + color color_back = color(0.075926f, 0.032876f, 0.009696f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::ui_order(8) + ]], + float diffuse_brightness_back = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + float reflection_roughness_back = 0.65f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + uniform bool dirt_back_on_off = false [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::ui_order(11) + ]], + color dirt_color = color(0.023104f, 0.023104f, 0.023104f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Dirt Color"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::ui_order(12) + ]], + float dirt_softness = 0.9f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(13) + ]], + float position_dirt = 0.35f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::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(5), + ::anno::ui_order(15) + ]], + 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) + ]], + 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)), + ::preview_scale(3.5f), + ::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("Transform"), + ::anno::ui_order(18) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(19) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(20) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(21) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(22) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(23) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(24) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(25) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(26) + ]], + +// Round Corners + uniform bool 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(27) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(28) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(29) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Aniline Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline")), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = let +{ + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = Aniline_Leather( + infinite_tiling: infinite_tiling, + bump_strength: bump_strength, + color_front: color_front, + diffuse_brightness_front: diffuse_brightness_front, + reflection_roughness_front: reflection_roughness_front, + imperfection_grunge: imperfection_grunge, + imperfection_dust: imperfection_dust, + imperfection_smudges: imperfection_smudges, + color_back: color_back, + diffuse_brightness_back: diffuse_brightness_back, + reflection_roughness_back: reflection_roughness_back, + dirt_back_on_off: dirt_back_on_off, + dirt_color: dirt_color, + dirt_softness: dirt_softness, + position_dirt: position_dirt, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + round_corners: round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./textures/leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + backface: material_surface( + scattering: base_mat.backface.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 Aniline_Leather_Black_Punched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "shiny", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "black", "dark", "neutral")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Black_Punched.png") +]] += Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.009021f, 0.009021f ,0.009021f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.0f, + imperfection_grunge: 0.005f, + imperfection_dust: 0.923f, + imperfection_smudges: 0.4f, + color_back: color(0.034230f,0.034230f,0.034230f), + diffuse_brightness_back: 0.22f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.18f, 0.18f, 0.18f), + dirt_softness: 0.9f, + position_dirt: 0.35f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + + +export material Aniline_Leather_Shiny_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Shiny Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "shiny", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Shiny_Brown_Punched.png") +]] += Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.29f, 0.161f ,0.098f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.0f, + imperfection_grunge: 0.005f, + imperfection_dust: 0.923f, + imperfection_smudges: 0.4f, + color_back: color(0.541f,0.275f,0.204f), + diffuse_brightness_back: 0.22f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.18f, 0.18f, 0.18f), + dirt_softness: 0.9f, + position_dirt: 0.35f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Aniline_Leather_Soft_Light_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Soft Light Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "soft", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "light", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Soft_Light_Brown_Punched.png") +]] += Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.29f, 0.161f ,0.098f), + diffuse_brightness_front: 0.75f, + reflection_roughness_front: 0.36f, + imperfection_grunge: 0.064f, + imperfection_dust: 0.158f, + imperfection_smudges: 0.178f, + color_back: color(0.729f,0.588f,0.463f), + diffuse_brightness_back: 0.3f, + reflection_roughness_back: 1.0f, + dirt_back_on_off: true, + dirt_color: color(0.180f, 0.180f, 0.180f), + dirt_softness: 0.8f, + position_dirt: 0.21f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Aniline_Leather_Spotted_Yellow_Punched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Yellow Punched Spotted"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "spotted", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "yellow", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Spotted_Yellow_Punched.png") +]] += Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.598f, 0.293f ,0.003f), + diffuse_brightness_front: 0.125f, + reflection_roughness_front: 0.089f, + imperfection_grunge: 0.124f, + imperfection_dust: 0.218f, + imperfection_smudges: 0.4f, + color_back: color(0.891f,0.459f,0.089f), + diffuse_brightness_back: 0.45f, + reflection_roughness_back: 0.614f, + dirt_back_on_off: true, + dirt_color: color(0.415f, 0.111f, 0.016f), + dirt_softness: 0.75f, + position_dirt: 0.6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + + +export material Aniline_Leather_Grunge_Punched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Brown Punched Grunge"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "grunge", "punched", "dirt", "infinite", "tiling", "used", "natural", "bumped", "interior", "cloth", "soft", "aniline", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Grunge_Punched.png") +]] += Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.065f, 0.017f ,0.006f), + diffuse_brightness_front: 0.566f, + reflection_roughness_front: 0.25f, + imperfection_grunge: 0.412f, + imperfection_dust: 0.856f, + imperfection_smudges: 0.929f, + color_back: color(0.523f,0.447f,0.415f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.071f, 0.031f, 0.004f), + dirt_softness: 0.654f, + position_dirt: 0.648f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Aniline_Leather_Cognac_Red_Punched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Cognac Red Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "dirt", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "cognac", "red", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Cognac_Red_Punched.png") +]] += Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.091f, 0.011f ,0.006f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.089f, + imperfection_grunge: 0.126f, + imperfection_dust: 0.379f, + imperfection_smudges: 0.753f, + color_back: color(0.242f,0.032f,0.016f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.614f, + dirt_back_on_off: true, + dirt_color: color(0.415f, 0.111f, 0.016f), + dirt_softness: 0.9f, + position_dirt: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Aniline_Leather_Dark_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aniline Leather - Dark Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "punched", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "brown", "warm", "dark")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Aniline_Leather.Aniline_Leather_Dark_Brown_Punched.png") +]] += Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.0582f, 0.02f, 0.0127f), + diffuse_brightness_front: 0.11f, + reflection_roughness_front: 0.104f, + imperfection_grunge: 0.054f, + imperfection_dust: 0.104f, + imperfection_smudges: 0.218f, + color_back: color(0.042f,0.028f,0.028f), + diffuse_brightness_back: 0.418f, + reflection_roughness_back: 0.45f, + dirt_back_on_off: true, + dirt_color: color(0.183f, 0.173f, 0.160f), + dirt_softness: 0.922f, + position_dirt: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Leather/PU_Split_Leather.mdl b/code/third_party/vMaterials_2/Leather/PU_Split_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..26c9199b33227257c3b247722ab63a282e101354 --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/PU_Split_Leather.mdl @@ -0,0 +1,1735 @@ +/****************************************************************************** + * 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 PU split leather material."; +const string DESCRIPTION_PUNCHED = "A PU split leather material with punched holes. Various shapes for the punching such as circles, lines, rectangles and squares can be chosen."; + +annotation preview_scale( float f); + + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Choose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=float2(0.5f) +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += float2(0.5f); + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + + +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) ); + +} +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 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); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + + + +float3 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)); +} + + +::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 PU_Split_Leather( + 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 bump_strength = 0.55f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.106156f, 0.065754f, 0.016988f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.83f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.34f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_dust = 0.7f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_grunge = 0.2f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_smudges = 0.5f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back = color(0.130352f, 0.078057f, 0.026549f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.43f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.8f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = true [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023f, 0.023f, 0.023f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float dirt_softness = 0.8f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_amount = 0.25f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::in_group("Transform") + ]], + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "pu", "split", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather.png") +]] + = + let { + float2 texture_scale_rescaled = texture_scale / 8.0f; + bool tmp0 = true; + + texture_2d rough_dirt_height_tex = texture_2d("./textures/PU_split_leather_front_multi_rough_dirt_height.jpg", ::tex::gamma_linear); + texture_2d dust_grunge_leather_tex = texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear); + texture_2d front_diff_lin_tex = texture_2d("./textures/PU_split_leather_front_diff.jpg", ::tex::gamma_linear); + texture_2d front_diff_srgb_tex = texture_2d("./textures/PU_split_leather_front_diff.jpg", ::tex::gamma_srgb); + texture_2d front_norm_tex = texture_2d("./textures/PU_split_leather_front_norm.jpg", ::tex::gamma_linear); + texture_2d back_rough_ao_height_tex = texture_2d("./textures/PU_split_leather_back_multi_rough_ao_height.jpg", ::tex::gamma_linear); + texture_2d back_diff_lin_tex = texture_2d("./textures/PU_split_leather_back_diff.jpg", ::tex::gamma_linear); + texture_2d back_diff_srgb_tex = texture_2d("./textures/PU_split_leather_back_diff.jpg", ::tex::gamma_srgb); + texture_2d back_norm_tex = texture_2d("./textures/PU_split_leather_back_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, dirt_amount) - dirt_softness, ::math::lerp(1.f, 0.f, dirt_amount) + dirt_softness, float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.707000017f, 0.388999999f, 0.765999973f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.707000017f, 0.388999999f, 0.765999973f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.5f, 0.479999989f), ::df::microfacet_ggx_smith_bsdf(((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.707000017f, 0.388999999f, 0.765999973f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.225000009f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.707000017f, 0.388999999f, 0.765999973f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.225000009f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges), ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.707000017f, 0.388999999f, 0.765999973f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.225000009f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.707000017f, 0.388999999f, 0.765999973f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.225000009f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_front, (infinite_tiling ? endless_texture(front_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.479999989f), 8.f, true) : ::base::file_texture(front_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 3.f, diffuse_brightness_front)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.707000017f, 0.388999999f, 0.765999973f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.796000063f, 0.784000039f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 3.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 3.f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 3.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 3.f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2(dirt_back_on_off ? ::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, dirt_amount) - dirt_softness, ::math::lerp(1.f, 0.f, dirt_amount) + dirt_softness, float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.707000017f, 0.388999999f, 0.765999973f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.433999985f), 8.f, true) : ::base::file_texture(back_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.518000007f, 0.469999999f, 0.995000005f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 3.f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.518000007f, 0.469999999f, 0.995000005f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 3.f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()) : ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.433999985f), 8.f, true) : ::base::file_texture(back_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.755999982f, 0.893000007f, 0.646000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.518000007f, 0.469999999f, 0.995000005f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 3.f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.518000007f, 0.469999999f, 0.995000005f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 3.f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material PU_Split_Leather_Black(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "dark", "black", "neutral")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Black.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: 0.55f, + color_front: color(0.009021f, 0.009021f, 0.009021f), + diffuse_brightness_front: 0.35f, + reflection_roughness_front: 0.187f, + imperfection_dust: 0.313f, + imperfection_grunge: 0.153f, + imperfection_smudges: 0.133f, + color_back: color(0.034230f, 0.034230f, 0.034230f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.55f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + dirt_softness: 0.8f, + dirt_amount: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material PU_Split_Leather_Dark_Green(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Dark Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "dark", "green", "cool", "cold")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Dark_Green.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.032876f, 0.039947f ,0.024223f), + diffuse_brightness_front: 0.35f, + reflection_roughness_front: 0.187f, + imperfection_dust: 0.313f, + imperfection_grunge: 0.153f, + imperfection_smudges: 0.133f, + color_back: color(0.348865f,0.399293f,0.280124f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.55f, + dirt_back_on_off: true, + dirt_color: color(0.011126f, 0.013473f, 0.011126f), + dirt_softness: 0.8f, + dirt_amount: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material PU_Split_Leather_Red(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Red"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "red", "saturated", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Red.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.293216f, 0.012664f ,0.011126f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.25f, + imperfection_dust: 0.06f, + imperfection_grunge: 0.151f, + imperfection_smudges: 0.913f, + color_back: color(0.605484f,0.315763f,0.334458f), + diffuse_brightness_back: 0.1f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.592438f, 0.067725f, 0.098689f), + dirt_softness: 0.639f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material PU_Split_Leather_Purple(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Purple"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "purple", "cool", "cold")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Purple.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.075926f, 0.049433f ,0.133209f), + diffuse_brightness_front: 0.35f, + reflection_roughness_front: 0.093f, + imperfection_dust: 0.06f, + imperfection_grunge: 0.22f, + imperfection_smudges: 0.673f, + color_back: color(0.031551f,0.041452f,0.069727f), + diffuse_brightness_back: 0.33f, + reflection_roughness_back: 0.6f, + dirt_back_on_off: true, + dirt_color: color(0.035614f, 0.067725f, 0.084642f), + dirt_softness: 0.639f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material PU_Split_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Dark Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "warm", "soft", "brown")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Brown.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.069727f, 0.031551f ,0.011126f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.1f, + imperfection_dust: 0.233f, + imperfection_grunge: 0.3f, + imperfection_smudges: 0.847f, + color_back: color(0.219520f,0.183549f,0.124741f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.6f, + dirt_back_on_off: true, + dirt_color: color(0.047776f, 0.022013f, 0.009021f), + dirt_softness: 0.8f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material PU_Split_Leather_Beige(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Beige"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "beige", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Beige.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.573159f, 0.487765f ,0.334458f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.1f, + imperfection_dust: 0.233f, + imperfection_grunge: 0.3f, + imperfection_smudges: 0.847f, + color_back: color(0.535642f,0.487765f,0.394083f), + diffuse_brightness_back: 0.35f, + reflection_roughness_back: 0.781f, + dirt_back_on_off: true, + dirt_color: color(0.325037f, 0.263175f, 0.154152f), + dirt_softness: 0.8f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material PU_Split_Leather_Light_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Light Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "light", "blue", "cold", "cool")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Light_Blue.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.470440f, 0.511398f ,0.560499f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.1f, + imperfection_dust: 0.233f, + imperfection_grunge: 0.3f, + imperfection_smudges: 0.847f, + color_back: color(0.415148f,0.425905f,0.436813f), + diffuse_brightness_back: 0.4f, + reflection_roughness_back: 0.667f, + dirt_back_on_off: true, + dirt_color: color(0.246800f, 0.368591f, 0.470440f), + dirt_softness: 0.584f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material PU_Split_Leather_Light_Salmon(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Salmon"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "salmon", "red", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Light_Salmon.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.851252f, 0.368591f ,0.284452f), + diffuse_brightness_front: 0.4f, + reflection_roughness_front: 0.1f, + imperfection_dust: 0.233f, + imperfection_grunge: 0.593f, + imperfection_smudges: 0.6f, + color_back: color(0.804559f,0.618686f,0.554227f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.839f, + dirt_back_on_off: true, + dirt_color: color(0.598942f, 0.598942f, 0.012664f), + dirt_softness: 0.6f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material PU_Split_Leather_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "blue", "cool", "cold")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Blue.png") +]] += PU_Split_Leather +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.009021f, 0.038473f ,0.306635f), + diffuse_brightness_front: 0.424f, + reflection_roughness_front: 0.093f, + imperfection_dust: 0.06f, + imperfection_grunge: 0.22f, + imperfection_smudges: 0.673f, + color_back: color(0.009021f,0.034230f,0.183549f), + diffuse_brightness_back: 0.504f, + reflection_roughness_back: 0.6f, + dirt_back_on_off: true, + dirt_color: color(0.037029f, 0.035614f, 0.084642f), + dirt_softness: 0.639f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + + +// ----------------- Punched Leather ----------------- +export material PU_Split_Leather_Punched( + +// Leather 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") + ]], + float bump_strength = 0.55f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.106156f, 0.065754f, 0.016988f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.83f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.34f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_dust = 0.7f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_grunge = 0.2f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_smudges = 0.5f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back = color(0.130352f, 0.078057f, 0.026549f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.43f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.8f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = true [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023f, 0.023f, 0.023f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float dirt_softness = 0.8f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_amount = 0.25f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(9) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(10) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(11) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(13) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(14) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(15) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(16) + ]], + uniform bool round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(17) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(18) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(19) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "pu", "split", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Punched.png") +]] = let +{ + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = PU_Split_Leather( + infinite_tiling: infinite_tiling, + bump_strength: bump_strength, + color_front: color_front, + diffuse_brightness_front: diffuse_brightness_front, + reflection_roughness_front: reflection_roughness_front, + imperfection_dust: imperfection_dust, + imperfection_grunge: imperfection_grunge, + imperfection_smudges: imperfection_smudges, + color_back: color_back, + diffuse_brightness_back: diffuse_brightness_back, + reflection_roughness_back: reflection_roughness_back, + dirt_back_on_off: dirt_back_on_off, + dirt_color: dirt_color, + dirt_softness: dirt_softness, + dirt_amount: dirt_amount, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + round_corners: round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./textures/leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + volume: base_mat.volume, + ior: base_mat.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base_mat.geometry.displacement, + normal: final_normal, + cutout_opacity: cutout + ) +); + +export material PU_Split_Leather_Black_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "dark", "black", "neutral")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Black_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.55f, + color_front: color(0.009021f, 0.009021f, 0.009021f), + diffuse_brightness_front: 0.35f, + reflection_roughness_front: 0.187f, + imperfection_dust: 0.313f, + imperfection_grunge: 0.153f, + imperfection_smudges: 0.133f, + color_back: color(0.034230f, 0.034230f, 0.034230f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.55f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + dirt_softness: 0.8f, + dirt_amount: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material PU_Split_Leather_Dark_Green_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Dark Green Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "dark", "green", "cool", "cold")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Dark_Green_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.032876f, 0.039947f ,0.024223f), + diffuse_brightness_front: 0.35f, + reflection_roughness_front: 0.187f, + imperfection_dust: 0.313f, + imperfection_grunge: 0.153f, + imperfection_smudges: 0.133f, + color_back: color(0.348865f,0.399293f,0.280124f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.55f, + dirt_back_on_off: true, + dirt_color: color(0.011126f, 0.013473f, 0.011126f), + dirt_softness: 0.8f, + dirt_amount: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material PU_Split_Leather_Red_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Red Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "red", "saturated", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Red_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.293216f, 0.012664f ,0.011126f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.25f, + imperfection_dust: 0.06f, + imperfection_grunge: 0.151f, + imperfection_smudges: 0.913f, + color_back: color(0.605484f,0.315763f,0.334458f), + diffuse_brightness_back: 0.1f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.592438f, 0.067725f, 0.098689f), + dirt_softness: 0.639f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material PU_Split_Leather_Purple_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Purple Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "purple", "cool", "cold")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Purple_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.075926f, 0.049433f ,0.133209f), + diffuse_brightness_front: 0.35f, + reflection_roughness_front: 0.093f, + imperfection_dust: 0.06f, + imperfection_grunge: 0.22f, + imperfection_smudges: 0.673f, + color_back: color(0.031551f,0.041452f,0.069727f), + diffuse_brightness_back: 0.33f, + reflection_roughness_back: 0.6f, + dirt_back_on_off: true, + dirt_color: color(0.035614f, 0.067725f, 0.084642f), + dirt_softness: 0.639f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material PU_Split_Leather_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PU Split Leather - Dark Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "warm", "soft", "brown")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Brown_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.069727f, 0.031551f ,0.011126f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.1f, + imperfection_dust: 0.233f, + imperfection_grunge: 0.3f, + imperfection_smudges: 0.847f, + color_back: color(0.219520f,0.183549f,0.124741f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.6f, + dirt_back_on_off: true, + dirt_color: color(0.047776f, 0.022013f, 0.009021f), + dirt_softness: 0.8f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material PU_Split_Leather_Beige_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Beige Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "beige", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Beige_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.573159f, 0.487765f ,0.334458f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.1f, + imperfection_dust: 0.233f, + imperfection_grunge: 0.3f, + imperfection_smudges: 0.847f, + color_back: color(0.535642f,0.487765f,0.394083f), + diffuse_brightness_back: 0.35f, + reflection_roughness_back: 0.781f, + dirt_back_on_off: true, + dirt_color: color(0.325037f, 0.263175f, 0.154152f), + dirt_softness: 0.8f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material PU_Split_Leather_Light_Blue_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Light Blue Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "light", "blue", "cold", "cool")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Light_Blue_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.470440f, 0.511398f ,0.560499f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.1f, + imperfection_dust: 0.233f, + imperfection_grunge: 0.3f, + imperfection_smudges: 0.847f, + color_back: color(0.415148f,0.425905f,0.436813f), + diffuse_brightness_back: 0.4f, + reflection_roughness_back: 0.667f, + dirt_back_on_off: true, + dirt_color: color(0.246800f, 0.368591f, 0.470440f), + dirt_softness: 0.584f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material PU_Split_Leather_Light_Salmon_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Salmon Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "salmon", "red", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Light_Salmon_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.851252f, 0.368591f ,0.284452f), + diffuse_brightness_front: 0.4f, + reflection_roughness_front: 0.1f, + imperfection_dust: 0.233f, + imperfection_grunge: 0.593f, + imperfection_smudges: 0.6f, + color_back: color(0.804559f,0.618686f,0.554227f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.839f, + dirt_back_on_off: true, + dirt_color: color(0.598942f, 0.598942f, 0.012664f), + dirt_softness: 0.6f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material PU_Split_Leather_Blue_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("PU Split Leather - Blue Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "pu", "split", "natural", "bumped", "interior", "cloth", "soft", "blue", "cool", "cold")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/PU_Split_Leather.PU_Split_Leather_Blue_Punched.png") +]] += PU_Split_Leather_Punched +( + infinite_tiling: true, + bump_strength: .55f, + color_front: color(0.009021f, 0.038473f ,0.306635f), + diffuse_brightness_front: 0.424f, + reflection_roughness_front: 0.093f, + imperfection_dust: 0.06f, + imperfection_grunge: 0.22f, + imperfection_smudges: 0.673f, + color_back: color(0.009021f,0.034230f,0.183549f), + diffuse_brightness_back: 0.504f, + reflection_roughness_back: 0.6f, + dirt_back_on_off: true, + dirt_color: color(0.037029f, 0.035614f, 0.084642f), + dirt_softness: 0.639f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Leather/Pigmented_Smooth_Leather.mdl b/code/third_party/vMaterials_2/Leather/Pigmented_Smooth_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..252d9e1b5ea8f6ef5ec82b2faf321fa401bb2c7a --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/Pigmented_Smooth_Leather.mdl @@ -0,0 +1,1644 @@ +/****************************************************************************** + * 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 pigmented smooth leather material"; +const string DESCRIPTION_PUNCHED = "A pigmented smooth leather material with punched holes. Various shapes for the punching such as circles, lines, rectangles and squares can be chosen."; + +annotation preview_scale( float f); + + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Choose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=float2(0.5f) +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += float2(0.5f); + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + +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); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float3 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)); +} + +::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 Pigmented_Smooth_Leather( + 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 bump_strength = 0.3f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.078057f, 0.049433f, 0.012664f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_dust = 0.6f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_grunge = 0.1f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_smudges = 0.3f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back = color(0.151058f, 0.119264f, 0.063815f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.7f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.4f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = true [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023f, 0.023f, 0.023f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Color Dirt"), + ::anno::in_group("Appearance", "Dirt") + ]], + float dirt_softness = 0.8f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_amount = 0.2f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::in_group("Transform") + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool 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 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("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Smooth Leather - Brown Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather.png") +]] + = + let { + float2 texture_scale_rescaled = texture_scale / 8.0f; + bool tmp0 = true; + + texture_2d rough_dirty_height_tex = texture_2d("./textures/pigmented_smooth_leather_front_multi_rough_dirt_height.jpg", ::tex::gamma_linear); + texture_2d dust_grunge_leather_tex = texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear); + texture_2d front_diff_lin_tex = texture_2d("./textures/pigmented_smooth_leather_front_diff.jpg", ::tex::gamma_linear); + texture_2d front_diff_srgb_tex = texture_2d("./textures/pigmented_smooth_leather_front_diff.jpg", ::tex::gamma_srgb); + texture_2d front_norm_tex = texture_2d("./textures/pigmented_smooth_leather_front_norm.jpg", ::tex::gamma_linear); + texture_2d back_rough_ao_height_tex = texture_2d("./textures/pigmented_smooth_leather_back_multi_rough_ao_height.jpg", ::tex::gamma_linear); + texture_2d back_diff_lin_tex = texture_2d("./textures/pigmented_smooth_leather_back_diff.jpg", ::tex::gamma_linear); + texture_2d back_diff_srgb_tex = texture_2d("./textures/pigmented_smooth_leather_back_diff.jpg", ::tex::gamma_srgb); + texture_2d back_norm_tex = texture_2d("./textures/pigmented_smooth_leather_back_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, dirt_amount) - dirt_softness, ::math::lerp(1.f, 0.f, dirt_amount) + dirt_softness, float3(infinite_tiling ? endless_texture(rough_dirty_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.753000021f, 0.409999996f, 0.698000014f), 8.f, false) : ::base::file_texture(rough_dirty_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_dirty_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.753000021f, 0.409999996f, 0.698000014f), 8.f, false) : ::base::file_texture(rough_dirty_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.5f, 0.379999995f), ::df::microfacet_ggx_smith_bsdf(((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirty_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.753000021f, 0.409999996f, 0.698000014f), 8.f, false) : ::base::file_texture(rough_dirty_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.300000012f, 0.600000024f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirty_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.753000021f, 0.409999996f, 0.698000014f), 8.f, false) : ::base::file_texture(rough_dirty_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.300000012f, 0.600000024f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges), ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirty_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.753000021f, 0.409999996f, 0.698000014f), 8.f, false) : ::base::file_texture(rough_dirty_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.300000012f, 0.600000024f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirty_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.753000021f, 0.409999996f, 0.698000014f), 8.f, false) : ::base::file_texture(rough_dirty_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.300000012f, 0.600000024f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_front, (infinite_tiling ? endless_texture(front_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.597000003f), 8.f, true) : ::base::file_texture(front_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 3.f, diffuse_brightness_front)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_dirty_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.753000021f, 0.409999996f, 0.698000014f), 8.f, false) : ::base::file_texture(rough_dirty_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.796000063f, 0.784000039f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.485000014f, 0.513999999f, 0.987999976f), 8.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.485000014f, 0.513999999f, 0.987999976f), 8.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2(dirt_back_on_off ? ::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, dirt_amount) - dirt_softness, ::math::lerp(1.f, 0.f, dirt_amount) + dirt_softness, float3(infinite_tiling ? endless_texture(rough_dirty_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.753000021f, 0.409999996f, 0.698000014f), 8.f, false) : ::base::file_texture(rough_dirty_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.488000005f), 8.f, true) : ::base::file_texture(back_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.490999997f, 0.503000021f, 0.989000022f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.490999997f, 0.503000021f, 0.989000022f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()) : ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.488000005f), 8.f, false) : ::base::file_texture(back_diff_lin_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.792999983f, 0.924000025f, 0.683000028f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.490999997f, 0.503000021f, 0.989000022f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.490999997f, 0.503000021f, 0.989000022f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00150000001f, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Pigmented_Smooth_Leather_Black(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Smooth Leather - Black Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "black", "dark", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Black.png") +]] += Pigmented_Smooth_Leather +( + infinite_tiling: true, + bump_strength: 0.4f, + color_front: color(0.009021f, 0.009021f, 0.009021f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.034230f, 0.034230f, 0.034230f), + diffuse_brightness_back: 0.5f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.00f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pigmented_Smooth_Leather_Green(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Smooth Leather - Green Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "green", "cool", "cold")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Green.png") +]] += Pigmented_Smooth_Leather +( + infinite_tiling: true, + bump_strength: 0.4f, + color_front: color(0.271577f, 0.250840f, 0.061907f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.271577f,0.259027f,0.124741f), + diffuse_brightness_back: 0.5f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pigmented_Smooth_Leather_Gray(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Smooth Leather - Grey Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft","grey", "gray", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Gray.png") +]] += Pigmented_Smooth_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.464741f, 0.459080f, 0.431340f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.535642f,0.535642f,0.535642f), + diffuse_brightness_back: 0.4f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pigmented_Smooth_Leather_Turquoise(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Smooth Leather - Turquoise Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "turquoise", "cool", "cold")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Turquoise.png") +]] += Pigmented_Smooth_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.108711f, 0.212044f, 0.254916f), + diffuse_brightness_front: 0.125f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.163641f,0.238828f,0.263175f), + diffuse_brightness_back: 0.6f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pigmented_Smooth_Leather_Light_Blue(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Smooth Leather - Light Blue Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "blue", "light", "cool", "cold")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Light_Blue.png") +]] += Pigmented_Smooth_Leather +( + infinite_tiling: true, + bump_strength: 0.4f, + color_front: color(0.404541f, 0.505432f, 0.579547f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.297653f,0.339223f,0.404541f), + diffuse_brightness_back: 0.5f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pigmented_Smooth_Leather_Dark_Grey(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Smooth Leather - Dark Grey Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "dark", "grey", "gray", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Dark_Grey.png") +]] += Pigmented_Smooth_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.151058f, 0.151058f, 0.144972f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.5f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.470440f,0.464741f,0.493616f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pigmented_Smooth_Leather_Ash_Brown(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pigmented Smooth Leather - Ash Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "ash", "brown", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Ash_Brown.png") +]] += Pigmented_Smooth_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.069727f, 0.061907f, 0.046149f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.5f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.101145f,0.093876f,0.073828f), + diffuse_brightness_back: 0.7f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.154152f, 0.106156f, 0.069727f), + dirt_softness: 0.905f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pigmented_Smooth_Leather_Red_Yellow(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Smooth Leather - Red Yellow Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "yellow", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Red_Yellow.png") +]] += Pigmented_Smooth_Leather +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.505432f, 0.037029f, 0.009696f), + diffuse_brightness_front: 0.125f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.462f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.453456f,0.183549f,0.011126f), + diffuse_brightness_back: 0.362f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.464741f, 0.163641f, 0.012664f), + dirt_softness: 0.816f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +// ----------------- Punched Leather ----------------- +export material Pigmented_Smooth_Leather_Punched( + +// Leather 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") + ]], + float bump_strength = 0.3f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.078057f, 0.049433f, 0.012664f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_dust = 0.6f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_grunge = 0.1f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_smudges = 0.3f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back = color(0.151058f, 0.119264f, 0.063815f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.7f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.4f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = true [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023f, 0.023f, 0.023f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Color Dirt"), + ::anno::in_group("Appearance", "Dirt") + ]], + float dirt_softness = 0.8f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_amount = 0.2f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(9) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(10) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(11) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(13) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(14) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(15) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(16) + ]], + uniform bool round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(17) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(18) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(19) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Brown Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Punched.png") +]] = let +{ + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = Pigmented_Smooth_Leather( + infinite_tiling: infinite_tiling, + bump_strength: bump_strength, + color_front: color_front, + diffuse_brightness_front: diffuse_brightness_front, + reflection_roughness_front: reflection_roughness_front, + imperfection_dust: imperfection_dust, + imperfection_grunge: imperfection_grunge, + imperfection_smudges: imperfection_smudges, + color_back: color_back, + diffuse_brightness_back: diffuse_brightness_back, + reflection_roughness_back: reflection_roughness_back, + dirt_back_on_off: dirt_back_on_off, + dirt_color: dirt_color, + dirt_softness: dirt_softness, + dirt_amount: dirt_amount, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + round_corners: round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./textures/leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + backface: material_surface( + scattering: base_mat.backface.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 Pigmented_Smooth_Leather_Black_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Black Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "black", "dark", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Black_Punched.png") +]] += Pigmented_Smooth_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.4f, + color_front: color(0.009021f, 0.009021f, 0.009021f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.034230f, 0.034230f, 0.034230f), + diffuse_brightness_back: 0.5f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pigmented_Smooth_Leather_Green_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Green Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "green", "cool", "cold")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Green_Punched.png") +]] += Pigmented_Smooth_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.4f, + color_front: color(0.271577f, 0.250840f, 0.061907f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.271577f,0.259027f,0.124741f), + diffuse_brightness_back: 0.5f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pigmented_Smooth_Leather_Gray_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Grey Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft","grey", "gray", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Gray_Punched.png") +]] += Pigmented_Smooth_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.464741f, 0.459080f, 0.431340f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.535642f,0.535642f,0.535642f), + diffuse_brightness_back: 0.4f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pigmented_Smooth_Leather_Turquoise_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Turquoise Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "turquoise", "cool", "cold")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Turquoise_Punched.png") +]] += Pigmented_Smooth_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.108711f, 0.212044f, 0.254916f), + diffuse_brightness_front: 0.125f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.163641f,0.238828f,0.263175f), + diffuse_brightness_back: 0.6f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pigmented_Smooth_Leather_Light_Blue_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Light Blue Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "blue", "light", "cool", "cold")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Light_Blue_Punched.png") +]] += Pigmented_Smooth_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.4f, + color_front: color(0.404541f, 0.505432f, 0.579547f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.297653f,0.339223f,0.404541f), + diffuse_brightness_back: 0.5f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + + +export material Pigmented_Smooth_Leather_Dark_Grey_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Dark Grey Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "dark", "grey", "gray", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Dark_Grey_Punched.png") +]] += Pigmented_Smooth_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.151058f, 0.151058f, 0.144972f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.5f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.470440f,0.464741f,0.493616f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pigmented_Smooth_Leather_Ash_Brown_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Ash Brown Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "ash", "brown", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Ash_Brown_Punched.png") +]] += Pigmented_Smooth_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.069727f, 0.061907f, 0.046149f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.5f, + imperfection_dust: 0.103f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.101145f,0.093876f,0.073828f), + diffuse_brightness_back: 0.7f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.154152f, 0.106156f, 0.069727f), + dirt_softness: 0.905f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pigmented_Smooth_Leather_Red_Yellow_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Smooth Leather - Red Yellow Punched Pigmented"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "yellow", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Red_Yellow_Punched.png") +]] += Pigmented_Smooth_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.5f, + color_front: color(0.505432f, 0.037029f, 0.009696f), + diffuse_brightness_front: 0.125f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.462f, + imperfection_grunge: 0.467f, + imperfection_smudges: 0.072f, + color_back: color(0.453456f,0.183549f,0.011126f), + diffuse_brightness_back: 0.362f, + reflection_roughness_back: 0.75f, + dirt_back_on_off: true, + dirt_color: color(0.464741f, 0.163641f, 0.012664f), + dirt_softness: 0.816f, + dirt_amount: 0.23f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Leather/Pull_Up_Leather.mdl b/code/third_party/vMaterials_2/Leather/Pull_Up_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..658f9b2c781d54307cf2e285f20882571632f31f --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/Pull_Up_Leather.mdl @@ -0,0 +1,1727 @@ +/****************************************************************************** + * 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 pull up leather material"; +const string DESCRIPTION_PUNCHED = "A pull up leather material with punched holes. Various shapes for the punching such as circles, lines, rectangles and squares can be chosen."; + +annotation preview_scale( float f); + + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Choose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=float2(0.5f) +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += float2(0.5f); + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + +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) ); + +} +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 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); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + + + +float3 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)); +} + + +::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 Pull_Up_Leather( + 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 bump_strength = 0.7f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.101f, 0.0658f, 0.0189f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.400000006f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.347000003f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_dust = 0.7f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_grunge = 0.3f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_smudges = 0.5f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back = color(0.106f, 0.0619f, 0.0127f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.25f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = false [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023f, 0.023f, 0.023f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float dirt_softness = 0.7f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_amount = 0.3f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::in_group("Transform") + ]], + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Dark Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("pull", "up", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "brown", "warm", "dark")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather.png") +]] + = + let { + float2 texture_scale_rescaled = texture_scale / 8.0f; + bool tmp0 = true; + texture_2d rough_dirt_height_tex = texture_2d("./textures/pullUp_leather_Front_multi_rough_dirt_height.jpg", ::tex::gamma_linear); + texture_2d dust_grunge_leather_tex = texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear); + texture_2d front_diff_lin_tex = texture_2d("./textures/pullUp_leather_front_diff.jpg", ::tex::gamma_linear); + texture_2d front_diff_srgb_tex = texture_2d("./textures/pullUp_leather_front_diff.jpg", ::tex::gamma_srgb); + texture_2d rough_height_tex = texture_2d("./textures/pullUp_leather_back_multi_rough_pullUp_height.jpg", ::tex::gamma_linear); + texture_2d front_norm_tex = texture_2d("./textures/pullUp_leather_front_norm.jpg", ::tex::gamma_linear); + texture_2d back_diff_lin_tex = texture_2d("./textures/pullUp_leather_back_diff.jpg", ::tex::gamma_linear); + texture_2d back_diff_srgb_tex = texture_2d("./textures/pullUp_leather_back_diff.jpg", ::tex::gamma_srgb); + texture_2d back_norm_tex = texture_2d("./textures/pullUp_leather_back_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, dirt_amount) - dirt_softness, ::math::lerp(1.f, 0.f, dirt_amount) + dirt_softness, float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.5f, 0.261000007f), ::df::microfacet_ggx_smith_bsdf(((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.25f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.25f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges), ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.25f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.25f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfection_smudges), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color_front, (infinite_tiling ? endless_texture(front_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.368000001f), 6.f, true) : ::base::file_texture(front_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 3.f, diffuse_brightness_front)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.796000063f, 0.784000039f)).tint, color(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_spotlight, 0.5f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.505999982f, 0.513999999f, 0.99000001f), 6.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.505999982f, 0.513999999f, 0.99000001f), 6.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2(dirt_back_on_off ? ::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, dirt_amount) - dirt_softness, ::math::lerp(1.f, 0.f, dirt_amount) + dirt_softness, float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.307000011f), 6.f, true) : ::base::file_texture(back_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.512000024f, 0.513000011f, 0.994000018f), 6.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.512000024f, 0.513000011f, 0.994000018f), 6.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()) : ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.307000011f), 6.f, true) : ::base::file_texture(back_diff_lin_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.512000024f, 0.513000011f, 0.994000018f), 6.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.512000024f, 0.513000011f, 0.994000018f), 6.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Pull_Up_Leather_Black(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "black", "dark", "neutral")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Black.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.021f, 0.021f, 0.021f), + diffuse_brightness_front: 0.3f, + reflection_roughness_front: 0.25f, + imperfection_dust: 0.455f, + imperfection_grunge: 0.062f, + imperfection_smudges: 0.406f, + color_back: color(0.0494f, 0.0494f, 0.0494f), + diffuse_brightness_back: 0.1f, + reflection_roughness_back: 0.8f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + dirt_softness: 0.8f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pull_Up_Leather_Violet(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Violet"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "violet", "cool", "cold", "dark")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Violet.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.0781f, 0.021f, 0.0461f), + diffuse_brightness_front: 0.3f, + reflection_roughness_front: 0.25f, + imperfection_dust: 0.455f, + imperfection_grunge: 0.062f, + imperfection_smudges: 0.406f, + color_back: color(0.223f,0.080f,0.069f), + diffuse_brightness_back: 0.1f, + reflection_roughness_back: 0.8f, + dirt_back_on_off: true, + dirt_color: color(0.034f, 0.055f, 0.082f), + dirt_softness: 0.8f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + + +export material Pull_Up_Leather_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "blue", "dark", "cold", "cool")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Blue.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.017936f, 0.075926f ,0.119264f), + diffuse_brightness_front: 0.3f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.719f, + imperfection_grunge: 0.228f, + imperfection_smudges: 0.587f, + color_back: color(0.044553f,0.096266f,0.151058f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.8f, + dirt_back_on_off: true, + dirt_color: color(0.013473f, 0.023104f, 0.035614f), + dirt_softness: 0.816f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pull_Up_Leather_Yellow(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Yellow"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "yellow", "mustard", "saturated", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Yellow.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.812241f, 0.638779f ,0.035614f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.22, + imperfection_dust: 0.719f, + imperfection_grunge: 0.228f, + imperfection_smudges: 0.587f, + color_back: color(0.729919f,0.592438f,0.147998f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.56f, + dirt_back_on_off: true, + dirt_color: color(0.680020f, 0.353741f, 0.039947f), + dirt_softness: 0.987f, + dirt_amount: 0.8f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pull_Up_Leather_Light_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Light Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "light", "brown")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Light_Brown.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.541798f, 0.254916f ,0.011126f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.22, + imperfection_dust: 0.719f, + imperfection_grunge: 0.228f, + imperfection_smudges: 0.587f, + color_back: color(0.302125f,0.147998f,0.024223f), + diffuse_brightness_back: 0.527f, + reflection_roughness_back: 0.7f, + dirt_back_on_off: true, + dirt_color: color(0.680020f, 0.353741f, 0.039947f), + dirt_softness: 0.987f, + dirt_amount: 0.125f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pull_Up_Leather_Dark_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Dark Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "dark", "brown")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Dark_Brown.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.101f, 0.0461f, 0.0127f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.22, + imperfection_dust: 0.719f, + imperfection_grunge: 0.228f, + imperfection_smudges: 0.587f, + color_back: color(0.128f, 0.0963f, 0.0546f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.66f, + dirt_back_on_off: true, + dirt_color: color(0.108711f, 0.058187f, 0.017936f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pull_Up_Leather_Cognac(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Cognac"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "dark", "cognac", "brown", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Cognac.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.212f, 0.037f, 0.0199f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.2, + imperfection_dust: 0.7f, + imperfection_grunge: 0.2f, + imperfection_smudges: 0.6f, + color_back: color(0.267f, 0.0939f, 0.0546f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.7f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.8f, + dirt_amount: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pull_Up_Leather_Red_Oak(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Red Oak"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Oak.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.339223f, 0.071761f ,0.005522f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.2, + imperfection_dust: 0.7f, + imperfection_grunge: 0.2f, + imperfection_smudges: 0.6f, + color_back: color(0.297653f,0.193972f,0.124741f), + diffuse_brightness_back: 0.7f, + reflection_roughness_back: 0.7f, + dirt_back_on_off: true, + dirt_color: color(0.481952f, 0.056374f, 0.012664f), + dirt_softness: 0.8f, + dirt_amount: 0.317f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Pull_Up_Leather_Red_Wine(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Pull Up Leather - Red Wine"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "wine", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Wine.png") +]] += Pull_Up_Leather +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.167f, 0.0199f, 0.0135f), + diffuse_brightness_front: 0.125f, + reflection_roughness_front: 0.2, + imperfection_dust: 0.7f, + imperfection_grunge: 0.2f, + imperfection_smudges: 0.6f, + color_back: color(0.373615f,0.049433f,0.023104f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.7f, + dirt_back_on_off: true, + dirt_color: color(0.275833f, 0.028991f, 0.016068f), + dirt_softness: 1.0f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + + +// ----------------- Punched Leather ----------------- +export material Pull_Up_Leather_Punched( + +// Leather 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") + ]], + float bump_strength = 0.7f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.069727f, 0.046149f, 0.013473f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.40f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.347f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_dust = 0.7f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_grunge = 0.3f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfection_smudges = 0.5f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back = color(0.072f, 0.043f, 0.009f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.25f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = false [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023f, 0.023f, 0.023f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float dirt_softness = 0.7f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_amount = 0.3f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + 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(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform") + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(9) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout") + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout") + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout") + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout") + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout") + ]], +// 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") + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false") + ]], + uniform bool 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.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true") + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true") + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Dark Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "design", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = let +{ + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = Pull_Up_Leather( + infinite_tiling: infinite_tiling, + bump_strength: bump_strength, + color_front: color_front, + diffuse_brightness_front: diffuse_brightness_front, + reflection_roughness_front: reflection_roughness_front, + imperfection_dust: imperfection_dust, + imperfection_grunge: imperfection_grunge, + imperfection_smudges: imperfection_smudges, + color_back: color_back, + diffuse_brightness_back: diffuse_brightness_back, + reflection_roughness_back: reflection_roughness_back, + dirt_back_on_off: dirt_back_on_off, + dirt_color: dirt_color, + dirt_softness: dirt_softness, + dirt_amount: dirt_amount, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + round_corners: round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./textures/leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + backface: material_surface( + scattering: base_mat.backface.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 Pull_Up_Leather_Black_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "black", "dark", "neutral")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Black_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.021f, 0.021f, 0.021f), + diffuse_brightness_front: 0.3f, + reflection_roughness_front: 0.25f, + imperfection_dust: 0.455f, + imperfection_grunge: 0.062f, + imperfection_smudges: 0.406f, + color_back: color(0.0494f, 0.0494f, 0.0494f), + diffuse_brightness_back: 0.1f, + reflection_roughness_back: 0.8f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + dirt_softness: 0.8f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pull_Up_Leather_Violet_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Violet Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "violet", "cool", "cold", "dark")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Violet_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.0781f, 0.021f, 0.0461f), + diffuse_brightness_front: 0.3f, + reflection_roughness_front: 0.25f, + imperfection_dust: 0.455f, + imperfection_grunge: 0.062f, + imperfection_smudges: 0.406f, + color_back: color(0.223f,0.080f,0.069f), + diffuse_brightness_back: 0.1f, + reflection_roughness_back: 0.8f, + dirt_back_on_off: true, + dirt_color: color(0.034f, 0.055f, 0.082f), + dirt_softness: 0.8f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pull_Up_Leather_Blue_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Blue Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "cold", "blue", "dark", "cold", "cool")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Blue_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.017936f, 0.075926f ,0.119264f), + diffuse_brightness_front: 0.3f, + reflection_roughness_front: 0.3f, + imperfection_dust: 0.719f, + imperfection_grunge: 0.228f, + imperfection_smudges: 0.587f, + color_back: color(0.044553f,0.096266f,0.151058f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.8f, + dirt_back_on_off: true, + dirt_color: color(0.013473f, 0.023104f, 0.035614f), + dirt_softness: 0.816f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pull_Up_Leather_Yellow_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Yellow Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "yellow", "mustard", "saturated")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Yellow_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.812241f, 0.638779f ,0.035614f), + diffuse_brightness_front: 0.1f, + reflection_roughness_front: 0.22, + imperfection_dust: 0.719f, + imperfection_grunge: 0.228f, + imperfection_smudges: 0.587f, + color_back: color(0.729919f,0.592438f,0.147998f), + diffuse_brightness_back: 0.125f, + reflection_roughness_back: 0.56f, + dirt_back_on_off: true, + dirt_color: color(0.680020f, 0.353741f, 0.039947f), + dirt_softness: 0.987f, + dirt_amount: 0.8f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pull_Up_Leather_Light_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Light Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "light", "brown")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Light_Brown_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.541798f, 0.254916f ,0.011126f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.22, + imperfection_dust: 0.719f, + imperfection_grunge: 0.228f, + imperfection_smudges: 0.587f, + color_back: color(0.302125f,0.147998f,0.024223f), + diffuse_brightness_back: 0.527f, + reflection_roughness_back: 0.7f, + dirt_back_on_off: true, + dirt_color: color(0.680020f, 0.353741f, 0.039947f), + dirt_softness: 0.987f, + dirt_amount: 0.125f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pull_Up_Leather_Dark_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Dark Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "dark", "brown")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Dark_Brown_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.101f, 0.0461f, 0.0127f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.22, + imperfection_dust: 0.719f, + imperfection_grunge: 0.228f, + imperfection_smudges: 0.587f, + color_back: color(0.128f, 0.0963f, 0.0546f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.66f, + dirt_back_on_off: true, + dirt_color: color(0.108711f, 0.058187f, 0.017936f), + dirt_softness: 0.816f, + dirt_amount: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pull_Up_Leather_Cognac_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Cognac Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "dark", "cognac", "brown")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Cognac_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.212f, 0.037f, 0.0199f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.2, + imperfection_dust: 0.7f, + imperfection_grunge: 0.2f, + imperfection_smudges: 0.6f, + color_back: color(0.267f, 0.0939f, 0.0546f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.7f, + dirt_back_on_off: true, + dirt_color: color(0.023104f, 0.023104f, 0.023104f), + dirt_softness: 0.8f, + dirt_amount: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pull_Up_Leather_Red_Oak_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Red Oak Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Oak_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.339223f, 0.071761f ,0.005522f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.2, + imperfection_dust: 0.7f, + imperfection_grunge: 0.2f, + imperfection_smudges: 0.6f, + color_back: color(0.297653f,0.193972f,0.124741f), + diffuse_brightness_back: 0.7f, + reflection_roughness_back: 0.7f, + dirt_back_on_off: true, + dirt_color: color(0.481952f, 0.056374f, 0.012664f), + dirt_softness: 0.8f, + dirt_amount: 0.317f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Pull_Up_Leather_Red_Wine_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Pull Up Leather - Red Wine Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "wine", "warm")), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials"), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Wine_Punched.png") +]] += Pull_Up_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.7f, + color_front: color(0.167f, 0.0199f, 0.0135f), + diffuse_brightness_front: 0.125f, + reflection_roughness_front: 0.2, + imperfection_dust: 0.7f, + imperfection_grunge: 0.2f, + imperfection_smudges: 0.6f, + color_back: color(0.373615f,0.049433f,0.023104f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.7f, + dirt_back_on_off: true, + dirt_color: color(0.275833f, 0.028991f, 0.016068f), + dirt_softness: 1.0f, + dirt_amount: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Leather/Semi_Aniline_Leather.mdl b/code/third_party/vMaterials_2/Leather/Semi_Aniline_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..816ed199229dc085b0e6be1ac8da1e08d1318cac --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/Semi_Aniline_Leather.mdl @@ -0,0 +1,1588 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A semi aniline leather material"; +const string DESCRIPTION_PUNCHED = "A semi aniline leather material with punched holes. Various shapes for the punching such as circles, lines, rectangles and squares can be chosen."; + +annotation preview_scale( float f); + + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +struct vm_col_norm{ + float3 value; + float3 norm; +}; + +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("Choose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + // 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; +} + +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +// Performs a texture lookup and returns the result in a texture_return struct +// Mono mode may be chosen deliberately +::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); +} + +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(); +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=float2(0.5f) +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += float2(0.5f); + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + + +// 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_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); +} + + +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 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); +} + + +// Returns an infinite lookup plus a normal map lookup +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; +} + + +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 Semi_Aniline_Leather( + 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 bump_strength = 0.3f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color leather_color = color(0.394f, 0.194f, 0.0963f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 1.0f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.15f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfections_dust = 0.07f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfections_grunge = 0.13f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfections_smudges = 0.87f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back_leather = color(0.394f, 0.251f, 0.173f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float color_brightness_back = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.65f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = false [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.160444f, 0.016988f, 0.016988f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Dirt Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float softness = 0.66f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float position = 0.25f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::in_group("Transform") + ]], + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Semi Aniline Leather - Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Leather.png") +]] + = + let { + bool tmp0 = true; + float2 texture_rescale = texture_scale * .13f; + + texture_2d front_norm_tex = texture_2d("./textures/semi_aniline_front_norm.jpg", ::tex::gamma_linear); + texture_2d front_rough_ao_height_tex = texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear); + texture_2d dust_grunge_leather_tex = texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear); + texture_2d front_diff_lin_tex = texture_2d("./textures/semi_aniline_front_diff.jpg", ::tex::gamma_linear); + texture_2d front_diff_srgb_tex = texture_2d("./textures/semi_aniline_front_diff.jpg", ::tex::gamma_srgb); + texture_2d back_rough_ao_height_tex = texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear); + texture_2d back_norm_tex = texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear); + texture_2d back_diff_lin_tex = texture_2d("./textures/semi_aniline_back_diff.jpg", ::tex::gamma_linear); + texture_2d back_diff_srgb_tex = texture_2d("./textures/semi_aniline_back_diff.jpg", ::tex::gamma_srgb); + + material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, position) - softness, ::math::lerp(1.f, 0.f, position) + softness, (infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(front_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint)).y)), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big((infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(front_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint)).z, 0.761000037f, 0.582000017f), ::df::microfacet_ggx_smith_bsdf((((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).x * imperfections_dust + histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(front_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint)).x, 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front)) + ((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).y * imperfections_grunge + ((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).z * imperfections_smudges) * (((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).x * imperfections_dust + histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(front_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint)).x, 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front)) + ((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).y * imperfections_grunge + ((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).z * imperfections_smudges), (((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).x * imperfections_dust + histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(front_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint)).x, 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front)) + ((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).y * imperfections_grunge + ((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).z * imperfections_smudges) * (((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).x * imperfections_dust + histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(front_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint)).x, 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front)) + ((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).y * imperfections_grunge + ((infinite_tiling ? vm_tex_infinite(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), float3(0.453999996f, 0.832000017f, 0.513999999f), 0.949999988f, false, 2.20000005f) : float3(vm_tex_lookup(dust_grunge_leather_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(2.f)), mono_a, float4(1.f)).tint)) - 0.5f).z * imperfections_smudges), 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(nvidia::core_definitions::blend_colors(hsl2rgb(rgb2hsl(float3(leather_color)) * float3(1.f, 1.f, diffuse_brightness_front * 0.75f)), color(histogram_scan_big(infinite_tiling ? vm_tex_infinite(front_diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.363999993f), 1.f, true, 2.20000005f).x : float3(vm_tex_lookup(front_diff_srgb_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.569999993f, 0.0899999961f)), ::base::color_layer_multiply, 1.f, true).tint, 0.f), bsdf(), infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).norm : vm_tex_normal_lookup(front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength * 2.5f)), infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).norm : vm_tex_normal_lookup(front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength * 2.5f)), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2(dirt_back_on_off ? ::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, position) - softness, ::math::lerp(1.f, 0.f, position) + softness, (infinite_tiling ? vm_tex_infinite_color_normal(front_rough_ao_height_tex, front_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.708999991f, 0.393999994f, 0.836000025f), float3(0.476999998f, 0.474000007f, 0.987999976f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(front_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint)).y)), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)) * histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)), histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)) * histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)), 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(nvidia::core_definitions::blend_colors(color_back_leather, (infinite_tiling ? color(vm_tex_infinite(back_diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.433999985f), 1.f, true, 2.20000005f)) : vm_tex_lookup(back_diff_srgb_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint) * color(::math::lerp(0.f, 2.f, color_brightness_back)), ::base::color_layer_overlay, histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, 0.754000008f), true).tint, 0.f), bsdf(), infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : vm_tex_normal_lookup(texture_2d(), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength * 2.5f)), infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : vm_tex_normal_lookup(texture_2d(), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength * 2.5f)), ::state::normal()) : ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)) * histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)), histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)) * histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)), 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(nvidia::core_definitions::blend_colors(color_back_leather, (infinite_tiling ? color(vm_tex_infinite(back_diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.433999985f), 1.f, true, 2.20000005f)) : vm_tex_lookup(back_diff_srgb_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint) * color(::math::lerp(0.f, 2.f, color_brightness_back)), ::base::color_layer_overlay, histogram_range((infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : float3(vm_tex_lookup(back_rough_ao_height_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint))[0], 1.f, 0.754000008f), true).tint, 0.f), bsdf(), infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : vm_tex_normal_lookup(texture_2d(), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength * 2.5f)), infinite_tiling ? vm_tex_infinite_color_normal(back_rough_ao_height_tex, back_norm_tex, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.688000023f, 0.890999973f, 0.536000013f), float3(0.527999997f, 0.5f, 0.995999992f), 1.f, false, 2.20000005f, bump_strength * 2.5f).value : vm_tex_normal_lookup(texture_2d(), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength * 2.5f)), 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, round_corners ? ::state::rounded_corner_normal(radius * 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 Semi_Aniline_Black(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Semi Aniline Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi", "black", "dark", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Black.png") +]] += Semi_Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.3f, + leather_color: color(0.0528f, 0.0528f, 0.0528f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.15f, + imperfections_dust: 0.07f, + imperfections_grunge: 0.13f, + imperfections_smudges: 0.87f, + color_back_leather: color(0.0824f, 0.0824f, 0.0824f), + color_brightness_back: 0.65f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + softness: 0.66f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Semi_Aniline_Red(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Semi Aniline Leather - Red"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi", "red", "warm", "saturated")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Red.png") +]] += Semi_Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.3f, + leather_color: color(0.201f, 0.021f, 0.021f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.15f, + imperfections_dust: 0.07f, + imperfections_grunge: 0.13f, + imperfections_smudges: 0.87f, + color_back_leather: color(0.201f, 0.0697f, 0.0677f), + color_brightness_back: 0.65f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.160444f, 0.007751f, 0.007751f), + softness: 0.66f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Semi_Aniline_Peach(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Semi Aniline Leather - Peach"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "semi", "peach", "warm", "red")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Peach.png") +]] += Semi_Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.4f, + leather_color: color(0.646f, 0.227f, 0.136f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.646f, 0.389f, 0.32f), + color_brightness_back: 0.7f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.160444f, 0.007751f, 0.007751f), + softness: 0.807f, + position: 0.22f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Semi_Aniline_Mint(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Semi Aniline Leather - Mint"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "semi", "mint", "light", "pastel", "green", "cool", "cold")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Mint.png") +]] += Semi_Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.4f, + leather_color: color(0.384f, 0.646f, 0.465f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.523f, 0.586f, 0.542f), + color_brightness_back: 0.88f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.154152f, 0.160444f, 0.106156f), + softness: 0.8f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Semi_Aniline_Orange(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Semi Aniline Leather - Orange"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "semi", "orange", "warm", "saturated")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Orange.png") +]] += Semi_Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.45f, + leather_color: color(0.680020f, 0.130352f, 0.016988f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.605484f,0.363604f,0.212044f), + color_brightness_back: 0.2f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.666117f, 0.409826f, 0.028991f), + softness: 0.615f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Semi_Aniline_Lemon(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Semi Aniline Leather - Lemon"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi", "lemon", "yellow", "light", "saturated", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Lemon.png") + +]] += Semi_Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.4f, + leather_color: color(0.796917f, 0.585973f, 0.011126f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.774227f,0.729919f,0.499505f), + color_brightness_back: 0.176f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.425905f, 0.054592f, 0.012664f), + softness: 0.615f, + position: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Semi_Aniline_Salmon(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Semi Aniline Leather - Salmon"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi", "salmon", "red", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Salmon.png") +]] += Semi_Aniline_Leather +( + infinite_tiling: true, + bump_strength: 0.4f, + leather_color: color(0.812241f, 0.204710f, 0.190463f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.751895f,0.579547f,0.573159f), + color_brightness_back: 0.2f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.592438f, 0.124741f, 0.069727f), + softness: 0.801f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + + +// ----------------- Punched Leather ----------------- +export material Semi_Aniline_Leather_Punched( + +// Leather 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") + ]], + float bump_strength = 0.3f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color leather_color = color(0.394f, 0.194f, 0.0963f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 1.0f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.15f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfections_dust = 0.07f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfections_grunge = 0.13f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfections_smudges = 0.87f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back_leather = color(0.394f, 0.251f, 0.173f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float color_brightness_back = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.65f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = false [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.160444f, 0.016988f, 0.016988f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Dirt Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float softness = 0.66f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float position = 0.25f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(9) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(10) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(11) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(13) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(14) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(15) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(16) + ]], + uniform bool round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(17) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(18) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(19) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Semi Aniline Leather - Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Leather_Punched.png") +]] + = let { + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = Semi_Aniline_Leather( + infinite_tiling: infinite_tiling, + bump_strength: bump_strength, + leather_color: leather_color, + diffuse_brightness_front: diffuse_brightness_front, + reflection_roughness_front: reflection_roughness_front, + imperfections_dust: imperfections_dust, + imperfections_grunge: imperfections_grunge, + imperfections_smudges: imperfections_smudges, + color_back_leather: color_back_leather, + color_brightness_back: color_brightness_back, + reflection_roughness_back: reflection_roughness_back, + dirt_back_on_off: dirt_back_on_off, + dirt_color: dirt_color, + softness: softness, + position: position, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + round_corners: round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./textures/leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + backface: material_surface( + scattering: base_mat.backface.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 Semi_Aniline_Black_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Semi Aniline Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi", "black", "dark", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Black_Punched.png") +]] += Semi_Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.3f, + leather_color: color(0.0528f, 0.0528f, 0.0528f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.15f, + imperfections_dust: 0.07f, + imperfections_grunge: 0.13f, + imperfections_smudges: 0.87f, + color_back_leather: color(0.0824f, 0.0824f, 0.0824f), + color_brightness_back: 0.65f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + softness: 0.66f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Semi_Aniline_Red_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Semi Aniline Leather - Red Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi", "red", "warm", "saturated")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Red_Punched.png") +]] += Semi_Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.3f, + leather_color: color(0.201f, 0.021f, 0.021f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.15f, + imperfections_dust: 0.07f, + imperfections_grunge: 0.13f, + imperfections_smudges: 0.87f, + color_back_leather: color(0.201f, 0.0697f, 0.0677f), + color_brightness_back: 0.65f, + reflection_roughness_back: 0.65f, + dirt_back_on_off: true, + dirt_color: color(0.160444f, 0.007751f, 0.007751f), + softness: 0.66f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Semi_Aniline_Peach_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Semi Aniline Leather - Peach Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "semi", "peach", "warm", "red")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Peach_Punched.png") +]] += Semi_Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.4f, + leather_color: color(0.646f, 0.227f, 0.136f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.646f, 0.389f, 0.32f), + color_brightness_back: 0.7f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.160444f, 0.007751f, 0.007751f), + softness: 0.807f, + position: 0.22f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Semi_Aniline_Mint_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Semi Aniline Leather - Mint Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "semi", "mint", "light", "pastel", "green", "cool", "cold")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Mint_Punched.png") +]] += Semi_Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.4f, + leather_color: color(0.384f, 0.646f, 0.465f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.523f, 0.586f, 0.542f), + color_brightness_back: 0.88f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.154152f, 0.160444f, 0.106156f), + softness: 0.8f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Semi_Aniline_Orange_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Semi Aniline Leather - Orange Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "semi", "orange", "warm", "saturated")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Orange_Punched.png") +]] += Semi_Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.45f, + leather_color: color(0.680020f, 0.130352f, 0.016988f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.605484f,0.363604f,0.212044f), + color_brightness_back: 0.2f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.666117f, 0.409826f, 0.028991f), + softness: 0.615f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Semi_Aniline_Lemon_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Semi Aniline Leather - Lemon Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi", "lemon", "yellow", "light", "saturated", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Lemon_Punched.png") + +]] += Semi_Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.4f, + leather_color: color(0.796917f, 0.585973f, 0.011126f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.774227f,0.729919f,0.499505f), + color_brightness_back: 0.176f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.425905f, 0.054592f, 0.012664f), + softness: 0.615f, + position: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Semi_Aniline_Salmon_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Semi Aniline Leather - Salmon Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi", "salmon", "red", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Salmon_Punched.png") +]] += Semi_Aniline_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.4f, + leather_color: color(0.812241f, 0.204710f, 0.190463f), + diffuse_brightness_front: 1.0f, + reflection_roughness_front: 0.22f, + imperfections_dust: 0.074f, + imperfections_grunge: 0.124f, + imperfections_smudges: 0.342f, + color_back_leather: color(0.751895f,0.579547f,0.573159f), + color_brightness_back: 0.2f, + reflection_roughness_back: 0.533f, + dirt_back_on_off: true, + dirt_color: color(0.592438f, 0.124741f, 0.069727f), + softness: 0.801f, + position: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Leather/Suede_Leather.mdl b/code/third_party/vMaterials_2/Leather/Suede_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d330b2b0bab4b9978d587c62192c575c56e2a569 --- /dev/null +++ b/code/third_party/vMaterials_2/Leather/Suede_Leather.mdl @@ -0,0 +1,1579 @@ +/****************************************************************************** + * 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 suede leather material"; +const string DESCRIPTION_PUNCHED = "A suede leather material with punched holes. Various shapes for the punching such as circles, lines, rectangles and squares can be chosen."; + +annotation preview_scale( float f); + + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Choose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=float2(0.5f) +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += float2(0.5f); + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + + +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); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float3 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 1 + float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; + float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; + float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization + float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization + */ + + // 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 Suede_Leather( + 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 bump_strength = 0.4f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.101145f, 0.263175f, 0.493616f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.1f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float dust = 1.f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float grunge = 0.8f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges = 0.4f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back_leather = color(0.014311f, 0.038473f, 0.071761f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.6f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.845f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = true [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023f, 0.023f, 0.023f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float softness = 1.f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float position_1 = 0.5f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::in_group("Transform") + ]], + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Suede Leather - Dark Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "suede", "natural", "bumped", "interior", "cloth", "soft", "rough", "blue", "cool", "cold", "dark")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather.png") +]] + = + let { + float2 texture_scale_rescaled = texture_scale / 8.0f; + bool tmp0 = true; + + texture_2d rough_dirt_height_tex = texture_2d("./textures/suede_leather_front_multi_rough_dirt_height.jpg", ::tex::gamma_linear); + texture_2d dust_grunge_leather_tex = texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear); + texture_2d front_diff_lin_tex = texture_2d("./textures/suede_leather_front_diff.jpg", ::tex::gamma_linear); + texture_2d front_diff_srgb_tex = texture_2d("./textures/suede_leather_front_diff.jpg", ::tex::gamma_srgb); + texture_2d front_norm_tex = texture_2d("./textures/suede_leather_front_norm.jpg", ::tex::gamma_linear); + texture_2d back_rough_ao_height_tex = texture_2d("./textures/suede_leather_back_multi_rough_ao_height.jpg", ::tex::gamma_linear); + texture_2d back_diff_lin_tex = texture_2d("./textures/suede_leather_back_diff.jpg", ::tex::gamma_linear); + texture_2d back_diff_srgb_tex = texture_2d("./textures/suede_leather_back_diff.jpg", ::tex::gamma_srgb); + texture_2d back_norm_tex = texture_2d("./textures/suede_leather_back_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, position_1) - softness, ::math::lerp(1.f, 0.f, position_1) + softness, float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.644999981f, 0.474000007f, 0.771000028f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.644999981f, 0.474000007f, 0.771000028f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.5f, 0.600000024f), ::df::microfacet_ggx_smith_bsdf(((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.644999981f, 0.474000007f, 0.771000028f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.300000012f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.644999981f, 0.474000007f, 0.771000028f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.300000012f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * smudges), ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.644999981f, 0.474000007f, 0.771000028f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.300000012f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.644999981f, 0.474000007f, 0.771000028f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.701000035f, ::math::lerp(0.300000012f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * smudges), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_front, (infinite_tiling ? endless_texture(front_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.55400002f), 8.f, true) : ::base::file_texture(front_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 3.f, diffuse_brightness_front)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.644999981f, 0.474000007f, 0.771000028f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.82100004f, 0.824000061f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.504000008f, 0.500999987f, 0.986999989f), 8.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.504000008f, 0.500999987f, 0.986999989f), 8.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2(dirt_back_on_off ? ::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, position_1) - softness, ::math::lerp(1.f, 0.f, position_1) + softness, float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.644999981f, 0.474000007f, 0.771000028f), 8.f, false) : ::base::file_texture(rough_dirt_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back_leather, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.612999976f), 8.f, true) : ::base::file_texture(back_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()) : ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.337000012f, 0.559000015f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back_leather, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.612999976f), 8.f, true) : ::base::file_texture(back_diff_srgb_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(back_rough_ao_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.790000021f, 0.910000026f, 0.792999983f), 8.f, false) : ::base::file_texture(back_rough_ao_height_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Suede_Leather_Black(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Suede Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "suede", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "black", "dark", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Black.png") +]] += Suede_Leather +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.009021f, 0.009021f, 0.009021f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.034230f, 0.034230f, 0.034230f), + diffuse_brightness_back: 0.25f, + reflection_roughness_back: 0.89f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + softness: 0.75f, + position_1: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Suede_Leather_Chocolate_Brown(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Suede Leather - Chocolate Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "brown", "chocolate", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Chocolate_Brown.png") +]] += Suede_Leather +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.109f, 0.0278f, 0.0265f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.130f,0.084f,0.068f), + diffuse_brightness_back: 0.25f, + reflection_roughness_back: 0.89f, + dirt_back_on_off: true, + dirt_color: color(0.082f, 0.025f, 0.010f), + softness: 0.75f, + position_1: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Suede_Leather_Medium_Brown(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Suede Leather - Medium Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "medium", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "brown")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Medium_Brown.png") +]] += Suede_Leather +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.284452f, 0.098689f, 0.012664f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.329729f,0.193972f,0.098689f), + diffuse_brightness_back: 0.35f, + reflection_roughness_back: 1.0f, + dirt_back_on_off: true, + dirt_color: color(0.238828f, 0.047776f, 0.009696f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Suede_Leather_Beige(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Suede Leather - Beige"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "beige", "brown", "warm", "light")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Beige.png") +]] += Suede_Leather +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.652f, 0.592f, 0.5f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.652370f,0.560499f,0.420508f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.9f, + dirt_back_on_off: true, + dirt_color: color(0.101145f, 0.078057f, 0.041452f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Suede_Leather_Light_Blue(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Suede Leather - Light Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "light", "pastel", "blue", "cold", "cool")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Light_Blue.png") +]] += Suede_Leather +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.431340f, 0.592438f, 0.659224f), + diffuse_brightness_front: 0.3f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.722672f,0.766744f,0.781751f), + diffuse_brightness_back: 0.124f, + reflection_roughness_back: 0.9f, + dirt_back_on_off: true, + dirt_color: color(0.101145f, 0.078057f, 0.041452f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Suede_Leather_Turquoise(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Suede Leather - Turquoise"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "cold", "turquoise", "cool")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Turquoise.png") +]] += Suede_Leather +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.271577f, 0.459080f, 0.476177f), + diffuse_brightness_front: 0.35f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.288816f,0.394083f,0.399293f), + diffuse_brightness_back: 0.45f, + reflection_roughness_back: 0.9f, + dirt_back_on_off: true, + dirt_color: color(0.101145f, 0.078057f, 0.041452f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Suede_Leather_Blue(*) + [[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Suede Leather - Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "blue", "cold", "cool")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Blue.png") +]] += Suede_Leather +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.012664f, 0.116576f, 0.388910f), + diffuse_brightness_front: 0.33f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.020951f,0.101145f,0.246800f), + diffuse_brightness_back: 0.5f, + reflection_roughness_back: 0.9f, + dirt_back_on_off: true, + dirt_color: color(0.101145f, 0.078057f, 0.041452f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + + + +// ----------------- Punched Leather ----------------- +export material Suede_Leather_Punched( + +// Leather 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") + ]], + float bump_strength = 0.4f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_front = color(0.101145f, 0.263175f, 0.493616f) [[ + ::anno::description("Choose the color of the front side."), + ::anno::display_name("Color Front"), + ::anno::in_group("Appearance", "Front") + ]], + float diffuse_brightness_front = 0.1f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_front = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Front"), + ::anno::in_group("Appearance", "Front"), + ::anno::hard_range(0.f, 1.f) + ]], + float dust = 1.f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Dust"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float grunge = 0.8f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Grunge"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges = 0.4f [[ + ::anno::description("Adds specular variation to the roughness."), + ::anno::display_name("Imperfection Smudges"), + ::anno::in_group("Appearance", "Front", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + color color_back_leather = color(0.014311f, 0.038473f, 0.071761f) [[ + ::anno::description("Choose the color of the back side."), + ::anno::display_name("Color Back"), + ::anno::in_group("Appearance", "Back") + ]], + float diffuse_brightness_back = 0.6f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness_back = 0.845f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness Back"), + ::anno::in_group("Appearance", "Back"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool dirt_back_on_off = true [[ + ::anno::description("Switch on and off the dirt layer on the backside."), + ::anno::display_name("Dirt Back"), + ::anno::in_group("Appearance", "Dirt") + ]], + color dirt_color = color(0.023f, 0.023f, 0.023f) [[ + ::anno::description("Choose the color of the dirt layer."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance", "Dirt") + ]], + float softness = 1.f [[ + ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), + ::anno::display_name("Dirt Softness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + float position_1 = 0.5f [[ + ::anno::description("Adjust the intensity through position."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f) + ]], + 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) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 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)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(9) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(10) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(11) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(13) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(14) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(15) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(16) + ]], + uniform bool round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(17) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(18) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("round_corners==true"), + ::anno::ui_order(19) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Suede Leather - Dark Blue Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "suede", "dielectric", "automotive", "punched", "design", "ABS", "artifical", "soft", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = let +{ + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = Suede_Leather( + infinite_tiling: infinite_tiling, + bump_strength: bump_strength, + color_front: color_front, + diffuse_brightness_front: diffuse_brightness_front, + reflection_roughness_front: reflection_roughness_front, + dust: dust, + grunge: grunge, + smudges: smudges, + color_back_leather: color_back_leather, + diffuse_brightness_back: diffuse_brightness_back, + reflection_roughness_back: reflection_roughness_back, + dirt_back_on_off: dirt_back_on_off, + dirt_color: dirt_color, + softness: softness, + position_1: position_1, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + round_corners: round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./textures/leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + backface: material_surface( + scattering: base_mat.backface.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 Suede_Leather_Black_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Suede Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "suede", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "black", "dark", "neutral")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Black_Punched.png") +]] += Suede_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.009021f, 0.009021f, 0.009021f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.034230f, 0.034230f, 0.034230f), + diffuse_brightness_back: 0.25f, + reflection_roughness_back: 0.89f, + dirt_back_on_off: true, + dirt_color: color(0.067725f, 0.067725f, 0.067725f), + softness: 0.75f, + position_1: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Suede_Leather_Chocolate_Brown_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Suede Leather - Chocolate Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "brown", "chocolate", "warm")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Chocolate_Brown_Punched.png") +]] += Suede_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.109f, 0.0278f, 0.0265f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.130f,0.084f,0.068f), + diffuse_brightness_back: 0.25f, + reflection_roughness_back: 0.89f, + dirt_back_on_off: true, + dirt_color: color(0.082f, 0.025f, 0.010f), + softness: 0.75f, + position_1: 0.3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Suede_Leather_Medium_Brown_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Suede Leather - Medium Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "medium", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "brown")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Medium_Brown_Punched.png") +]] += Suede_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.284452f, 0.098689f, 0.012664f), + diffuse_brightness_front: 0.25f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.329729f,0.193972f,0.098689f), + diffuse_brightness_back: 0.35f, + reflection_roughness_back: 1.0f, + dirt_back_on_off: true, + dirt_color: color(0.238828f, 0.047776f, 0.009696f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Suede_Leather_Beige_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Suede Leather - Beige Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "beige", "brown", "warm", "light")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Beige_Punched.png") +]] += Suede_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.652f, 0.592f, 0.5f), + diffuse_brightness_front: 0.2f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.652370f,0.560499f,0.420508f), + diffuse_brightness_back: 0.2f, + reflection_roughness_back: 0.9f, + dirt_back_on_off: true, + dirt_color: color(0.101145f, 0.078057f, 0.041452f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Suede_Leather_Light_Blue_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Suede Leather - Light Blue Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "light", "pastel", "blue", "cold", "cool")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Light_Blue_Punched.png") +]] += Suede_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.431340f, 0.592438f, 0.659224f), + diffuse_brightness_front: 0.3f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.722672f,0.766744f,0.781751f), + diffuse_brightness_back: 0.124f, + reflection_roughness_back: 0.9f, + dirt_back_on_off: true, + dirt_color: color(0.101145f, 0.078057f, 0.041452f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Suede_Leather_Turquoise_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Suede Leather - Turquoise Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "cold", "turquoise", "cool")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Turquoise_Punched.png") +]] += Suede_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.271577f, 0.459080f, 0.476177f), + diffuse_brightness_front: 0.35f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.288816f,0.394083f,0.399293f), + diffuse_brightness_back: 0.45f, + reflection_roughness_back: 0.9f, + dirt_back_on_off: true, + dirt_color: color(0.101145f, 0.078057f, 0.041452f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Suede_Leather_Blue_Punched(*) + [[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("Suede Leather - Blue Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "blue", "cold", "cool")), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Suede_Leather.Suede_Leather_Blue_Punched.png") +]] += Suede_Leather_Punched +( + infinite_tiling: true, + bump_strength: 0.8f, + color_front: color(0.012664f, 0.116576f, 0.388910f), + diffuse_brightness_front: 0.33f, + reflection_roughness_front: 0.65f, + dust: 0.475f, + grunge: 0.108f, + smudges: 0.281f, + color_back_leather: color(0.020951f,0.101145f,0.246800f), + diffuse_brightness_back: 0.5f, + reflection_roughness_back: 0.9f, + dirt_back_on_off: true, + dirt_color: color(0.101145f, 0.078057f, 0.041452f), + softness: 0.85f, + position_1: 0.2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + round_corners: false, + radius: 1.5f, + across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Masonry/Facade_Brick_Grey.mdl b/code/third_party/vMaterials_2/Masonry/Facade_Brick_Grey.mdl new file mode 100644 index 0000000000000000000000000000000000000000..187e0b73a5ecedc2b8e0a90c512584d6de282f1e --- /dev/null +++ b/code/third_party/vMaterials_2/Masonry/Facade_Brick_Grey.mdl @@ -0,0 +1,228 @@ +/****************************************************************************** + * 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"; + + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::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 Facade_Brick_Grey( + float diffuse_brightness = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_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 grout_occlusion = 0.5f [[ + ::anno::description("It darkens the grout like self shadowing."), + ::anno::display_name("Grout Occlusion"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float bump_strength = 0.8f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f) + ]], + 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(2.0f, 2.0f)), + ::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("Facade Brick Grey"), + ::anno::description("A glaced brick material for elegant facade constructions."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Facade_Brick_Grey.Facade_Brick_Grey.png"), + ::anno::key_words(string[]("aec", "brick", "wall", "floor", "facade", "glaced", "construction", "exterior", "tiles", "tiling", "rough", "bumped")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(::base::file_texture(texture_2d("./textures/bricks_grey_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.35f, 0.7f, reflection_roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/bricks_grey_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.35f, 0.7f, reflection_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/bricks_grey_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.35f, 0.7f, reflection_roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/bricks_grey_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.35f, 0.7f, reflection_roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/bricks_grey_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(::math::lerp(0.360000003f, 1.f, diffuse_brightness)), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(float3(::base::file_texture(texture_2d("./textures/bricks_grey_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_multiply, ::math::lerp(0.f, 2.f, grout_occlusion)).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, + normalmap_normal(texture_2d("./textures/bricks_grey_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 1.29999995f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +export material Facade_Brick_Bright(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Facade Brick Grey - Bright"), + ::anno::description("A glaced brick material for elegant facade constructions."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Facade_Brick_Grey.Facade_Brick_Bright.png"), + ::anno::key_words(string[]("aec", "brick", "wall", "floor", "facade", "glaced", "construction", "exterior", "tiles", "tiling", "rough", "bumped")) +]] + = Facade_Brick_Grey( + diffuse_brightness: 1.0f, + reflection_roughness: 0.641f, + grout_occlusion: 0.744, + bump_strength: 0.7, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Facade_Brick_Glaced(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Facade Brick Grey - Glaced"), + ::anno::description("A glaced brick material for elegant facade constructions."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Facade_Brick_Grey.Facade_Brick_Glaced.png"), + ::anno::key_words(string[]("aec", "brick", "wall", "floor", "facade", "glaced", "construction", "exterior", "tiles", "tiling", "rough", "bumped")) +]] + = Facade_Brick_Grey( + diffuse_brightness: 1.0f, + reflection_roughness: 0.2f, + grout_occlusion: 0.1, + bump_strength: 0.5, + 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/Masonry/Facade_Brick_Red_Clinker.mdl b/code/third_party/vMaterials_2/Masonry/Facade_Brick_Red_Clinker.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cb434b17825e8d522f201fa0d0cde1f07071ab23 --- /dev/null +++ b/code/third_party/vMaterials_2/Masonry/Facade_Brick_Red_Clinker.mdl @@ -0,0 +1,482 @@ +/****************************************************************************** + * 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"; + + + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + 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_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 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); +} + + +export material Facade_Brick_Red_Clinker( + float grime_weight = 0.f [[ + ::anno::display_name("Grime Weight"), + ::anno::description("Applied slight grime and dirt on top of the material to give it a worn, aged appearance."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float bricks_brightness = 0.276000023f [[ + ::anno::display_name("Bricks Brightness"), + ::anno::description("Adjusts the brightness of the bricks."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Bricks") + ]], + float leaks_weight = 0.f [[ + ::anno::display_name("Leaks weight"), + ::anno::description("Adds small leaks to the material."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Bricks") + ]], + color leak_color = color(0.0476929992f, 0.306998998f, 0.0575760007f) [[ + ::anno::display_name("Leaks Color"), + ::anno::description("Adjusts the color of the leaks."), + ::anno::in_group("Appearance", "Bricks") + ]], + float paint_transition = 0.f [[ + ::anno::display_name("Paint Height"), + ::anno::description("Adds paint to the material, depending on the value of this parameter the paint is gradually applied."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Paint") + ]], + color paint_color = color(0.522521973f, 0.327468991f, 0.0592540018f) [[ + ::anno::display_name("Paint Color"), + ::anno::description("Sets the color of the paint."), + ::anno::in_group("Appearance", "Paint") + ]], + uniform float paint_stroke_amount = 0.6f [[ + ::anno::display_name("Paint Bump Strength"), + ::anno::description("Adjusts the bumpiness of the paint strokes."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Paint") + ]], + float paint_roughness = 0.5f [[ + ::anno::display_name("Paint Reflectivity"), + ::anno::description("Adjusts the reflectivity of the paint applied on top of the bricks."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Paint") + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::display_name("Translation"), + ::anno::description("Offsets position of the material."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the material."), + ::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.0f, 1.0f)), + ::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::display_name("Brick Clinker"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "red", "warm")), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.f, 1.f, 5.f, ::math::lerp(1.f, float3(::base::file_texture(texture_2d("./textures/clinker_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], grime_weight), ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_pos_range(::base::file_texture(texture_2d("./textures/painted_wall_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.275450021f, ::math::lerp(0.0799999982f, 0.920000017f, paint_roughness)), ::math::lerp(1.f, histogram_range(::base::file_texture(texture_2d("./textures/clinker_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.468000025f, 0.879000068f), float3(::base::file_texture(texture_2d("./textures/clinker_mask_multi_R_rnd_color_G_grout_B_leaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/clinker_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.117000006f, ::math::lerp(0.0900000036f, 0.68900001f, paint_transition))) * ::math::lerp(histogram_pos_range(::base::file_texture(texture_2d("./textures/painted_wall_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.275450021f, ::math::lerp(0.0799999982f, 0.920000017f, paint_roughness)), ::math::lerp(1.f, histogram_range(::base::file_texture(texture_2d("./textures/clinker_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.468000025f, 0.879000068f), float3(::base::file_texture(texture_2d("./textures/clinker_mask_multi_R_rnd_color_G_grout_B_leaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/clinker_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.117000006f, ::math::lerp(0.0900000036f, 0.68900001f, paint_transition))), ::math::lerp(histogram_pos_range(::base::file_texture(texture_2d("./textures/painted_wall_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.275450021f, ::math::lerp(0.0799999982f, 0.920000017f, paint_roughness)), ::math::lerp(1.f, histogram_range(::base::file_texture(texture_2d("./textures/clinker_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.468000025f, 0.879000068f), float3(::base::file_texture(texture_2d("./textures/clinker_mask_multi_R_rnd_color_G_grout_B_leaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/clinker_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.117000006f, ::math::lerp(0.0900000036f, 0.68900001f, paint_transition))) * ::math::lerp(histogram_pos_range(::base::file_texture(texture_2d("./textures/painted_wall_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.275450021f, ::math::lerp(0.0799999982f, 0.920000017f, paint_roughness)), ::math::lerp(1.f, histogram_range(::base::file_texture(texture_2d("./textures/clinker_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.468000025f, 0.879000068f), float3(::base::file_texture(texture_2d("./textures/clinker_mask_multi_R_rnd_color_G_grout_B_leaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/clinker_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.117000006f, ::math::lerp(0.0900000036f, 0.68900001f, paint_transition))), 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(paint_color, ::nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/clinker_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(::math::lerp(0.5f, 0.800000012f, bricks_brightness)), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, ::nvidia::core_definitions::blend_colors(leak_color, color(1.f, 1.f, 1.f), ::base::color_layer_blend, ::math::pow(float3(::base::file_texture(texture_2d("./textures/clinker_mask_multi_R_rnd_color_G_grout_B_leaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f)).tint, ::base::color_layer_multiply, leaks_weight).tint, ::base::color_layer_blend, histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/clinker_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.117000006f, ::math::lerp(0.0900000036f, 0.68900001f, paint_transition))).tint, color(float3(::base::file_texture(texture_2d("./textures/clinker_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_multiply, grime_weight).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, + ::math::normalize(::math::lerp(::base::file_bump_texture(texture_2d("./textures/clinker_paint_stroke_bump.jpg", ::tex::gamma_linear), ::math::lerp(1.f, 8.f, paint_stroke_amount), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, ::state::normal(), false), normalmap_normal(texture_2d("./textures/clinker_norm.jpg", ::tex::gamma_linear), 1.29999995f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)), histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/clinker_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.207000017f, ::math::lerp(0.259000003f, 0.462000012f, paint_transition))))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + +export material Facade_Brick_Red_Clinker_Mossy_Leaking(*) +[[ + ::anno::display_name("Brick Clinker - Mossy Leaks"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "red" )), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Mossy_Leaking.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 1.0f, + bricks_brightness: 0.5f, + leaks_weight: 1.0f, + leak_color: color(0.044553f, 0.311180f, 0.054592f), + paint_transition: 0.0f, + paint_color: color(0.0f), + paint_stroke_amount: 0.418f, + paint_roughness: 0.5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Facade_Brick_Red_Clinker_Slightly_Painted(*) +[[ + ::anno::display_name("Brick Clinker - Slightly Painted"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "red", "white" )), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Slightly_Painted.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 0.05f, + bricks_brightness: 0.3f, + leaks_weight: 0.0f, + leak_color: color(0.0f), + paint_transition: 0.45f, + paint_color: color(0.529523f), + paint_stroke_amount: 0.418f, + paint_roughness: 0.65f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Facade_Brick_Red_Clinker_Painted_White(*) +[[ + ::anno::display_name("Brick Clinker - Painted White"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "red", "white" )), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_White.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 0.0f, + bricks_brightness: 0.3f, + leaks_weight: 0.0f, + leak_color: color(0.0f), + paint_transition: 0.91f, + paint_color: color(0.529523f), + paint_stroke_amount: 0.418f, + paint_roughness: 0.52f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Facade_Brick_Red_Clinker_Sloppy_Paint_Job(*) +[[ + ::anno::display_name("Brick Clinker - Sloppy Paint Job"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "white", "neutral" )), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Sloppy_Paint_Job.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 0.0f, + bricks_brightness: 0.3f, + leaks_weight: 0.0f, + leak_color: color(0.0f), + paint_transition: 0.695f, + paint_color: color(0.529523f), + paint_stroke_amount: 1.0f, + paint_roughness: 0.65f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Facade_Brick_Red_Clinker_Dirty_Paint(*) +[[ + ::anno::display_name("Brick Clinker - Dirty Paint"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "white", "dirty" )), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Dirty_Paint.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 0.85f, + bricks_brightness: 0.3f, + leaks_weight: 0.0f, + leak_color: color(0.0f), + paint_transition: 0.91, + paint_color: color(0.529523f), + paint_stroke_amount: 0.418f, + paint_roughness: 0.65f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Facade_Brick_Red_Clinker_Painted_Yellow(*) +[[ + ::anno::display_name("Brick Clinker - Painted Yellow"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "yellow", "warm")), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_Yellow.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 0.0f, + bricks_brightness: 0.3f, + leaks_weight: 0.0f, + leak_color: color(0.0f), + paint_transition: 0.91, + paint_color: color(0.529523f, 0.373615f, 0.101145f), + paint_stroke_amount: 0.418f, + paint_roughness: 0.65f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Facade_Brick_Red_Clinker_Painted_Terracotta(*) +[[ + ::anno::display_name("Brick Clinker - Painted Terracotta"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "terracotta", "warm")), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_Terracotta.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 0.2f, + bricks_brightness: 0.3f, + leaks_weight: 0.0f, + leak_color: color(0.0f), + paint_transition: 0.91, + paint_color: color(0.404541f, 0.116576f, 0.047776f), + paint_stroke_amount: 0.45f, + paint_roughness: 0.75f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Facade_Brick_Red_Clinker_Painted_Cool_Green(*) +[[ + ::anno::display_name("Brick Clinker - Cool Green"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "green")), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_Cool_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 0.2f, + bricks_brightness: 0.3f, + leaks_weight: 0.0f, + leak_color: color(0.0f), + paint_transition: 0.91, + paint_color: color(0.144972f, 0.280124f, 0.170138f), + paint_stroke_amount: 0.418f, + paint_roughness: 0.6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Facade_Brick_Red_Clinker_Painted_Aqua_Blue(*) +[[ + ::anno::display_name("Brick Clinker - Aqua Blue"), + ::anno::description("A red brick wall material made out of clinker. Features additional controls for adding leaks and a layer of paint on top of the material."), + ::anno::author("NVIDIA Corporation"), + ::anno::created(2020, 5, 6, ""), + ::anno::key_words(string[]("aec", "bricks", "brickwall", "clinker", "paint", "wall", "rough", "architecture", "multimaterial", "construction", "interior", "exterior", "leak", "blue", "aqua", "cool")), + ::anno::thumbnail("./.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_Aqua_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Facade_Brick_Red_Clinker( + grime_weight: 0.2f, + bricks_brightness: 0.3f, + leaks_weight: 0.0f, + leak_color: color(0.0f), + paint_transition: 0.91, + paint_color: color(0.141980f, 0.394083f, 0.470440f), + paint_stroke_amount: 0.418f, + paint_roughness: 0.6f, + 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/Masonry/Sandstone_Brick_Vintage.mdl b/code/third_party/vMaterials_2/Masonry/Sandstone_Brick_Vintage.mdl new file mode 100644 index 0000000000000000000000000000000000000000..77da904b7a44c8053a680d1498bc97127967ef63 --- /dev/null +++ b/code/third_party/vMaterials_2/Masonry/Sandstone_Brick_Vintage.mdl @@ -0,0 +1,295 @@ +/****************************************************************************** + * 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"; + + +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)); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_small(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(0.0, 1.0 - width, position), + ::math::lerp(width, 1.0 , position)), + 0.0, + 1.0); +} + +export material Sandstone_Brick_Vintage( + color diffuse_color = color(0.409826f) [[ + ::anno::description("Adjusts the diffuse color."), + ::anno::display_name("Diffuse Tint"), + ::anno::in_group("Appearance") + ]], + float diffuse_brightness = 1.f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Diffuse Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.964000046f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float 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) + ]], + float deposit_amount = 0.f [[ + ::anno::description("Adjusts the amount of dirt deposit on top of the material."), + ::anno::display_name("Deposit Amount"), + ::anno::in_group("Appearance", "Deposit") + ]], + color deposit_color = color(0.009021f, 0.051122f, 0.197516f) [[ + ::anno::description("Choose the color of the deposit."), + ::anno::display_name("Deposit Color"), + ::anno::in_group("Appearance", "Deposit") + ]], + 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(1.0, 1.0)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform") + ]], + uniform bool 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("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = true [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]]) +[[ + ::anno::description("A rough vintage yellowish sandstone brick wall material."), + ::anno::in_group("Masonry"), + ::anno::display_name("Sandstone Brick Vintage"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Sandstone_Brick_Vintage.Sandstone_Brick_Vintage.png"), + ::anno::key_words(string[]("stone", "wall", "brick", "rock", "construction", "exterior", "vintage", "rough", "worn", "yellow", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/sandstone_brick_R_ao_G_rough_B_wear.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.660000026f, 0.649999976f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(::base::file_texture(texture_2d("./textures/sandstone_brick_R_ao_G_rough_B_wear.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_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.600000024f, 1.f, roughness), ::math::lerp(0.600000024f, 0.800000012f, roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/sandstone_brick_R_ao_G_rough_B_wear.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_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.600000024f, 1.f, roughness), ::math::lerp(0.600000024f, 0.800000012f, roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/sandstone_brick_R_ao_G_rough_B_wear.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_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.600000024f, 1.f, roughness), ::math::lerp(0.600000024f, 0.800000012f, roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/sandstone_brick_R_ao_G_rough_B_wear.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_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.600000024f, 1.f, roughness), ::math::lerp(0.600000024f, 0.800000012f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(deposit_color, ::base::file_texture(texture_2d("./textures/sandstone_brick_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(::math::lerp(0.641000032f, 1.f, diffuse_brightness)), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, ::base::color_layer_blend, histogram_range(float3(::base::file_texture(texture_2d("./textures/sandstone_brick_R_ao_G_rough_B_wear.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 1.f, ::math::lerp(1.f, 0.632000029f, deposit_amount))).tint, diffuse_color, ::base::color_layer_overlay, 1.f).tint, 0.f), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./textures/sandstone_brick_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/sandstone_brick_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(radius * 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 Sandstone_Brick_Vintage_Red_Deposit(*) +[[ + ::anno::description("A rough vintage sandstone brick wall material with a reddish deposit."), + ::anno::in_group("Masonry"), + ::anno::display_name("Sandstone Brick Red Deposit"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Sandstone_Brick_Vintage.Sandstone_Brick_Vintage_Red_Deposit.png"), + ::anno::key_words(string[]("stone", "wall", "brick", "rock", "construction", "exterior", "deposit", "vintage", "rough", "worn", "yellow", "warm", "red", "deposit")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = Sandstone_Brick_Vintage( + diffuse_color: color(0.48f), + diffuse_brightness: 1.0f, + roughness: 0.5f, + bump_strength: 1.0f, + deposit_amount: 0.87f, + deposit_color: color(0.49363f, 0.15831f, 0.15831f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + radius: 1.5f, + across_materials: false +); + + +export material Sandstone_Brick_Vintage_Black_Deposit(*) +[[ + ::anno::description("A rough vintage sandstone brick wall material with a gray deposit."), + ::anno::in_group("Masonry"), + ::anno::display_name("Sandstone Brick Black Deposit"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Sandstone_Brick_Vintage.Sandstone_Brick_Vintage_Black_Deposit.png"), + ::anno::key_words(string[]("stone", "wall", "brick", "rock", "construction", "exterior", "deposit", "vintage", "rough", "worn", "yellow", "warm", "black", "deposit")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = Sandstone_Brick_Vintage( + diffuse_color: color(0.48f), + diffuse_brightness: 1.0f, + roughness: 0.25f, + bump_strength: 1.0f, + deposit_amount: 0.87f, + deposit_color: color(0.002932f, 0.084642f, 0.124741), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + radius: 1.5f, + across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/NVIDIA_VMATERIALS_2_VERSION.txt b/code/third_party/vMaterials_2/NVIDIA_VMATERIALS_2_VERSION.txt new file mode 100644 index 0000000000000000000000000000000000000000..10ab95197266249ef018d6756703148a9bcf90e8 --- /dev/null +++ b/code/third_party/vMaterials_2/NVIDIA_VMATERIALS_2_VERSION.txt @@ -0,0 +1 @@ +This is NVIDIA vMaterials Version 2.4.0 (Build 373000.4039) \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Paper/Cardboard.mdl b/code/third_party/vMaterials_2/Paper/Cardboard.mdl new file mode 100644 index 0000000000000000000000000000000000000000..78156257ea4273f98ed98f7b571a50d5e193d877 --- /dev/null +++ b/code/third_party/vMaterials_2/Paper/Cardboard.mdl @@ -0,0 +1,365 @@ +/****************************************************************************** + * 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 ::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; +} + + +export material Cardboard( + // Appearance Group + float brightness = .6f + [[ + ::anno::display_name("Cardboard Brightness"), + ::anno::description("Brightness of the cardboard."), + ::anno::hard_range(0.0f,1.f), + ::anno::in_group("Appearance") + ]], + float reflectivity = .35f + [[ + ::anno::display_name("Reflection weight"), + ::anno::description("Strength of cardboard reflectivity."), + ::anno::hard_range(0.0f,1.f), + ::anno::in_group("Appearance") + ]], + uniform float bump_amount = 0.3f + [[ + ::anno::display_name("Bumps"), + ::anno::description("Attach bump or normal maps here."), + ::anno::hard_range(0.0f,1.f), + ::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::hard_range(0, 3) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Cardboard New"), + ::anno::description("A cardboard material."), + ::anno::created(2019, 5, 5, ""), + ::anno::key_words(string[]("paper", "cardboard", "box", "mailbox", "carton", "card", "new")), + ::anno::thumbnail("./.thumbs/Cardboard.Cardboard.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = let{ + uniform texture_2d diffuse_texture = texture_2d("./textures/cardboard_new_01_diff.jpg", ::tex::gamma_srgb); + uniform texture_2d roughness_texture = texture_2d("./textures/cardboard_new_01_rough.jpg", ::tex::gamma_srgb); + uniform texture_2d normal_texture = texture_2d("./textures/cardboard_new_01_norm.jpg", ::tex::gamma_linear); + + ::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(2.5f/texture_scale.x, 2.5f/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 + ); + + float roughness_lookup = ::base::file_texture( + texture: roughness_texture, + 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; + + color diffuse_lookup = ::base::file_texture( + texture: diffuse_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(brightness), + mono_source: ::base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint; + + // Normal lookup + float3 the_normal = ::base::tangent_space_normal_texture( + texture: normal_texture, + factor: bump_amount, + uvw: transformed_uvw, + flip_tangent_u: false, + flip_tangent_v: false + ); + + bsdf diffuse_bsdf = ::df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_lookup + ); + + bsdf glossy_bsdf = ::df::microfacet_ggx_smith_bsdf( + mode: ::df::scatter_reflect, + tint: color(1.), + roughness_u: roughness_lookup, + roughness_v: roughness_lookup + ); + + bsdf custom_curve_layer_bsdf = ::df::custom_curve_layer( + normal_reflectivity: 0.08 * reflectivity, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: 1.0, + layer: glossy_bsdf, + base: diffuse_bsdf + ); + +} +in material( + thin_walled: true, + surface: material_surface( + scattering: custom_curve_layer_bsdf + ), + geometry: material_geometry( + normal: the_normal + ) +); + + +export material Cardboard_Worn( + float brightness = .6 + [[ + ::anno::display_name("Cardboard Brightness"), + ::anno::hard_range(0.0,1.), + ::anno::description("Brightness of the cardboard.") + ]], + float reflectivity = 0.6 + [[ + ::anno::display_name("Cardboard Reflectivity"), + ::anno::hard_range(0.0, 1.0), + ::anno::description("Strength of cardboard reflectivity.") + ]], + uniform float bump_amount = 0.3 + [[ + ::anno::display_name("Bump Amount"), + ::anno::description("The intensity of the cardboard bumpmap.") + ]], + + // 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."), + ::anno::in_group("Adjustments"), + ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)) + ]], + + //-----------------------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 vMaterials"), + ::anno::display_name("Cardboard Worn"), + ::anno::description("A worn cardboard material."), + ::anno::created(2019, 5, 5, ""), + ::anno::key_words(string[]("paper", "cardboard", "box", "mailbox", "carton", "card", "used", "worn", "dirty")), + ::anno::thumbnail("./.thumbs/Cardboard.Cardboard_Worn.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = let{ + uniform float ior = 1.4; + + uniform texture_2d diffuse_texture = texture_2d("./textures/cardboard_worn_01_diff.jpg", ::tex::gamma_srgb); + uniform texture_2d roughness_texture = texture_2d("./textures/cardboard_worn_01_rough.jpg", ::tex::gamma_srgb); + uniform texture_2d normal_texture = texture_2d("./textures/cardboard_worn_01_norm.jpg", ::tex::gamma_linear); + + ::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(2.5f/texture_scale.x, 2.5f/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 + ); + + float roughness_lookup = ::base::file_texture( + texture: roughness_texture, + 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; + + color diffuse_lookup = ::base::file_texture( + texture: diffuse_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(brightness), + mono_source: ::base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint; + + // Normal lookup + float3 the_normal = ::base::tangent_space_normal_texture( + texture: normal_texture, + factor: bump_amount, + uvw: transformed_uvw, + flip_tangent_u: false, + flip_tangent_v: false + ); + + + bsdf glossy_bsdf = ::df::simple_glossy_bsdf( + mode: ::df::scatter_reflect, + tint: color(1.), + roughness_u: roughness_lookup, + roughness_v: roughness_lookup + ); + +} +in material( + thin_walled: true, + surface: material_surface( + scattering: ::df::weighted_layer( + weight: 1., + normal: the_normal, + layer: ::df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: ::df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_lookup + ), + normal: the_normal + ) + ) + ) +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Paper/Cardboard_Low_Quality.mdl b/code/third_party/vMaterials_2/Paper/Cardboard_Low_Quality.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bec1a418f393de5cbae72f945ae842aac22a56ac --- /dev/null +++ b/code/third_party/vMaterials_2/Paper/Cardboard_Low_Quality.mdl @@ -0,0 +1,469 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA’s Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A paper material for cardboards"; + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float3 transform_internal_to_tangent(float3 n) +[[ + ::anno::hidden() +]] +{ + return + n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ + n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ + n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z); +} + +float3 transform_tangent_to_internal(float3 n) +[[ + ::anno::hidden() +]] +{ + return ::state::texture_tangent_u(0) * n.x + + ::state::texture_tangent_v(0) * n.y + + ::state::normal() * n.z ; +} + +float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +export material Cardboard_Low_Quality( + uniform float diffuse_brightness = 1.f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + uniform float reflection_roughness = 1.f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections on the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + uniform float reflection_variation = 0.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Reflection Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + uniform float dirt = 0.f [[ + ::anno::description("Adds a layer of dirt on the cardboard."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + uniform float corrugation_strength = 0.f [[ + ::anno::description("Adjusts the strength of the corrugation effect."), + ::anno::display_name("Corrugation Strength"), + ::anno::in_group("Appearance", "Corrugation"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float corrugation_variation = 0.f [[ + ::anno::description("Breaks up the corrugation by attenuating it at random places."), + ::anno::display_name("Corrugation Variation"), + ::anno::in_group("Appearance", "Corrugation"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.3f,0.3f)), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(9) + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters (mm)."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Cardboard Low Quality"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "brown", "yellow", "package", "delivery", "cardboard", "quality", "low", "cheap", "parcel")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), ::base::file_texture(texture_2d("./textures/cardboard_norm2_ao.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, ::base::color_layer_blend, float3(endless_texture(texture_2d("./textures/cardboard_normal_var.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.494118005f), 16.f, true))[0]).mono, ::df::microfacet_ggx_smith_bsdf((::math::lerp(reflection_variation * 0.199999988f, 0.189999998f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[2]) + histogram_range(float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[0], 0.310000002f, ::math::lerp(0.669999957f, 0.899999976f, reflection_roughness)) - ::math::lerp(::math::lerp(0.f, -1.f, dirt), 0.109999999f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1])) * (::math::lerp(reflection_variation * 0.199999988f, 0.189999998f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[2]) + histogram_range(float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[0], 0.310000002f, ::math::lerp(0.669999957f, 0.899999976f, reflection_roughness)) - ::math::lerp(::math::lerp(0.f, -1.f, dirt), 0.109999999f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1])), (::math::lerp(reflection_variation * 0.199999988f, 0.189999998f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[2]) + histogram_range(float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[0], 0.310000002f, ::math::lerp(0.669999957f, 0.899999976f, reflection_roughness)) - ::math::lerp(::math::lerp(0.f, -1.f, dirt), 0.109999999f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1])) * (::math::lerp(reflection_variation * 0.199999988f, 0.189999998f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[2]) + histogram_range(float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[0], 0.310000002f, ::math::lerp(0.669999957f, 0.899999976f, reflection_roughness)) - ::math::lerp(::math::lerp(0.f, -1.f, dirt), 0.109999999f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1])), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(color(::math::lerp(1.f, float3(endless_texture(texture_2d("./textures/lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1], ::math::lerp(0.f, 1.5f, dirt))) * ::base::file_texture(texture_2d("./textures/lq_simple_cardboard_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(diffuse_brightness), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, 0.f, ""), bsdf(), add_detail_normal(normalmap_normal(texture_2d("./textures/lq_simple_cardboard_norm.jpg", ::tex::gamma_linear), 0.217000008f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)), normalmap_normal(texture_2d("./textures/cardboard_norm_2.jpg", ::tex::gamma_linear), ::math::clamp((float3(endless_texture(texture_2d("./textures/cardboard_normal_var.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.494118005f), 16.f, true))[0] - 0.5f) * (corrugation_strength * 3.f * corrugation_variation) + corrugation_strength, 0.f, 10.f), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)))), add_detail_normal(normalmap_normal(texture_2d("./textures/lq_simple_cardboard_norm.jpg", ::tex::gamma_linear), 0.217000008f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)), normalmap_normal(texture_2d("./textures/cardboard_norm_2.jpg", ::tex::gamma_linear), ::math::clamp((float3(endless_texture(texture_2d("./textures/cardboard_normal_var.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.494118005f), 16.f, true))[0] - 0.5f) * (corrugation_strength * 3.f * corrugation_variation) + corrugation_strength, 0.f, 10.f), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? ::state::rounded_corner_normal(radius * 0.00499999989f, across_materials, 1.f) : ::state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Cardboard_Low_Quality_Dirt(*) +[[ + ::anno::display_name("Cardboard Low Quality Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "brown", "package", "delivery", "cardboard", "quality", "low", "cheap", "used", "parcel", "aged", "dirty")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Dirt.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Cardboard_Low_Quality +( + diffuse_brightness: 0.5f, + reflection_roughness: 0.5f, + reflection_variation: 1.f, + dirt: 0.6f, + corrugation_strength: 0.5f, + corrugation_variation: 1.f, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Cardboard_Low_Quality_Corrugation(*) +[[ + ::anno::display_name("Cardboard Low Quality Corrugation"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "brown", "corrugation", "package", "delivery", "cardboard", "quality", "low", "cheap", "used", "parcel", "aged")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Corrugation.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Cardboard_Low_Quality +( + diffuse_brightness: 1.f, + reflection_roughness: 0.f, + reflection_variation: 1.f, + dirt: 0.f, + corrugation_strength: 1.f, + corrugation_variation: 0.f, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Cardboard_Low_Quality_Used(*) +[[ + ::anno::display_name("Cardboard Low Quality Used"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "brown", "corrugation", "package", "delivery", "cardboard", "quality", "low", "cheap", "used", "parcel", "aged")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Used.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Cardboard_Low_Quality +( + diffuse_brightness: 0.8f, + reflection_roughness: 0.3f, + reflection_variation: 0.f, + dirt: 0.4f, + corrugation_strength: 1.f, + corrugation_variation: 0.6f, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Cardboard_Low_Quality_Burnt(*) +[[ + ::anno::display_name("Cardboard Low Quality Burnt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "black", "brown", "corrugation", "package", "delivery", "cardboard", "quality", "low", "cheap", "used", "parcel", "aged", "burnt")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Burnt.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Cardboard_Low_Quality +( + diffuse_brightness: 0.15f, + reflection_roughness: 0.f, + reflection_variation: 0.f, + dirt: 0.4f, + corrugation_strength: 1.f, + corrugation_variation: 1.f, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: true +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Paper/Paper_Plain.mdl b/code/third_party/vMaterials_2/Paper/Paper_Plain.mdl new file mode 100644 index 0000000000000000000000000000000000000000..557882b61c300caf01383ff992cfad5d5b071457 --- /dev/null +++ b/code/third_party/vMaterials_2/Paper/Paper_Plain.mdl @@ -0,0 +1,438 @@ +/****************************************************************************** + * 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 translucent paper material"; + +annotation preview_scale( float f); + + +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 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); + + 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)); +} + +// 1 +export material Paper_Plain( + color front_paper_color = color(0.729346991f, 0.729346991f, 0.729346991f) [[ + ::anno::display_name("Front Paper Color"), + ::anno::description("Defines the paper color."), + ::anno::in_group("Appearance", "Frontside"), + ::anno::ui_order(0) + ]], + float roughness_paper_front = 0.789999962f [[ + ::anno::display_name("Roughness Paper Frontside"), + ::anno::description("Defines the Roughness of the paper on the frontside."), + ::anno::in_group("Appearance", "Frontside"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float paper_translucency = 0.199999988f [[ + ::anno::display_name("Paper Translucency"), + ::anno::description("Adjusts the tranlucency of the paper. When translucency is raised, the print of the other side will shine through the material. The range realistic, do not make the paper more than 20 percent translucent (which corresponds to a value of 0.2). For the sake of creativity we gave the user the pssibility to control the full range though."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float translucent_paper_structure = 0.939999998f [[ + ::anno::display_name("Transmissive Fibers Amount"), + ::anno::description("When increasing this parameters, a paper fiber texture will appear as light is shining through the translucent material."), + ::anno::in_group(""), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float paper_bump_strength = 0.379999995f [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Defines the strength of the bump map for the paper."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform"), + ::anno::hard_range(-360.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(0.25f, 0.25f)), + ::preview_scale(2.5f), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(8) + ]] +) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Paper Plain"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Paper_Plain.Paper_Plain.png"), + ::anno::key_words(string[]("paper", "transparent", "office", "creative", "thin", "new", "bleached", "neutral", "light", "white")), + ::anno::author("NVIDIA vMaterials") +]] + = + let { + + //string normal_texture = "./textures/paper_plain_norm.jpg"; + //string trans_texture = "./textures/paper_plain_trans.jpg"; + //string rough_texture = "./textures/paper_plain_rough.jpg"; + + texture_2d rough_tex = texture_2d("./textures/paper_plain_rough.jpg", ::tex::gamma_linear); + texture_2d trans_tex = texture_2d("./textures/paper_plain_trans.jpg", ::tex::gamma_srgb); + texture_2d norm_tex = texture_2d("./textures/paper_plain_norm.jpg", ::tex::gamma_linear); + + bool tmp0 = true; + material_surface tmp1(::df::custom_curve_layer(0.08f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front) * histogram_range(::base::file_texture(rough_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).mono, 0.289999992f, roughness_paper_front), histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front) * histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(paper_translucency, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), ::base::file_texture(trans_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, ::base::color_layer_blend, translucent_paper_structure).tint), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(front_paper_color, 0.f), bsdf(), normalmap_normal(norm_tex, paper_bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), normalmap_normal(norm_tex, paper_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, ::state::rounded_corner_normal(0.0015f, false, 1.f)); + 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 Paper_Coldpressed_Watercolor( + color front_paper_color = color(0.729346991f, 0.729346991f, 0.729346991f) [[ + ::anno::display_name("Front Paper Color"), + ::anno::description("Defines the paper color."), + ::anno::in_group("Appearance", "Frontside"), + ::anno::ui_order(0) + ]], + float roughness_paper_front = 0.789999962f [[ + ::anno::display_name("Roughness Paper Frontside"), + ::anno::description("Defines the Roughness of the paper on the frontside."), + ::anno::in_group("Appearance", "Frontside"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float paper_translucency = 0.199999988f [[ + ::anno::display_name("Paper Translucency"), + ::anno::description("Adjusts the tranlucency of the paper. When translucency is raised, the print of the other side will shine through the material. The range realistic, do not make the paper more than 20 percent translucent (which corresponds to a value of 0.2). For the sake of creativity we gave the user the pssibility to control the full range though."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float translucent_paper_structure = 0.939999998f [[ + ::anno::display_name("Transmissive Fibers Amount"), + ::anno::description("When increasing this parameters, a paper fiber texture will appear as light is shining through the translucent material."), + ::anno::in_group(""), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float paper_bump_strength = 0.379999995f [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Defines the strength of the bump map for the paper."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform"), + ::anno::hard_range(-360.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(0.25f, 0.25f)), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(8) + ]] +) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Paper Coldpressed Watercolor"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Paper_Plain.Paper_Coldpressed_Watercolor.png"), + ::anno::key_words(string[]("paper", "transparent", "watercolor", "rough", "creative", "thin", "new", "bleached", "neutral", "light", "white")), + ::anno::author("NVIDIA vMaterials") +]] + = + let { + + //string normal_texture = "./textures/paper_coldpressed_3_norm.jpg"; + //string trans_texture = "./textures/paper_coldpressed_3_trans.jpg"; + //string rough_texture = "./textures/paper_plain_rough.jpg"; + + texture_2d rough_tex = texture_2d("./textures/paper_plain_rough.jpg", ::tex::gamma_linear); + texture_2d trans_tex = texture_2d("./textures/paper_coldpressed_3_trans.jpg", ::tex::gamma_srgb); + texture_2d norm_tex = texture_2d("./textures/paper_coldpressed_3_norm.jpg", ::tex::gamma_linear); + + bool tmp0 = true; + material_surface tmp1(::df::custom_curve_layer(0.08f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front) * histogram_range(::base::file_texture(rough_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).mono, 0.289999992f, roughness_paper_front), histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front) * histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(paper_translucency, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), ::base::file_texture(trans_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, ::base::color_layer_blend, translucent_paper_structure).tint), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(front_paper_color, 0.f), bsdf(), normalmap_normal(norm_tex, paper_bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), normalmap_normal(norm_tex, paper_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, ::state::rounded_corner_normal(0.0015f, false, 1.f)); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + +// 3 +export material Paper_Coldpressed( + color front_paper_color = color(0.729346991f, 0.729346991f, 0.729346991f) [[ + ::anno::display_name("Front Paper Color"), + ::anno::description("Defines the paper color."), + ::anno::in_group("Appearance", "Frontside"), + ::anno::ui_order(0) + ]], + float roughness_paper_front = 0.789999962f [[ + ::anno::display_name("Roughness Paper Frontside"), + ::anno::description("Defines the Roughness of the paper on the frontside."), + ::anno::in_group("Appearance", "Frontside"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float paper_translucency = 0.199999988f [[ + ::anno::display_name("Paper Translucency"), + ::anno::description("Adjusts the tranlucency of the paper. When translucency is raised, the print of the other side will shine through the material. The range realistic, do not make the paper more than 20 percent translucent (which corresponds to a value of 0.2). For the sake of creativity we gave the user the pssibility to control the full range though."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float translucent_paper_structure = 0.939999998f [[ + ::anno::display_name("Transmissive Fibers Amount"), + ::anno::description("When increasing this parameters, a paper fiber texture will appear as light is shining through the translucent material."), + ::anno::in_group(""), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float paper_bump_strength = 0.379999995f [[ + ::anno::display_name("Bump Strength"), + ::anno::description("Defines the strength of the bump map for the paper."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform"), + ::anno::hard_range(-360.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(0.25f, 0.25f)), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(8) + ]] +) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Paper Coldpressed"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Paper_Plain.Paper_Coldpressed.png"), + ::anno::key_words(string[]("paper", "transparent", "watercolor", "rough", "creative", "thin", "new", "bleached", "neutral", "light", "white")), + ::anno::author("NVIDIA vMaterials") +]] + = + let { + + //string normal_texture = "./textures/paper_coldpressed_4_norm.jpg"; + //string trans_texture = "./textures/paper_coldpressed_4_trans.jpg"; + //string rough_texture = "./textures/paper_plain_rough.jpg"; + + texture_2d rough_tex = texture_2d("./textures/paper_plain_rough.jpg", ::tex::gamma_linear); + texture_2d trans_tex = texture_2d("./textures/paper_coldpressed_4_trans.jpg", ::tex::gamma_srgb); + texture_2d norm_tex = texture_2d("./textures/paper_coldpressed_4_norm.jpg", ::tex::gamma_linear); + + bool tmp0 = true; + material_surface tmp1(::df::custom_curve_layer(0.08f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front) * histogram_range(::base::file_texture(rough_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).mono, 0.289999992f, roughness_paper_front), histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front) * histogram_range(::base::file_texture(rough_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).mono, 0.29f, roughness_paper_front), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(paper_translucency, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), ::base::file_texture(trans_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, ::base::color_layer_blend, translucent_paper_structure).tint), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(front_paper_color, 0.f), bsdf(), normalmap_normal(norm_tex, paper_bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), normalmap_normal(norm_tex, paper_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, ::state::rounded_corner_normal(0.0015f, false, 1.f)); + 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/Plastic/PCB_Prepreg.mdl b/code/third_party/vMaterials_2/Plastic/PCB_Prepreg.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1ca845e86b66a8be31c1f0ea1a6f1ee02eed63ba --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/PCB_Prepreg.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 plastic material for printed circuit boards (PCB)"; + +::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)); +} + +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 vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +[[ + ::anno::noinline() +]] +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + + +export material PCB_Prepreg( + float diffuse_brightness = 1.f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float reflection_roughness = 0.75f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Reflection"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + uniform 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(2) + ]], + uniform bool subsurface_scattering = false [[ + ::anno::description("Enable light that penetrates the surface of a translucent object. While set to True it\'s a physically correct calculated SSS effect. If set to False it\'s a diffuse transmission that is cheaper to perform."), + ::anno::display_name("Subsurface Scattering"), + ::anno::in_group("Advanced"), + ::anno::ui_order(3) + ]], + uniform float translucency_amount = 0.3f [[ + ::anno::description("Describes how far light passes through the material."), + ::anno::display_name("Transluceny Amount"), + ::anno::in_group("Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + 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) + ]], + 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(6) + ]], + 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(.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("Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(8) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters (mm)."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(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::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(12) + ]], + 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(13) + ]], + 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(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 Prepreg"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "yellow", "bright", "technical", "electronic", "plate", "construction")), + ::anno::thumbnail("./.thumbs/PCB_Prepreg.PCB_Prepreg.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(::base::file_texture(texture_2d("./textures/pcb_prepreg_rough.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 * 0.100000001f, ::base::texture_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, ::math::lerp(0.f, 0.899999976f, reflection_roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/pcb_prepreg_rough.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 * 0.100000001f, ::base::texture_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, ::math::lerp(0.f, 0.899999976f, reflection_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/pcb_prepreg_rough.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 * 0.100000001f, ::base::texture_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, ::math::lerp(0.f, 0.899999976f, reflection_roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/pcb_prepreg_rough.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 * 0.100000001f, ::base::texture_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, ::math::lerp(0.f, 0.899999976f, reflection_roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(translucency_amount * 0.5f, ::df::diffuse_transmission_bsdf(color(0.74841398f, 0.74841398f, 0.74841398f)), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/pcb_prepreg_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 * 0.100000001f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.699999988f, 0.25f, diffuse_brightness)).tint, 0.484000027f), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./textures/pcb_prepreg_norm.jpg", ::tex::gamma_linear), 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 * 0.100000001f, ::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)), ::state::normal()), ::base::tangent_space_normal_texture(texture_2d("./textures/pcb_prepreg_norm.jpg", ::tex::gamma_linear), 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 * 0.100000001f, ::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 = subsurface_scattering ? material_volume(vdf(), volume_transmittance_albedo(translucency_amount, color(0.132868007f, 0.132868007f, 0.132868007f), color(1.f, 1.f, 1.f)).absorption_coefficient, volume_transmittance_albedo(translucency_amount, color(0.132868007f, 0.132868007f, 0.132868007f), color(1.f, 1.f, 1.f)).scattering_coefficient) : 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 * 0.00100000005f, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material PCB_Prepreg_Rough(*) + +[[ + ::anno::display_name("PCB Prepreg - Rough"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "yellow", "bright", "technical", "electronic", "plate", "construction", "rough")), + ::anno::thumbnail("./.thumbs/PCB_Prepreg.PCB_Prepreg_Rough.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Prepreg +( + diffuse_brightness: .6f, + reflection_roughness: .8f, + bump_strength: 1.f, + subsurface_scattering: false, + translucency_amount: .35f, + 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_Prepreg_Shiny(*) + +[[ + ::anno::display_name("PCB Prepreg - Shiny"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "yellow", "bright", "technical", "electronic", "plate", "construction", "shiny")), + ::anno::thumbnail("./.thumbs/PCB_Prepreg.PCB_Prepreg_Shiny.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Prepreg +( + diffuse_brightness: .7f, + reflection_roughness: .25f, + bump_strength: .5f, + subsurface_scattering: false, + translucency_amount: .35f, + 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/Plastic/PCB_Solder_Mask.mdl b/code/third_party/vMaterials_2/Plastic/PCB_Solder_Mask.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7d3494d79fc01150784d271a9bef204c85426570 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/PCB_Solder_Mask.mdl @@ -0,0 +1,702 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A plastic material for printed circuit boards (PCB)."; + + + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + +volume_info volume_transmittance_albedo( + float density_scale = 1.0, + color transmittance = color(0.5f), // transmittance color after unit distance + color albedo = color(1.0f) +) +[[ + anno::noinline() +]] +{ + color sigma_t = -math::log(math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + return ::math::lerp(low, high, input); +} + +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 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)); +} + +::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); + //Hack: 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)); +} + +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 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 PCB_Solder_Mask( + color diffuse_color = color(0.002732f, 0.223228f, 0.003677f) [[ + ::anno::description("Sets the color of the solder mask."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float reflection_roughness = .4f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + uniform float bump_strength = .0f [[ + ::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::soft_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + uniform bool subsurface_scattering = true [[ + ::anno::description("Enable light that penetrates the surface of a translucent object. While set to True it\'s a physically correct calculated SSS effect. If set to False it\'s a diffuse transmission that is cheaper to perform."), + ::anno::display_name("Subsurface Scattering"), + ::anno::in_group("Advanced"), + ::anno::ui_order(3) + ]], + float translucency_amount = 0.7f [[ + ::anno::description("Adjusts how much light may pass through the material."), + ::anno::display_name("Transluceny Amount"), + ::anno::in_group("Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float density_scale = 1.f [[ + ::anno::description("Adjusts the density of the material. High makes the material denser and thus light travel less far until it is exhausted."), + ::anno::display_name("Density Scale"), + ::anno::in_group("Advanced"), + ::anno::soft_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"), + ::nvidia::core_definitions::dimension(float2(.1f, .1f)), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("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("Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters (mm)."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]], + 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("Transform", "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("Transform", "Projection"), + ::anno::ui_order(14) + ]], + 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("Transform", "Projection"), + ::anno::ui_order(15) + ]], + uniform float scale = 1.f [[ + ::anno::description("Scales the texture while No UV is true."), + ::anno::display_name("Scale Projection"), + ::anno::in_group("Transform", "Projection"), + ::anno::ui_order(16) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PCB Solder Mask - Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "green", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, df::microfacet_ggx_smith_bsdf(histogram_range(float3(base::file_texture(texture_2d("./textures/pcb_solder_mask_rough.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 1.f, reflection_roughness) * histogram_range(float3(base::file_texture(texture_2d("./textures/pcb_solder_mask_rough.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 1.f, reflection_roughness), histogram_range(float3(base::file_texture(texture_2d("./textures/pcb_solder_mask_rough.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 1.f, reflection_roughness) * histogram_range(float3(base::file_texture(texture_2d("./textures/pcb_solder_mask_rough.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 1.f, reflection_roughness), 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(translucency_amount * 0.5f, df::diffuse_transmission_bsdf(hsl2rgb(float3(rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).x, math::lerp(0.f, 0.979999959f, rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).y), math::lerp(0.629999995f, 1.f, rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).z)))), df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_grey_diff.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, 0.f), base::tangent_space_normal_texture(texture_2d("./textures/pcb_solder_mask_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 * 0.0500000007f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), base::tangent_space_normal_texture(texture_2d("./textures/pcb_solder_mask_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 * 0.0500000007f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.214040995f, 0.00203699991f, 0.00203699991f), 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(2.38333201f, 2.38333201f, 2.38333201f); + material_volume tmp4 = subsurface_scattering ? material_volume(vdf(), volume_transmittance_albedo(remap(density_scale, 0.f, 80.f), color(0.00489600003f, 0.00489600003f, 0.00489600003f), math::clamp(hsl2rgb(float3(rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).x, math::lerp(0.0399999991f, 0.969999969f, rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).y), math::lerp(0.539999962f, 0.939999998f, rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).z))), color(0.f, 0.f, 0.f), color(0.955973983f, 0.955973983f, 0.955973983f))).absorption_coefficient, volume_transmittance_albedo(remap(density_scale, 0.f, 80.f), color(0.00489600003f, 0.00489600003f, 0.00489600003f), math::clamp(hsl2rgb(float3(rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).x, math::lerp(0.0399999991f, 0.969999969f, rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).y), math::lerp(0.539999962f, 0.939999998f, rgb2hsl(float3(math::clamp(nvidia::core_definitions::blend_colors(base::file_texture(texture_2d("./textures/pcb_solder_mask_SSS.jpg", ::tex::gamma_linear), 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 * 0.0500000007f, 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, diffuse_color, base::color_layer_multiply, 1.f, true).tint, color(0.000303999986f, 0.000302f, 0.000302f), color(0.99110198f, 0.99110198f, 0.99110198f)))).z))), color(0.f, 0.f, 0.f), color(0.955973983f, 0.955973983f, 0.955973983f))).scattering_coefficient, color(0.f, 0.f, 0.f)) : material_volume(vdf(), volume_transmittance_albedo(remap(density_scale, 0.f, 80.f), color(0.99110198f, 0.99110198f, 0.99110198f), color(0.f, 0.f, 0.f)).absorption_coefficient, volume_transmittance_albedo(remap(density_scale, 0.f, 80.f), color(0.99110198f, 0.99110198f, 0.99110198f), 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 * 0.00100000005f, across_materials, 1.f) : state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material PCB_Solder_Mask_Green_Fast(*) + +[[ + ::anno::display_name("PCB Solder Mask - Green Fast"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "green", "fast", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Green_Fast.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.012983f, 0.304987f, 0.012983f), + reflection_roughness: .4f, + bump_strength: .4f, + subsurface_scattering: false, + translucency_amount: .3f, + density_scale: .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.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_Black(*) + +[[ + ::anno::display_name("PCB Solder Mask - Black"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "black", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.012983f, 0.304987f, 0.012983f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: true, + translucency_amount: .5f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_Black_Fast(*) + +[[ + ::anno::display_name("PCB Solder Mask - Black Fast"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "black", "technical", "electronic", "plate", "construction", "fast", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black_Fast.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.012983f, 0.012983f, 0.012983f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: false, + translucency_amount: .3f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + + +export material PCB_Solder_Mask_Yellow(*) + +[[ + ::anno::display_name("PCB Solder Mask - Yellow"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "yellow", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Yellow.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.871367f, 0.871367f, 0.012983f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: true, + translucency_amount: .75f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_Yellow_Fast(*) + +[[ + ::anno::display_name("PCB Solder Mask - Yellow Fast"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "yellow", "technical", "electronic", "plate", "fast", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Yellow_Fast.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.871367f, 0.871367f, 0.012983f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: false, + translucency_amount: .3f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_Red_Fast(*) + +[[ + ::anno::display_name("PCB Solder Mask - Red Fast"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "red", "technical", "electronic", "plate", "fast", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Red_Fast.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.871367f, 0.012983f, 0.012983f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: false, + translucency_amount: .3f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_Red(*) + +[[ + ::anno::display_name("PCB Solder Mask - Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "red", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Red.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.871367f, 0.012983f, 0.012983f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: true, + translucency_amount: .5f, + density_scale: .75f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_Blue(*) + +[[ + ::anno::display_name("PCB Solder Mask - Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "blue", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Blue.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.012983f, 0.013702f, 0.577580f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: true, + translucency_amount: .5f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_Blue_Fast(*) + +[[ + ::anno::display_name("PCB Solder Mask - Blue Fast"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "blue", "fast", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Blue_Fast.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.012983f, 0.013702f, 0.577580f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: true, + translucency_amount: .3f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_White(*) + +[[ + ::anno::display_name("PCB Solder Mask - White"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "white", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.955973f, 0.955973f, 0.955973f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: true, + translucency_amount: .8f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); + +export material PCB_Solder_Mask_White_Fast(*) + +[[ + ::anno::display_name("PCB Solder Mask - White Fast"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "pcb", "computer", "plastic", "translucency", "white", "fast", "technical", "electronic", "plate", "construction", "mask", "printed", "circuit", "boards", "hardware")), + ::anno::thumbnail("./.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White_Fast.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Solder_Mask +( + diffuse_color: color(0.955973f, 0.955973f, 0.955973f), + reflection_roughness: .3f, + bump_strength: .3f, + subsurface_scattering: false, + translucency_amount: .3f, + density_scale: 1.f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + coordinate_system: base::texture_coordinate_object, + projection_type: base::projection_planar, + scale: 1.f +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Plastic/PET_Clear.mdl b/code/third_party/vMaterials_2/Plastic/PET_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..541e530c0fd0152c176ae095b8667544a8ea0dbb --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/PET_Clear.mdl @@ -0,0 +1,507 @@ +/****************************************************************************** + * 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 = "Clear PET (Polyethylene terephthalate) material with IOR, Abbe Number and volumetric exhaustion"; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 PET_Clear( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.573f [[ + ::anno::description("Index of refraction"), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float abbe_number = 27.897f [[ + ::anno::description("Dispersion in relation to index of refraction"), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass"), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.0f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(1.0f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polyethylene - Clear"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polyethylene", "terephthalate", "PET", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/PET_Clear.PET_Clear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false); + float roughness_smudges = ::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))); + + material_surface tmp1( + ::df::fresnel_layer( + ior, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect), + + ::df::tint(color(1.f, 1.f, 1.f), + thin_walled ? transmittance : color(1.0f), + ::df::weighted_layer( + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness * roughness, + roughness * roughness, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect_transmit + ), + bsdf(), + normal) + ), + + 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 = ::base::abbe_number_ior(ior, abbe_number); + + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 PET_Smudged(*) +[[ + ::anno::display_name("Polyethylene - Smudges"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polyethylene", "terephthalate", "PET", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/PET_Clear.PET_Smudged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = PET_Clear ( + thin_walled: false, + ior: 1.573f, + abbe_number: 27.897f, + roughness: 0.0f, + units_absorption_thickness: unit_cm, + absorption_thickness: 10.0f, + transmittance: color(.98f), + smudges: 0.85f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 0.5f, + across_materials: false, + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Plastic/Plastic_Standardized_Surface_Finish.mdl b/code/third_party/vMaterials_2/Plastic/Plastic_Standardized_Surface_Finish.mdl new file mode 100644 index 0000000000000000000000000000000000000000..98f9b81909c1b573ead49f8c411ac4640d6157f5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Plastic_Standardized_Surface_Finish.mdl @@ -0,0 +1,1630 @@ +/****************************************************************************** + * 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 plastic material with a industrial standardized surface finish."; + +float remap(float input, float low_1, float high_1, float low_2, float high_2) +{ + return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position), + 0.0, + 1.0), + 0.0, + 1.0); +} + +struct vm_coordinates{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +export 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; +} + +::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 Plastic_Standardized_Surface_Finish( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.07f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 0.13f [[ + ::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(2) + ]], + float reflection_weight = 0.47f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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.024f, 0.024f)), + ::anno::ui_order(5) + ]], + 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(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(8) + ]], + uniform float roundcorners_radius_mm = 10.f [[ + ::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 = 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(10) + ]], + // Material presets need to have different scalings. This parameter is required to fit all material presets + // so that the 'normal' texture_scale sits at float2(1.0f) + float2 texture_scale_refit = float2(1.f) [[ + ::anno::description("Adjusts the texture scale for a material."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Advanced"), + ::anno::hidden(), + ::anno::ui_order(11) + ]] + ) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish Template"), + ::anno::description("Master template material. This material should be hidden. " + "If you see this material, the integration is not hiding it correctly."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "artificial", "finish", "decorative", "treated", "automotive", "design", "shiny", "new", "black", "dark")), + ::anno::hidden() +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * texture_scale_refit; + float reflection_reweight = 1.0f - reflection_weight; + + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(vm_tex_lookup(texture_2d("./textures/mold_01_rough.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).mono, 1.f, reflection_reweight * 0.680000007f), ::df::microfacet_ggx_smith_bsdf(roughness * 0.0700000003f, roughness * 0.0700000003f, 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.0f, ::df::diffuse_reflection_bsdf(plastic_color, 0.f), bsdf(), vm_tex_normal_lookup(texture_2d("./textures/mold_01_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength)), vm_tex_normal_lookup(texture_2d("./textures/mold_01_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength)), 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(2.30851698f, 2.30851698f, 2.30851698f); + 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); + +// V12 +export material Plastic_Standardized_Surface_Finish_V12( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 0.3f [[ + ::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(2) + ]], + float reflection_weight = 0.34f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + uniform float roundcorners_radius_mm = 10.f [[ + ::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 = 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(10) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V12"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V12.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 12", "artificial", "finish", "decorative", "treated", "automotive", "design", "shiny", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.0024f) +); + +// V15 +export material Plastic_Standardized_Surface_Finish_V15( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.23f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 0.41f [[ + ::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(2) + ]], + float reflection_weight = 0.34f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + uniform float roundcorners_radius_mm = 10.f [[ + ::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 = 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(10) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V15"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V15.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 15", "artificial", "finish", "decorative", "treated", "automotive", "design", "shiny", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.0048f) +); + +// V18 +export material Plastic_Standardized_Surface_Finish_V18( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 0.83f [[ + ::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(2) + ]], + float reflection_weight = 0.34f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + uniform float roundcorners_radius_mm = 10.f [[ + ::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 = 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(10) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V18"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V18.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 18", "artificial", "finish", "decorative", "treated", "automotive", "design", "shiny", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.00552f) +); + +// V21 +export material Plastic_Standardized_Surface_Finish_V21( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 0.83f [[ + ::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(2) + ]], + float reflection_weight = 0.34f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + uniform float roundcorners_radius_mm = 10.f [[ + ::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 = 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(10) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V21"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V21.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 21", "artificial", "finish", "decorative", "treated", "automotive", "design", "shiny", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.006f) +); + +// V24 +export material Plastic_Standardized_Surface_Finish_V24( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 0.83f [[ + ::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(2) + ]], + float reflection_weight = 0.34f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + uniform float roundcorners_radius_mm = 10.f [[ + ::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 = 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(10) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V24"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V24.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 24", "artificial", "finish", "decorative", "treated", "automotive", "design", "shiny", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.0072f) +); + + +// V27 +export material Plastic_Standardized_Surface_Finish_V27( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.25f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 0.83f [[ + ::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(2) + ]], + float reflection_weight = 0.34f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + uniform float roundcorners_radius_mm = 10.f [[ + ::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 = 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(10) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V27"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V27.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 27", "artificial", "finish", "decorative", "treated", "automotive", "design", "shiny", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.0084f) +); + + +// Template for other VDI-like materials which use a different bump map +export material Plastic_Standardized_Surface_Finish_Template_V2( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic."), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(2) + ]], + 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(3) + ]], + 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(4) + ]], + float2 texture_scale = float2(4.30000019f) [[ + ::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(5) + ]], + 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(6) + ]], + float reflection_weight = 0.5f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::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) + ]], + // Material presets need to have different scalings. This parameter is required to fit all material presets + // so that the 'normal' texture_scale sits at float2(1.0f) + float2 texture_scale_refit = float2(0.015f) [[ + ::anno::description("Adjusts the texture scale for a material."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Advanced"), + ::anno::hidden(), + ::anno::ui_order(11) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish Template V2"), + ::anno::description("Master template material. This material should be hidden." + "If you see this material, the integration is not hiding it correctly."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_Template_V2.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "artificial", "finish", "decorative", "treated", "automotive", "design", "rough", "bumped", "matte", "bumped", "new", "black", "dark")), + ::anno::hidden() +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * texture_scale_refit; + + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(vm_tex_lookup(texture_2d("./textures/mold_45_r_rough_g_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 0.610000014f, ::math::lerp(0.879999995f, 0.239999995f, reflection_weight)), ::df::microfacet_ggx_smith_bsdf(roughness * 0.199999988f, roughness * 0.199999988f, 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(plastic_color, 0.f), bsdf(), vm_tex_normal_lookup(texture_2d("./textures/mold_45_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength)), vm_tex_normal_lookup(texture_2d("./textures/mold_45_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), bump_strength)), 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(2.30851698f, 2.30851698f, 2.30851698f); + 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); + + +// V30 +export material Plastic_Standardized_Surface_Finish_V30( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 1.0f [[ + ::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(2) + ]], + float reflection_weight = 0.6f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + 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(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) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V30"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V30.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 30", "artificial", "finish", "decorative", "treated", "automotive", "design", "matte", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish_Template_V2( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.0108f) +); + +// V 33 +export material Plastic_Standardized_Surface_Finish_V33( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 1.0f [[ + ::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(2) + ]], + float reflection_weight = 0.6f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + 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(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) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V33"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V33.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 33", "artificial", "finish", "decorative", "treated", "automotive", "design", "matte", "bumped", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish_Template_V2( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.0168f) +); + + +// V 36 +export material Plastic_Standardized_Surface_Finish_V36( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 1.0f [[ + ::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(2) + ]], + float reflection_weight = 0.6f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + 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(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) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V36"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V36.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 36", "artificial", "finish", "decorative", "treated", "automotive", "design", "matte", "bumped", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish_Template_V2( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.0204f) +); + + +// V 39 +export material Plastic_Standardized_Surface_Finish_V39( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 1.0f [[ + ::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(2) + ]], + float reflection_weight = 0.6f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + 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(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) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V39"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V39.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 39", "artificial", "finish", "decorative", "treated", "automotive", "design", "matte", "bumped", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish_Template_V2( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.024f) +); + + +// V 42 +export material Plastic_Standardized_Surface_Finish_V42( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 1.0f [[ + ::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(2) + ]], + float reflection_weight = 0.6f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + 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(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) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V42"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V42.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 42", "artificial", "finish", "decorative", "treated", "automotive", "design", "matte", "bumped", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish_Template_V2( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.0384f) +); + + + +// V 45 +export material Plastic_Standardized_Surface_Finish_V45( + color plastic_color = color(0.03f, 0.03f, 0.03f) [[ + ::anno::description("Choose the color of the plastic"), + ::anno::display_name("Plastic Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.2f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::usage("roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float bump_strength = 1.0f [[ + ::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(2) + ]], + float reflection_weight = 0.6f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflection Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + 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(3) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle ofy the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(4) + ]], + 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(5) + ]], + 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(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(8) + ]], + 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(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) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::display_name("Plastic - Industrial Surface Finish V45"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V45.png"), + ::anno::key_words(string[]("plastic", "industrial", "VDI", "VDI 45", "artificial", "finish", "decorative", "treated", "automotive", "design", "matte", "bumped", "new", "black", "dark")) +]] = +Plastic_Standardized_Surface_Finish_Template_V2( + plastic_color: plastic_color, + roughness: roughness, + bump_strength: bump_strength, + reflection_weight: reflection_weight, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + texture_scale_refit: float2(0.1032f) +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl b/code/third_party/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7ad66e33082d1d9967b52f29040db3fa65868bc8 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl @@ -0,0 +1,673 @@ +/***************************************************************************** +* Copyright 2024 NVIDIA Corporation. All rights reserved. +****************************************************************************** + + MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT, + WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR, + 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. +*/ + + +// This file contains samples of very fast rendering SSS plastics for iray +// + +mdl 1.4; +import ::df::*; +import ::math::*; +import ::anno::*; + + +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"; + + + +// Template for absorption and scattering, do not use directly +material volume_absorption( + color absorption = color(0.8665f, 0.7769f, 0.1559f), + color scattering = color(.5f), + float distance_scale = .03f, + float directional_bias = 0.0f, + uniform float ior = 1.2f + +) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Volume Absorption"), + ::anno::description("Pure volume absorption material"), + ::anno::author("NVIDIA"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() + +]] = material ( + ior: color(ior), + surface: material_surface ( + scattering: ::df::specular_bsdf ( + tint: color (1.0f, 1.0f, 1.0f), + mode: ::df::scatter_reflect_transmit + ) + ), + volume: material_volume ( + scattering: ::df::anisotropic_vdf( + directional_bias: directional_bias + ), + absorption_coefficient: (distance_scale <= 0)? color(0): ::math::log(absorption) / -distance_scale, + scattering_coefficient: (distance_scale <= 0)? color(0): ::math::log(scattering) / -distance_scale + ) +); + +// plastic_full_weighted_mix +// Plastic material using diffuse reflection, diffuse transmission +// and SSS. Due to the diffuse transmission the volume absorption will +// render faster and converge smoother than when using specular transmission. +export material Plastic_Thick_Translucent( + color diffuse_color = color(0.6940f, 0.5831f, 0.0493f) + [[ + ::anno::display_name("Diffuse Color"), + ::anno::description("The diffuse color of the plastic material"), + ::anno::in_group("Appearance") + ]], + float diffuse_weight = 0.3f + [[ + ::anno::display_name("Diffuse Weight"), + ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep " + "the value around 0.5, lower values make the material appear more transparent while higher values make " + "it more opaque."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color absorption = color(0.8665f, 0.7769f, 0.1559f) + [[ + ::anno::display_name("Absorption Color"), + ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"), + ::anno::in_group("Appearance") + ]], + color scattering = color(.5f) + [[ + ::anno::display_name("Scattering Color"), + ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"), + ::anno::in_group("Appearance") + ]], + float distance_scale = 1.5f + [[ + ::anno::display_name("Distance Scale"), + ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see " + "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this " + "material parameter for your scene"), + ::anno::in_group("Appearance") + ]], + + color diffuse_transmission_tint = color(1.0000f, 0.7249f, 0.1972f) + [[ + ::anno::display_name("Diffuse Transmission Color"), + ::anno::description("The tinting of light scattering through the plastic material"), + ::anno::in_group("Appearance") + ]], + + float reflection_roughness = 0.0f + [[ + ::anno::display_name("Roughness"), + ::anno::description("The roughness of the reflection on the plastic"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]] +) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Full Control"), + ::anno::description("Plastic Material finegrained controls of its appearance"), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.Plastic_Thick_Translucent.png"), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny")), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() +]] = let { + float reflection_weight = 1.0f; + float normal_reflectivity = 0.04f; + float grazing_reflectivity = 1.0f; + float reflectivity_exponent = 5.0f; + uniform float ior = 1.4f; + + material plastic = volume_absorption( + absorption: absorption, + scattering: scattering, + distance_scale: distance_scale, + ior: ior + ); + + bsdf transdiff = ::df::diffuse_transmission_bsdf( + tint: diffuse_transmission_tint + ); + + bsdf diffuse = ::df::diffuse_reflection_bsdf( + tint: diffuse_color + ); + + bsdf diffuse_mix_layer = ::df::weighted_layer( + base: transdiff, + layer: diffuse, + weight: diffuse_weight + + ); + + bsdf glossy_reflection = ::df::simple_glossy_bsdf( + tint: color(1.0f), + roughness_u: reflection_roughness, + mode: ::df::scatter_reflect + ); + + bsdf final_layer = ::df::custom_curve_layer( + normal_reflectivity: normal_reflectivity, + grazing_reflectivity: grazing_reflectivity, + layer: glossy_reflection, + base: diffuse_mix_layer, + weight: reflection_weight, + exponent: reflectivity_exponent + ); + +} in material ( + surface: material_surface( + scattering: final_layer + ), + + volume: plastic.volume +); + + +export material plastic_simple_controls( + color diffuse_color = color(0.6940f, 0.5831f, 0.0493f) + [[ + ::anno::display_name("Diffuse Color"), + ::anno::description("The diffuse color of the plastic material"), + ::anno::in_group("Appearance") + ]], + float diffuse_weight = 0.5f + [[ + ::anno::display_name("Diffuse Weight"), + ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep " + "the value around 0.5, lower values make the material appear more transparent while higher values make " + "it more opaque."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color transmissive_color = color(0.8665f, 0.7769f, 0.1559f) + [[ + ::anno::display_name("Transmissive Color"), + ::anno::description("The tinting of light scattering through the plastic material"), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.0f + [[ + ::anno::display_name("Roughness"), + ::anno::description("The roughness of the reflection on the plastic"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float distance_scale = 0.005f + [[ + ::anno::display_name("Distance Scale"), + ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see " + "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this " + "material parameter for your scene"), + ::anno::in_group("Appearance") + ]] + +) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Weight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_simple_controls.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() +]] = Plastic_Thick_Translucent( + absorption: ::math::pow(transmissive_color, 0.2f), + scattering: color(0.5f), + distance_scale: distance_scale, + diffuse_transmission_tint: ::math::pow(transmissive_color, 0.2f), + diffuse_color: diffuse_color, + diffuse_weight: diffuse_weight, + reflection_roughness: reflection_roughness + +); + + + +// 01 - Black +export material plastic_black(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Black"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "black", "neutral")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_black.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.034230f), + diffuse_weight: .5f, + transmissive_color: color(0.034230f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 02 - Dark Gray +export material plastic_dark_gray(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Dark Gray"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "gray", "neutral")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.127530f), + diffuse_weight: .5f, + transmissive_color: color(0.089194f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 03 - Light Gray +export material plastic_light_gray(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Light Gray"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "gray", "neutral")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.464741f), + diffuse_weight: .5f, + transmissive_color: color(0.358654f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 04 - White +export material plastic_white(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic White"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "white", "neutral")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_white.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.915750f), + diffuse_weight: .5f, + transmissive_color: color(0.812241f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 05 - Ivory White +export material plastic_ivory_white(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Ivory White"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "white", "bright", "ivory", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_ivory_white.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.899385f, 0.843370f, 0.694081f), + diffuse_weight: .5f, + transmissive_color: color(0.722672f, 0.708298f, 0.547994f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 06 - Lemon +export material plastic_lemon(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Lemon"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "lemon", "yellow", "light", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_lemon.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.859174f, 0.875138f, 0.039947f), + diffuse_weight: .5f, + transmissive_color: color(0.98211f, 0.843370f, 0.031551f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 07 - Yellow Orange +export material plastic_yellow_orange(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Yellow"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "orange", "yellow", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_yellow_orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.875138f, 0.612066f, 0.039947f), + diffuse_weight: .5f, + transmissive_color: color(0.899385f, 0.373615f, 0.030257f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 08 - Orange +export material plastic_orange(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Orange"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "orange", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.875138f, 0.353741f, 0.030257f), + diffuse_weight: .5f, + transmissive_color: color(0.891262f, 0.420508f, 0.022013f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 09 - Dark Orange +export material plastic_dark_orange(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Dark Orange"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "orange", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.535642f, 0.127530f, 0.022013f), + diffuse_weight: .5f, + transmissive_color: color(0.827726f, 0.267358f, 0.022013f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 10 - Red +export material plastic_red(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Red"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "red", "cherry", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.547994f, 0.027755f, 0.027755f), + diffuse_weight: .5f, + transmissive_color: color(0.875138f, 0.022013f, 0.022013f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 11 - Magenta +export material plastic_magenta(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Magenta"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "magenta")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_magenta.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.547994f, 0.047776f, 0.554227f), + diffuse_weight: .5f, + transmissive_color: color(0.722672f, 0.030257f, 0.566810f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 12 - Purple +export material plastic_purple(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Purple"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "purple")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.193972f, 0.017936f, 0.464741f), + diffuse_weight: .5f, + transmissive_color: color(0.701170f, 0.018913f, 0.645555f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 13 - Dark Blue +export material plastic_dark_blue(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Dark Blue"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "blue", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.027755f, 0.058187f, 0.311180f), + diffuse_weight: .5f, + transmissive_color: color(0.027755f, 0.058187f, 0.311180f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 14 - Blue +export material plastic_blue(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Blue"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "blue", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.034230f, 0.173439f, 0.843370f), + diffuse_weight: .5f, + transmissive_color: color(0.034230f, 0.124741f, 0.659224f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 15 - Sky Blue +export material plastic_sky_blue(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Sky Blue"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "blue", "sky", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_sky_blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.061907f, 0.535642f, 0.875138f), + diffuse_weight: .5f, + transmissive_color: color(0.028991f, 0.358654f, 0.673049f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 16 - Light Blue +export material plastic_light_blue(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Light Blue"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "blue", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.263175f, 0.774227f, 0.827726f), + diffuse_weight: .5f, + transmissive_color: color(0.163641f, 0.592438f, 0.759300f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 17 - Teal +export material plastic_teal(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Teal"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "teal", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_teal.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.037029f, 0.579547f, 0.329729f), + diffuse_weight: .5f, + transmissive_color: color(0.022013f, 0.476177f, 0.353741f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 18 - Dark Green +export material plastic_dark_green(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Dark Green"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "green")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.034230f, 0.141980f, 0.034230f), + diffuse_weight: .5f, + transmissive_color: color(0.016988f, 0.141980f, 0.016988f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 19 - Green +export material plastic_green(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Green"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "green")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.016988f, 0.311180f, 0.016988f), + diffuse_weight: .5f, + transmissive_color: color(0.012664f, 0.358654f, 0.012664f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 20 - Light Green +export material plastic_light_green(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Light Green"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "green")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.030257f, 0.687031f, 0.027755f), + diffuse_weight: .5f, + transmissive_color: color(0.030257f, 0.701170f, 0.027755f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); + + +// 21 - Lime Green +export material plastic_lime_green(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic Lime Green"), + ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. " + "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen " + "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "lime", "green", "light")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_lime_green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = plastic_simple_controls( + diffuse_color: color(0.186989f, 0.605484f, 0.027755f), + diffuse_weight: .5f, + transmissive_color: color(0.204710f, 0.701170f, 0.022013f), + distance_scale: 0.002f, + reflection_roughness: 0.05f +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl b/code/third_party/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bf01f91ab6a93551b89e95c261153c8ec6293b68 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl @@ -0,0 +1,1025 @@ +/****************************************************************************** + * 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. +*/ + +// This file contains samples of very fast rendering SSS plastics for iray +// + +mdl 1.4; +import ::df::*; +import ::math::*; +import ::anno::*; +import ::state::*; +import ::base::*; +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 = +"Translucent plastic material with integrated metal flakes. Features: Effective light scattering for dense " +"plastic materials and metal flakes. The material was built to scatter light within the range of a few " +"centimeters. If light scattering cannot be seen (which can be verified by setting 'Diffuse Weight' to 0.0), " +"check the scene units scale or increase 'Distance Scale'."; + + +// +// flake noise utilities +// +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return ::math::abs(float(seed) * 4.6566e-10f); +} + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = ::math::PI * 2.0f * xi.x; + float phi = ::math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = ::math::sqrt(z); + float[2] sp_cp = ::math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = ::math::sqrt(2.0f - z); + + float[2] st_ct = ::math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +struct flake_noise_value { + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + // Stores values from the functions (once normal, another time the color) + // current pseudo random number generator seed + int rnd_seed; + float4 carrier; +}; + +// flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f) +{ + float3 base_pos = ::math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0, float4(0.0)); + + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int k = -1; k < 2; ++k) { + + int seed = rnd_init(base_pos_i + int3(i, j, k)); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (::math::abs(p.x) <= flake_diameter && + ::math::abs(p.y) <= flake_diameter && + ::math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + + +// constants for numerical fitted curve to observed flake noise density behavior +// 1. no jitter, maximum flake diameter +const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f); +const float2 EF = float2(-101.42634862f, 118.45082288f); +// 2. jitter scale of 0.5f, maximum flake diameter +const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f); +const float2 EF_J = float2(-3.11456809f, 2.63430594f); +// compute a flake probability for a given flake coverage density x +float density_to_probability( + float4 abcd, + float2 ef, + float x) +{ + float xx = x * x; + return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y); +} + +// statistically controlled (area/volume coverage density) flake noise +flake_noise_value flake_noise( + float3 position, + float density = 0.5f, + bool jittered = false) // jittered: slightly slower and slightly less uniform +{ + float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, ::math::saturate(density)); + + return flake_noise(pos: position, jitter_scale: jittered ? 0.5f : 0.0f, flake_diameter: (jittered ? 1.25f : 1.5f) / ::math::sqrt(3.0f), flake_probability: probability); +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +flake_noise_value flake_normal( + flake_noise_value val, + float spread) +{ + if (val.priority <= 0.0f) + { + val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0); + return val; + } + + // int seed0 = rnd_next(val.rnd_seed); + // float xi0 = rnd_value(seed0); + // float xi1 = rnd_value(rnd_next(seed0)); + + int seed = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed); + seed = rnd_next(seed); + float xi1 = rnd_value(seed); + + float phi = ::math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1)); + float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta); + float costheta = ::math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = ::math::sincos(phi); + + val.rnd_seed = seed; + + // return + // ::state::texture_tangent_u(0) * scphi[1] * sintheta + + // ::state::texture_tangent_v(0) * scphi[0] * sintheta + + // ::state::normal() * costheta; + float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta + + ::state::texture_tangent_v(0) * scphi[0] * sintheta + + ::state::normal() * costheta; + + val.carrier = float4(normal.x, normal.y, normal.z, 1.0); + + + return val; +} + +flake_noise_value random_flake_color(flake_noise_value val) +{ + int seed = rnd_next(val.rnd_seed); + float r = rnd_value(seed); + seed = rnd_next(seed); + float g = rnd_value(seed); + seed = rnd_next(seed); + float b = rnd_value(seed); + seed = rnd_next(seed); + float a = rnd_value(seed); + + val.carrier = float4(r, g, b, a); + return val; +} + + +// Template for absorption and scattering, do not use directly +material volume_absorption( + color absorption = color(0.8665, 0.7769, 0.1559), + color scattering = color(.5), + float distance_scale = .03, + float directional_bias = 0.0, + uniform float ior = 1.2 + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Volume Absorption"), + ::anno::description("Pure volume absorption material"), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.volume_absorption.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() + +]] = material ( + ior: color(ior), + surface: material_surface ( + scattering: ::df::specular_bsdf ( + tint: color (1.0, 1.0, 1.0), + mode: ::df::scatter_reflect_transmit + ) + ), + volume: material_volume ( + scattering: ::df::anisotropic_vdf( + directional_bias: directional_bias + ), + absorption_coefficient: (distance_scale <= 0)? color(0): ::math::log(absorption) / -distance_scale, + scattering_coefficient: (distance_scale <= 0)? color(0): ::math::log(scattering) / -distance_scale + ) +); + +// metallic_plastic_full_weighted_mix( ) +// Plastic material using diffuse reflection, diffuse transmission +// and SSS. Due to the diffuse transmission the volume absorption will +// render faster and converge smoother than when using specular transmission. +export material Plastic_Thick_Translucent_Flakes( + color diffuse_color = color(0.6940f, 0.5831f, 0.0493f) + [[ + ::anno::display_name("Diffuse Color"), + ::anno::description("The diffuse color of the plastic material"), + ::anno::in_group("Appearance") + ]], + float diffuse_weight = 0.3f + [[ + ::anno::display_name("Diffuse Weight"), + ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep " + "the value around 0.5, lower values make the material appear more transparent while higher values make " + "it more opaque."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color absorption = color(0.8665f, 0.7769f, 0.1559f) + [[ + ::anno::display_name("Absorption Color"), + ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"), + ::anno::in_group("Appearance") + ]], + color scattering = color(.5f) + [[ + ::anno::display_name("Scattering Color"), + ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"), + ::anno::in_group("Appearance") + ]], + float distance_scale = 1.5f + [[ + ::anno::display_name("Distance Scale"), + ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see " + "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this " + "material parameter for your scene"), + ::anno::in_group("Appearance") + ]], + + color diffuse_transmission_tint = color(1.0000f, 0.7249f, 0.1972f) + [[ + ::anno::display_name("Diffuse Transmission Color"), + ::anno::description("The tinting of light scattering through the plastic material"), + ::anno::in_group("Appearance") + ]], + + float reflection_roughness = 0.0f + [[ + ::anno::display_name("Roughness"), + ::anno::description("The roughness of the reflection on the plastic"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + + // Flakes Controls + color flake_color_1 = color(1.0f, 1.0f, 1.0f) + [[ + ::anno::display_name("Flakes Color"), + ::anno::description("Flakes Color"), + ::anno::in_group("Flakes") + ]], + bool enable_color_randomization = true + [[ + ::anno::display_name("Flakes Color Randomization"), + ::anno::description("Enables that a random flakes color will be chosen. Using 'Flakes Color Randomness' allows " + "to blend between the chosen reflection color for the flakes and an purely random chosen color."), + ::anno::in_group("Flakes") + ]], + float flake_color_randomness = 1.0f + [[ + ::anno::display_name("Flakes Color Randomness"), + ::anno::description("Incresing this value will blend towards a randomly chosen flakes color."), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::enable_if("enable_color_randomization == true") + ]], + uniform float flake_size = 0.1f + [[ + ::anno::display_name("Flakes Size"), + ::anno::description("The size of the flakes in the material"), + ::anno::in_group("Flakes") + ]], + uniform float3 texture_scale = float3 ( 1.f , 1.f, 1.f) + [[ + //::anno::hidden(), + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform float flake_amount = 0.1f + [[ + ::anno::display_name("Flakes Amount"), + ::anno::description("The number of flakes used in the material, 0 meaning no flakes, 1 meaning that flakes " + "cover the entire surface"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f) + ]], + + float flake_spread = 0.7f + [[ + ::anno::display_name("Flakes Spread"), + ::anno::description("The amount of randomness in the orientation of the flakes. When set to zero, flakes are " + "oriented along the surface normal. Higher values tilt the flakes stronger in a random direction."), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Plastic Full Control"), + ::anno::description(DESCRIPTION), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.Plastic_Thick_Translucent_Flakes.png"), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment")), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() +]] = let { + // Hardcoded plastic parameters + float reflection_weight = 1.0f; + float normal_reflectivity = 0.04f; + float grazing_reflectivity = 1.0f; + float reflectivity_exponent = 5.0f; + uniform float ior = 1.4f; + + // Hardcoded flake parameters + uniform float flake_roughness = 0.4f; + float flake_transparency_randomness = 1.0f; + float flakes_opacity = 0.8; + + // Flakes + + float3 flake_uvw_scale = float3(1.0f); + ::base::texture_coordinate_info uvw = ::base::coordinate_source( + coordinate_system: ::base::texture_coordinate_world, + texture_space: 0 + ); + + ::base::texture_coordinate_info transformed_uvw = uvw; + float3 flake_uvw = (texture_scale * transformed_uvw.position * flake_uvw_scale) / (flake_size * 0.001f); + + flake_noise_value val = flake_noise(flake_uvw, flake_amount, true); + bool is_flake = val.priority > 0.0f; + flake_noise_value val2 = flake_normal(val, flake_spread); + float3 flake_normal = float3(val2.carrier.x, val2.carrier.y, val2.carrier.z); + flake_noise_value val3 = random_flake_color(val2); + + color random_color = color(val3.carrier.x, val3.carrier.y, val3.carrier.z); + float flakes_transparency_value = ::math::lerp(flakes_opacity, val3.carrier.w * flakes_opacity, flake_transparency_randomness); + + color flake_color = enable_color_randomization ? + ::math::lerp(flake_color_1, random_color, flake_color_randomness) : flake_color_1; + + bsdf flakes = ::df::simple_glossy_bsdf(mode: ::df::scatter_reflect, roughness_u: flake_roughness * flake_roughness, tint: flake_color); + + + // Plastic + + material plastic = volume_absorption( + absorption: absorption, + scattering: scattering, + distance_scale: distance_scale, + ior: ior + ); + + bsdf transdiff = ::df::diffuse_transmission_bsdf( + tint: diffuse_transmission_tint + ); + + bsdf diffuse = ::df::diffuse_reflection_bsdf( + tint: diffuse_color + ); + + bsdf diffuse_mix_layer = ::df::weighted_layer( + base: transdiff, + layer: diffuse, + weight: diffuse_weight + + ); + + bsdf plastic_with_flakes = ::df::weighted_layer( + base: diffuse_mix_layer, + layer: flakes, + weight: is_flake ? flakes_transparency_value : 0.0f, + normal: flake_normal + ); + + bsdf glossy_reflection = ::df::simple_glossy_bsdf( + tint: color(1.0), + roughness_u: reflection_roughness, + mode: ::df::scatter_reflect + ); + + bsdf final_layer = ::df::custom_curve_layer( + normal_reflectivity: normal_reflectivity, + grazing_reflectivity: grazing_reflectivity, + layer: glossy_reflection, + base: plastic_with_flakes, + weight: reflection_weight, + exponent: reflectivity_exponent + ); + +} in material ( + surface: material_surface( + scattering: final_layer + ), + + volume: plastic.volume +); + + +export material metallic_plastic_simple_controls( + color diffuse_color = color(0.6940, 0.5831, 0.0493) + [[ + ::anno::display_name("Diffuse Color"), + ::anno::description("The diffuse color of the plastic material"), + ::anno::in_group("Appearance") + ]], + float diffuse_weight = 0.5 + [[ + ::anno::display_name("Diffuse Weight"), + ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep " + "the value around 0.5, lower values make the material appear more transparent while higher values make " + "it more opaque."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color transmissive_color = color(0.8665, 0.7769, 0.1559) + [[ + ::anno::display_name("Transmissive Color"), + ::anno::description("The tinting of light scattering through the plastic material"), + ::anno::in_group("Appearance") + ]], + float reflection_roughness = 0.0 + [[ + ::anno::display_name("Roughness"), + ::anno::description("The roughness of the reflection on the plastic"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float distance_scale = 0.005 + [[ + ::anno::display_name("Distance Scale"), + ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see " + "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this " + "material parameter for your scene"), + ::anno::in_group("Appearance") + ]], + + // Flakes Controls + color flake_color_1 = color(1.0f, 1.0f, 1.0f) + [[ + ::anno::display_name("Flakes Color"), + ::anno::description("Flakes Color"), + ::anno::in_group("Flakes") + ]], + bool enable_color_randomization = true + [[ + ::anno::display_name("Flakes Color Randomization"), + ::anno::description("Enables that a random flakes color will be chosen. Using 'Flakes Color Randomness' allows " + "to blend between the chosen reflection color for the flakes and an purely random chosen color."), + ::anno::in_group("Flakes") + ]], + float flake_color_randomness = 1.0 + [[ + ::anno::display_name("Flakes Color Randomness"), + ::anno::description("Incresing this value will blend towards a randomly chosen flakes color."), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::enable_if("enable_color_randomization == true") + ]], + uniform float flake_size = 0.1f + [[ + ::anno::display_name("Flakes Size"), + ::anno::description("The size of the flakes in the material"), + ::anno::in_group("Flakes") + ]], + uniform float3 texture_scale = float3 ( 1.f , 1.f, 1.f) + [[ + //::anno::hidden(), + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the texture size."), + ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform float flake_amount = 0.1f + [[ + ::anno::display_name("Flakes Amount"), + ::anno::description("The number of flakes used in the material, 0 meaning no flakes, 1 meaning that flakes cover the entire surface"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f) + ]], + float flake_spread = 0.7f + [[ + ::anno::display_name("Flakes Spread"), + ::anno::description("The amount of randomness in the orientation of the flakes. When set to zero, flakes are oriented along the surface normal. Higher values tilt the flakes stronger in a random direction."), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f) + ]] + +) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Plastic"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_simple_controls.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() +]] = Plastic_Thick_Translucent_Flakes( + absorption: ::math::pow(transmissive_color, 0.2), + scattering: color(0.5), + distance_scale: distance_scale, + diffuse_transmission_tint: ::math::pow(transmissive_color, 0.2), + diffuse_color: diffuse_color, + diffuse_weight: diffuse_weight, + reflection_roughness: reflection_roughness, + + flake_color_1: flake_color_1, + enable_color_randomization: enable_color_randomization, + flake_color_randomness: flake_color_randomness, + flake_size: flake_size, + texture_scale: texture_scale, + flake_amount: flake_amount, + flake_spread: flake_spread +); + + +// 01 - Black +export material plastic_black(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Black"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "black", "neutral")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_black.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.034230), + diffuse_weight: .5, + transmissive_color: color(0.034230), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 02 - Dark Gray +export material plastic_dark_gray(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Dark Gray"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "gray", "neutral")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.127530), + diffuse_weight: .5, + transmissive_color: color(0.089194), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 03 - Light Gray +export material plastic_light_gray(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Light Gray"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "gray", "neutral")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.464741), + diffuse_weight: .5, + transmissive_color: color(0.358654), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 04 - White +export material plastic_white(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic White"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "white", "neutral")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_white.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.915750), + diffuse_weight: .5, + transmissive_color: color(0.812241), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 05 - Ivory White +export material plastic_ivory_white(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Ivory White"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "white", "bright", "ivory", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_ivory_white.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.899385, 0.843370, 0.694081), + diffuse_weight: .5, + transmissive_color: color(0.722672, 0.708298, 0.547994), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 06 - Lemon +export material plastic_lemon(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Lemon"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "lemon", "yellow", "light", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lemon.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.859174, 0.875138, 0.039947), + diffuse_weight: .5, + transmissive_color: color(0.98211, 0.843370, 0.031551), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 07 - Yellow Orange +export material plastic_yellow_orange(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Yellow"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "orange", "yellow", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_yellow_orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.875138, 0.612066, 0.039947), + diffuse_weight: .5, + transmissive_color: color(0.899385, 0.373615, 0.030257), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 08 - Orange +export material plastic_orange(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Orange"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "orange", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.875138, 0.353741, 0.030257), + diffuse_weight: .5, + transmissive_color: color(0.891262, 0.420508, 0.022013), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 09 - Dark Orange +export material plastic_dark_orange(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Dark Orange"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "orange", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.535642, 0.127530, 0.022013), + diffuse_weight: .5, + transmissive_color: color(0.827726, 0.267358, 0.022013), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 10 - Red +export material plastic_red(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Red"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "red", "cherry", "warm")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.547994, 0.027755, 0.027755), + diffuse_weight: .5, + transmissive_color: color(0.875138, 0.022013, 0.022013), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 11 - Magenta +export material plastic_magenta(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Magenta"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "magenta")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_magenta.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.547994, 0.047776, 0.554227), + diffuse_weight: .5, + transmissive_color: color(0.722672, 0.030257, 0.566810), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 12 - Purple +export material plastic_purple(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Purple"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "purple")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.193972, 0.017936, 0.464741), + diffuse_weight: .5, + transmissive_color: color(0.701170, 0.018913, 0.645555), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 13 - Dark Blue +export material plastic_dark_blue(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Dark Blue"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "blue", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.027755, 0.058187, 0.311180), + diffuse_weight: .5, + transmissive_color: color(0.027755, 0.058187, 0.311180), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 14 - Blue +export material plastic_blue(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Blue"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "blue", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.034230, 0.173439, 0.843370), + diffuse_weight: .5, + transmissive_color: color(0.034230, 0.124741, 0.659224), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 15 - Sky Blue +export material plastic_sky_blue(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Sky Blue"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "blue", "sky", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_sky_blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.061907, 0.535642, 0.875138), + diffuse_weight: .5, + transmissive_color: color(0.028991, 0.358654, 0.673049), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 16 - Light Blue +export material plastic_light_blue(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Light Blue"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "blue", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.263175, 0.774227, 0.827726), + diffuse_weight: .5, + transmissive_color: color(0.163641, 0.592438, 0.759300), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 17 - Teal +export material plastic_teal(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Teal"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "teal", "cool")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_teal.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.037029, 0.579547, 0.329729), + diffuse_weight: .5, + transmissive_color: color(0.022013, 0.476177, 0.353741), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 18 - Dark Green +export material plastic_dark_green(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Dark Green"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "green")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.034230, 0.141980, 0.034230), + diffuse_weight: .5, + transmissive_color: color(0.016988, 0.141980, 0.016988), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 19 - Green +export material plastic_green(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Green"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "green")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.016988, 0.311180, 0.016988), + diffuse_weight: .5, + transmissive_color: color(0.012664, 0.358654, 0.012664), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 20 - Light Green +export material plastic_light_green(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Light Green"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "green")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.030257, 0.687031, 0.027755), + diffuse_weight: .5, + transmissive_color: color(0.030257, 0.701170, 0.027755), + distance_scale: 0.002, + reflection_roughness: 0.05 +); + + +// 21 - Lime Green +export material plastic_lime_green(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Metallic Plastic Lime Green"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "lime", "green", "light")), + ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lime_green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = metallic_plastic_simple_controls( + diffuse_color: color(0.186989, 0.605484, 0.027755), + diffuse_weight: .5, + transmissive_color: color(0.204710, 0.701170, 0.022013), + distance_scale: 0.002, + reflection_roughness: 0.05 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Plastic/Polycarbonate_Clear.mdl b/code/third_party/vMaterials_2/Plastic/Polycarbonate_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e3f8edd3ab1795064e0946a9b264ee80d8706487 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polycarbonate_Clear.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.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 = "Clear polycarbonate material with IOR, abbe number and volumetric exhaustion"; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polycarbonate_Clear( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.584f [[ + ::anno::description("Index of refraction"), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float abbe_number = 0.f [[ + ::anno::description("Dispersion in relation to index of refraction"), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass"), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.0f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(1.0f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polycarbonate - Clear"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Clear.Polycarbonate_Clear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false); + + float roughness_smudges = ::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))); + + material_surface tmp1( + ::df::fresnel_layer( + ior, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect), + ::df::tint(color(1.f, 1.f, 1.f), + thin_walled ? transmittance : color(1.0f), + ::df::weighted_layer( + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness * roughness, + roughness * roughness, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect_transmit + ), + bsdf(), + normal) + ), + 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 = ::base::abbe_number_ior(ior, abbe_number); + + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polycarbonate_Smudged(*) +[[ + ::anno::display_name("Polycarbonate - Smudges"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Clear.Polycarbonate_Smudged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polycarbonate_Clear ( + thin_walled: false, + ior: 1.584, + abbe_number: 0.0f, + roughness: 0.0f, + units_absorption_thickness: unit_cm, + absorption_thickness: 10.0f, + transmittance: color(.98f), + smudges: 0.85f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 0.5f, + across_materials: false, + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Plastic/Polycarbonate_Cloudy.mdl b/code/third_party/vMaterials_2/Plastic/Polycarbonate_Cloudy.mdl new file mode 100644 index 0000000000000000000000000000000000000000..caab2332c847048eba232195747ab9853629829e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polycarbonate_Cloudy.mdl @@ -0,0 +1,571 @@ +/****************************************************************************** + * 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 cloudy plastic material with IOR, Abbe Number and volumetric exhaustion."; + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polycarbonate_Cloudy( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.584f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + float roughness = 0.331f [[ + ::anno::description("Creates a frosted look."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color diffuse_tint = color(1.f, 1.f, 1.f) [[ + ::anno::description(""), + ::anno::display_name("Diffuse Tint"), + ::anno::in_group("Appearance") + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + + uniform color transmissive_tint = color(0.915f) [[ + ::anno::display_name("Transmissive Tint"), + ::anno::description("Adjusts the transmissive color of the material. The color is influenced by the \"Diffuse Tint\" color parameter."), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(0.96f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// BSDF Weights + float diffuse_reflection_weight = 0.0775f [[ + ::anno::description("The weight of diffuse reflection. Note that the sum of all BSDF weights will be normalized."), + ::anno::display_name("Diffuse Reflection Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + float diffuse_transmission_weight = 0.476f [[ + ::anno::description("The weight of diffuse transmission. Note that the sum of all BSDF weights will be normalized."), + ::anno::display_name("Diffuse Transmission Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + float specular_transmission_weight = 1.0f [[ + ::anno::description("The weight of specular transmission. Note that the sum of all BSDF weights will be normalized."), + ::anno::display_name("Specular Transmission Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polycarbonate - Cloudy"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf((roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))) * (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))), (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))) * (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))), 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::clamped_mix(::df::bsdf_component[](::df::bsdf_component(diffuse_reflection_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), ::df::diffuse_reflection_bsdf(diffuse_tint, 0.f)), ::df::bsdf_component(diffuse_transmission_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), ::df::diffuse_transmission_bsdf(transmissive_tint)), ::df::bsdf_component(specular_transmission_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), thin_walled ? ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_transmit) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_transmit)))), bsdf(), normal), 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 = ior; + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, transmissive_tint).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, transmissive_tint).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polycarbonate_Cloudy_Soft(*) +[[ + ::anno::display_name("Polycarbonate - Cloudy Soft"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PP", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy_Soft.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polycarbonate_Cloudy( + thin_walled: false, + ior: 1.584f, + roughness: 0.12, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(1.0f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.05f, + diffuse_transmission_weight: 0.35f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); + + + +export material Polycarbonate_Cloudy_Rough(*) +[[ + ::anno::display_name("Polycarbonate - Cloudy Rough"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PP", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polycarbonate_Cloudy( + thin_walled: false, + ior: 1.584f, + roughness: 0.715f, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(1.0f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.035f, + diffuse_transmission_weight: 0.357f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); + + + + +export material Polycarbonate_Cloudy_Thick(*) +[[ + ::anno::display_name("Polycarbonate - Cloudy Thick"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PP", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy_Thick.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polycarbonate_Cloudy( + thin_walled: false, + ior: 1.584f, + roughness: 0.2f, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(0.186989f, 0.002932f, 0.827726f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.035f, + diffuse_transmission_weight: 0.357f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Plastic/Polycarbonate_Opaque.mdl b/code/third_party/vMaterials_2/Plastic/Polycarbonate_Opaque.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a96ea6428edadd02b708e7a453d416e7407eebde --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polycarbonate_Opaque.mdl @@ -0,0 +1,1073 @@ +/****************************************************************************** + * 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 = "Diffuse plastic polycarbonate material for rendering of diffuse plastic with volumetric exhaustion."; + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polycarbonate_Opaque( + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::ui_order(0) + ]], + float IOR = 1.586f [[ + ::anno::description("Sets the Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float roughness = 0.f [[ + ::anno::description("Hight values lead to a blurrier reflection."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + uniform color diffuse_tint = color(0.752942f) [[ + ::anno::description("Adjusts the diffuse color of the surface."), + ::anno::display_name("Diffuse Tint"), + ::anno::in_group("Appearance"), + ::anno::ui_order(3) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance"), + ::anno::ui_order(4) + ]], + uniform float absorption_thickness = 20.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance"), + ::anno::ui_order(5) + ]], + uniform color transmissive_tint = color(0.98f) [[ + ::anno::description("Adjusts the transmissive color of the material. The color is influenced by the \"Diffuse Tint\" color parameter."), + ::anno::display_name("Transmissive Tint"), + ::anno::in_group("Appearance"), + ::anno::ui_order(6) + ]], +// Smudges + float smudges = 0.66f [[ + ::anno::description("Adds smudges and fingerprints for a less clean and perfect look"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::anno::ui_order(8) + ]], + +// Round Corners + uniform bool round_corners = true [[// Transform + ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(9) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(10) + ]], + 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(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(0.45f, .45f)), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::anno::ui_order(14) + ]], + 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::ui_order(15) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced"), + ::anno::ui_order(16) + ]]) +[[ + ::anno::display_name("Polycarbonate Opaque - White"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Opaque.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false); + + float roughness_smudges = (::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f); + + volume_info vol_inf = custom_volume_transmittance(units_absorption_thickness, absorption_thickness, color(0.214040995f, 0.214040995f, 0.214040995f), transmissive_tint); + + material_surface tmp1( + ::df::fresnel_layer( + IOR, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + color(1.f, 1.f, 1.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect + ), + ::df::weighted_layer( + 0.508f, + ::df::diffuse_reflection_bsdf(diffuse_tint, 0.f), + ::df::weighted_layer( + 1.f, + ::df::diffuse_transmission_bsdf(transmissive_tint), + bsdf(), + normal + ), + normal + ), + 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)); + + material_volume tmp4 = thin_walled ? + material_volume( + scattering: vdf(), + absorption_coefficient: color(0.f, 0.f, 0.f), + scattering_coefficient: color(0.f, 0.f, 0.f)) : + material_volume( + vdf(), + vol_inf.absorption_coefficient, + vol_inf.scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.001f, across_materials, 1.f) : ::state::normal()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: color(1.f, 1.f, 1.f), + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +export material Polycarbonate_Ivory(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Ivory"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "ivory", "white", "light", "neutral")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Ivory.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.896269f, 0.838799f, 0.686685f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.896269f, 0.730461f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Polycarbonate_Lemon(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Lemon"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "lemon", "yellow", "saturated", "warm", "light")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Lemon.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.715694f, 0.715694f, 0.045186f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.964686f, 0.964686f, 0.059511f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Yellow(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Yellow"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "yellow", "warm", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Yellow.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.871367f, 0.603827f, 0.045186f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.686685f, 0.049707f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Polycarbonate_Dark_Orange(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Dark Orange"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "dark", "orange", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.527115f, 0.127438f, 0.026241f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.514918f, 0.040915f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Red(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Red"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "red", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.644480f, 0.036889f, 0.036889f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.921582f, 0.049707f, 0.049707f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Magenta(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Magenta"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "magenta", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Magenta.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.539479f, 0.051269f, 0.545724f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.921582f, 0.049707f, 0.144128f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Purple(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Purple"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "purple", "saturated")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.191202f, 0.022174f, 0.456411f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.412543f, 0.049707f, 0.921582f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Dark_Blue(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Dark Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool", "dark")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.031896f, 0.061246f, 0.304987f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.056128f, 0.135633f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Blue(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.038204f, 0.171441f, 0.838799f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.042311f, 0.194618f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Sky_Blue(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Sky Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "sky", "light", "cool")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Sky_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.135633f, 0.356400f, 0.871367f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.070360f, 0.346704f, 0.964686f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Light_Blue(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Light Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "light", "cool")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Sky_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.258183f, 0.768151f, 0.822786f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.300544f, 0.896269f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Teal(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Teal"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "teal", "saturated", "cool")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Teal.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.040915f, 0.571125f, 0.323143f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.064803f, 0.955973f, 0.332452f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Dark_Green(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Dark Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "dark")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.026241f, 0.141263f, 0.026241f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.086500f, 0.854993f, 0.086500f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Green(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.023153f, 0.346704f, 0.023153f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.054480f, 0.938686f, 0.054480f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Light_Green(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Light Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.034340f, 0.679542f, 0.031896f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.054480f, 0.930111f, 0.054480f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Lime_Green(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Lime Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "lime", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Lime_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.208637f, 0.597202f, 0.031896f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.300544f, 0.879622f, 0.043735f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Black(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Black"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Black.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.038204f, 0.038204f, 0.038204f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.038204f, 0.038204f, 0.038204f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Dark_Gray(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Dark Gray"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.127438f, 0.127438f, 0.127438f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.822786f, 0.822786f, 0.822786f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polycarbonate_Light_Gray(*) +[[ + ::anno::display_name("Polycarbonate Opaque - Light Gray"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "light", "neutral")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polycarbonate_Opaque +( + thin_walled: false, + IOR: 1.586f, + roughness: 0.0f, + diffuse_tint: color(0.456411f, 0.456411f, 0.456411f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.991102f, 0.991102f, 0.991102f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Plastic/Polycarbonate_Spectral_Clear.mdl b/code/third_party/vMaterials_2/Plastic/Polycarbonate_Spectral_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..19a22c62686e5c8cd05a2d5f946100d836494ac9 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polycarbonate_Spectral_Clear.mdl @@ -0,0 +1,508 @@ +/****************************************************************************** + * 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 = "Polycarbonate plastic material using measured spectral IOR data to faithfully replicate refraction. Abbe Number and volumetric exhaustion"; + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 + )); +} + + +/* +const float[101] wavelengths = float[](436,443,449,455,461,467,473,479,486,492,498,504,510,516,522,529,535,541,547,553,559,566,572,578,584,590,596,602,609,615,621,627,633,639,646,652,658,664,670,676,682,689,695,701,707,713,719,725,732,738,744,750,756,762,769,775,781,787,793,799,805,812,818,824,830,836,842,849,855,861,867,873,879,885,892,898,904,910,916,922,929,935,941,947,953,959,965,972,978,984,990,996,1003,1009,1015,1021,1027,1034,1040,1046,1052); + +const float[101] n = float[](1.6113534731535,1.6096278743045,1.608008680966,1.6064378091279,1.6049614276881,1.6035268829489,1.6021766093443,1.6008627030574,1.5996242543646,1.5984175353673,1.5972786335563,1.5961675095991,1.5951175476049,1.59409198048,1.5931217522858,1.5921730105158,1.5912744914398,1.5903949482935,1.5895611149656,1.5887440824451,1.5879687643973,1.5872083559784,1.5864861125916,1.5857771291034,1.5851031470264,1.5844409812715,1.5838008329733,1.5831915451128,1.5825922271126,1.5820213664718,1.581459429338,1.5809237859116,1.5803961416248,1.5798928379671,1.5793967148917,1.5789231651447,1.5784560694792,1.5780099442307,1.5775696268826,1.5771488229157,1.5767332509389,1.5763358651043,1.5759431969878,1.5755675035632,1.5751960677848,1.5748404987946,1.5744887751509,1.5741519032095,1.5738185065161,1.5734990298276,1.5731826956489,1.5728745174647,1.5725789969801,1.5722861797736,1.5720052630201,1.5717267930096,1.5714595244499,1.5711944708607,1.5709399725252,1.5706874794993,1.5704449434909,1.570204222909,1.5699729047452,1.569743229844,1.5695224425311,1.5693031422165,1.5690922509639,1.568882704734,1.5686811222316,1.5684807556352,1.5682879378242,1.5680962183915,1.5679116606719,1.5677280942609,1.5675513280834,1.5673754555942,1.5672032975688,1.5670374398086,1.5668723447503,1.566713243952,1.5665548281525,1.566402119793,1.5662500254159,1.5661033693794,1.5659572623823,1.5658163410132,1.5656759092629,1.5655404255997,1.5654053771606,1.5652750533291,1.565145114906,1.5650196906584,1.5648906107223,1.5647718764198,1.5646552920379,1.5645408056894,1.5644283670513,1.5642997116759,1.5641915442184,1.5640852748091,1.5639808590615); +*/ + +export material Polycarbonate_Spectral_Clear( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass"), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.0f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(1.0f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polycarbonate Spectral Fresnel - Clear"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Spectral_Clear.Polycarbonate_Spectral_Clear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + float ior = 1.584f; + float[101] wavelengths = float[](436,443,449,455,461,467,473,479,486,492,498,504,510,516,522,529,535,541,547,553,559,566,572,578,584,590,596,602,609,615,621,627,633,639,646,652,658,664,670,676,682,689,695,701,707,713,719,725,732,738,744,750,756,762,769,775,781,787,793,799,805,812,818,824,830,836,842,849,855,861,867,873,879,885,892,898,904,910,916,922,929,935,941,947,953,959,965,972,978,984,990,996,1003,1009,1015,1021,1027,1034,1040,1046,1052); + + float[101] n = float[](1.6113534731535,1.6096278743045,1.608008680966,1.6064378091279,1.6049614276881,1.6035268829489,1.6021766093443,1.6008627030574,1.5996242543646,1.5984175353673,1.5972786335563,1.5961675095991,1.5951175476049,1.59409198048,1.5931217522858,1.5921730105158,1.5912744914398,1.5903949482935,1.5895611149656,1.5887440824451,1.5879687643973,1.5872083559784,1.5864861125916,1.5857771291034,1.5851031470264,1.5844409812715,1.5838008329733,1.5831915451128,1.5825922271126,1.5820213664718,1.581459429338,1.5809237859116,1.5803961416248,1.5798928379671,1.5793967148917,1.5789231651447,1.5784560694792,1.5780099442307,1.5775696268826,1.5771488229157,1.5767332509389,1.5763358651043,1.5759431969878,1.5755675035632,1.5751960677848,1.5748404987946,1.5744887751509,1.5741519032095,1.5738185065161,1.5734990298276,1.5731826956489,1.5728745174647,1.5725789969801,1.5722861797736,1.5720052630201,1.5717267930096,1.5714595244499,1.5711944708607,1.5709399725252,1.5706874794993,1.5704449434909,1.570204222909,1.5699729047452,1.569743229844,1.5695224425311,1.5693031422165,1.5690922509639,1.568882704734,1.5686811222316,1.5684807556352,1.5682879378242,1.5680962183915,1.5679116606719,1.5677280942609,1.5675513280834,1.5673754555942,1.5672032975688,1.5670374398086,1.5668723447503,1.566713243952,1.5665548281525,1.566402119793,1.5662500254159,1.5661033693794,1.5659572623823,1.5658163410132,1.5656759092629,1.5655404255997,1.5654053771606,1.5652750533291,1.565145114906,1.5650196906584,1.5648906107223,1.5647718764198,1.5646552920379,1.5645408056894,1.5644283670513,1.5642997116759,1.5641915442184,1.5640852748091,1.5639808590615); + color spec_ior = color(wavelengths, n); + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false); + + float roughness_smudges = ::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))); + + material_surface tmp1( + ::df::fresnel_layer( + ior, + (1.f), + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect + ), + ::df::tint( + color(1.f, 1.f, 1.f), + thin_walled ? transmittance : color(1.0f), + ::df::weighted_layer( + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness * roughness, + roughness * roughness, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect_transmit + ), + bsdf(), + normal + ) + ), + 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 = ::base::abbe_number_ior(ior, abbe_number); + color tmp3 = spec_ior; + + + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polycarbonate_Spectral_Smudges(*) +[[ + ::anno::display_name("Polycarbonate Spectral Fresnel - Smudges"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polycarbonate", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polycarbonate_Spectral_Clear.Polycarbonate_Spectral_Smudges.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polycarbonate_Spectral_Clear ( + thin_walled: false, + //ior: 1.584, + roughness: 0.0f, + units_absorption_thickness: unit_cm, + absorption_thickness: 10.0f, + transmittance: color(.98f), + smudges: 0.85f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 0.5f, + across_materials: false, + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Plastic/Polyethylene_Clear.mdl b/code/third_party/vMaterials_2/Plastic/Polyethylene_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f469dac171c5b2cb3fc5986a2a6b4d5b816ce666 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polyethylene_Clear.mdl @@ -0,0 +1,508 @@ +/****************************************************************************** + * 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 = "Clear polyethylene material with IOR, abbe number and volumetric exhaustion"; + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polyethylene_Clear( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.51f [[ + ::anno::description("Index of refraction"), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float abbe_number = 27.8394f [[ + ::anno::description("Dispersion in relation to index of refraction"), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass"), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.0f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(1.0f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polyethylene - Clear"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "clear", "synthetic", "transparent", "design", "packaging", "molded", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polyethylene_Clear.Polyethylene_Clear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false); + + float roughness_smudges = ::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))); + + material_surface tmp1( + ::df::fresnel_layer( + ior, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect + ), + ::df::tint( + color(1.f, 1.f, 1.f), + thin_walled ? transmittance : color(1.0f), + ::df::weighted_layer( + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness * roughness, + roughness * roughness, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect_transmit + ), + bsdf(), + normal + ) + ), + 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 = ::base::abbe_number_ior(ior, abbe_number); + + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polyethylene_Smudged(*) +[[ + ::anno::display_name("Polyethylene - Smudges"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "clear", "synthetic", "transparent", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polyethylene_Clear.Polyethylene_Smudged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polyethylene_Clear ( + thin_walled: false, + ior: 1.51f, + abbe_number: 27.8394f, + roughness: 0.0f, + units_absorption_thickness: unit_cm, + absorption_thickness: 10.0f, + transmittance: color(.98f), + smudges: 0.85f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 0.5f, + across_materials: false, + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Plastic/Polyethylene_Cloudy.mdl b/code/third_party/vMaterials_2/Plastic/Polyethylene_Cloudy.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c62a746401a5d99313b292607cb72c00ca0fc0b0 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polyethylene_Cloudy.mdl @@ -0,0 +1,570 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.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 cloudy polyethylene material with IOR, abbe number and volumetric exhaustion"; + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polyethylene_Cloudy( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.49f [[ + ::anno::description("Index of refraction."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + float roughness = 0.331f [[ + ::anno::description("Creates a frosted look."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color diffuse_tint = color(1.f, 1.f, 1.f) [[ + ::anno::description("Adjusts the diffuse color of the surface."), + ::anno::display_name("Diffuse Tint"), + ::anno::in_group("Appearance") + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + + uniform color transmissive_tint = color(0.915f) [[ + ::anno::display_name("Transmissive Tint"), + ::anno::description("Adjusts the transmissive color of the material. The color is influenced by the \"Diffuse Tint\" color parameter."), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(0.96f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// BSDF Weights + float diffuse_reflection_weight = 0.0775f [[ + ::anno::description("The weight of diffuse reflection. Note that the sum of all BSDF weights will be normalized."), + ::anno::display_name("Diffuse Reflection Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + float diffuse_transmission_weight = 0.476f [[ + ::anno::description("The weight of diffuse transmission. Note that the sum of all BSDF weights will be normalized."), + ::anno::display_name("Diffuse Transmission Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + float specular_transmission_weight = 1.0f [[ + ::anno::description("The weight of specular transmission. Note that the sum of all BSDF weights will be normalized."), + ::anno::display_name("Specular Transmission Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polyethylene - Cloudy"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1(::df::custom_curve_layer(0.04f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf((roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))) * (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))), (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))) * (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))), 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::clamped_mix(::df::bsdf_component[](::df::bsdf_component(diffuse_reflection_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), ::df::diffuse_reflection_bsdf(diffuse_tint, 0.f)), ::df::bsdf_component(diffuse_transmission_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), ::df::diffuse_transmission_bsdf(transmissive_tint)), ::df::bsdf_component(specular_transmission_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), thin_walled ? ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_transmit) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_transmit)))), bsdf(), normal), 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 = ior; + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, transmissive_tint).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, transmissive_tint).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polyethylene_Cloudy_Soft(*) +[[ + ::anno::display_name("Polyethylene - Cloudy Soft"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Soft.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polyethylene_Cloudy( + thin_walled: false, + ior: 1.49f, + roughness: 0.12, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(1.0f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.05f, + diffuse_transmission_weight: 0.35f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); + + + +export material Polyethylene_Cloudy_Rough(*) +[[ + ::anno::display_name("Polyethylene - Cloudy Rough"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polyethylene_Cloudy( + thin_walled: false, + ior: 1.49f, + roughness: 0.715f, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(1.0f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.035f, + diffuse_transmission_weight: 0.357f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); + + + + +export material Polyethylene_Cloudy_Thick(*) +[[ + ::anno::display_name("Polyethylene - Cloudy Thick"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Thick.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polyethylene_Cloudy( + thin_walled: false, + ior: 1.49f, + roughness: 0.2f, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(0.186989f, 0.002932f, 0.827726f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.035f, + diffuse_transmission_weight: 0.357f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Plastic/Polyethylene_Opaque.mdl b/code/third_party/vMaterials_2/Plastic/Polyethylene_Opaque.mdl new file mode 100644 index 0000000000000000000000000000000000000000..63ae06113f3544ae6491bf834543da3e5e9cb2cc --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polyethylene_Opaque.mdl @@ -0,0 +1,1090 @@ +/****************************************************************************** + * 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"; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polyethylene_Opaque( + +// Appearance + + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float IOR = 1.61f [[ + ::anno::description("Sets the Index of refraction. For PET the ior ranges typically from 1.58 - 1.64."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::soft_range(1.58f, 1.64f), + ::anno::ui_order(1) + ]], + float roughness = 0.f [[ + ::anno::description("Hight values lead to a blurrier reflection."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + color diffuse_tint = color(0.752942f) [[ + ::anno::description("Adjusts the diffuse color of the surface."), + ::anno::display_name("Diffuse Tint"), + ::anno::in_group("Appearance"), + ::anno::ui_order(3) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance"), + ::anno::ui_order(4) + ]], + uniform float absorption_thickness = 20.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance"), + ::anno::ui_order(5) + ]], + uniform color transmissive_tint = color(1.000000f) [[ + ::anno::description("Adjusts the transmissive color of the material. The color is influenced by the \"Diffuse Tint\" color parameter."), + ::anno::display_name("Transmissive Tint"), + ::anno::in_group("Appearance"), + ::anno::ui_order(6) + ]], + +// Smudges + float smudges = 0.10f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::anno::ui_order(8) + ]], + +// Transform + 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(9) + ]], + 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(10) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(0.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::anno::ui_order(11) + ]], + + +// Round Corners + uniform bool 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("Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]], + uniform float radius = 0.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(13) + ]], + 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(14) + ]], + +// 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::ui_order(15) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced"), + ::anno::ui_order(16) + ]]) +[[ + ::anno::description("A polyethylene plastic material."), + ::anno::display_name("Polyethylene Opaque - White"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth", "white")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Opaque.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false); + + float roughness_smudges = (::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f); + + volume_info vol_inf = custom_volume_transmittance(units_absorption_thickness, absorption_thickness, color(0.214040995f, 0.214040995f, 0.214040995f), transmissive_tint); + + material_surface tmp1( + ::df::fresnel_layer( + IOR, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + 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( + 0.508f, + ::df::diffuse_reflection_bsdf(diffuse_tint, 0.f), + ::df::weighted_layer( + 1.f, + ::df::diffuse_transmission_bsdf(transmissive_tint), + bsdf(), + normal + ), + normal + ), + normal), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + + material_volume tmp4 = thin_walled ? + material_volume( + scattering: vdf(), + absorption_coefficient: color(0.f, 0.f, 0.f), + scattering_coefficient: color(0.f, 0.f, 0.f)) : + material_volume( + vdf(), + vol_inf.absorption_coefficient, + vol_inf.scattering_coefficient); + + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + ior: color(1.f, 1.f, 1.f), + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +export material Polyethylene_Ivory(*) +[[ + ::anno::display_name("Polyethylene Opaque - Ivory"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "ivory", "white", "light", "neutral")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Ivory.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.896269f, 0.838799f, 0.686685f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.896269f, 0.730461f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Polyethylene_Lemon(*) +[[ + ::anno::display_name("Polyethylene Opaque - Lemon"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "lemon", "yellow", "saturated", "warm", "light")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Lemon.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.715694f, 0.715694f, 0.045186f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.964686f, 0.964686f, 0.059511f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Yellow(*) +[[ + ::anno::display_name("Polyethylene Opaque - Yellow"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "yellow", "warm", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Yellow.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.871367f, 0.603827f, 0.045186f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.686685f, 0.049707f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Polyethylene_Dark_Orange(*) +[[ + ::anno::display_name("Polyethylene Opaque - Dark Orange"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "dark", "orange", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.527115f, 0.127438f, 0.026241f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.514918f, 0.040915f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Red(*) +[[ + ::anno::display_name("Polyethylene Opaque - Red"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "red", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.644480f, 0.036889f, 0.036889f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.921582f, 0.049707f, 0.049707f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Magenta(*) +[[ + ::anno::display_name("Polyethylene Opaque - Magenta"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "magenta", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Magenta.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.539479f, 0.051269f, 0.545724f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.921582f, 0.049707f, 0.144128f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Purple(*) +[[ + ::anno::display_name("Polyethylene Opaque - Purple"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "purple", "saturated")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.191202f, 0.022174f, 0.456411f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.412543f, 0.049707f, 0.921582f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Dark_Blue(*) +[[ + ::anno::display_name("Polyethylene Opaque - Dark Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool", "dark")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.031896f, 0.061246f, 0.304987f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.056128f, 0.135633f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Blue(*) +[[ + ::anno::display_name("Polyethylene Opaque - Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.038204f, 0.171441f, 0.838799f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.042311f, 0.194618f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Sky_Blue(*) +[[ + ::anno::display_name("Polyethylene Opaque - Sky Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "sky", "light", "cool")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Sky_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.135633f, 0.356400f, 0.871367f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.070360f, 0.346704f, 0.964686f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Light_Blue(*) +[[ + ::anno::display_name("Polyethylene Opaque - Light Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "light", "cool")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Sky_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.258183f, 0.768151f, 0.822786f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.300544f, 0.896269f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Teal(*) +[[ + ::anno::display_name("Polyethylene Opaque - Teal"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "teal", "saturated", "cool")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Teal.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.040915f, 0.571125f, 0.323143f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.064803f, 0.955973f, 0.332452f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Dark_Green(*) +[[ + ::anno::display_name("Polyethylene Opaque - Dark Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "dark")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.026241f, 0.141263f, 0.026241f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.086500f, 0.854993f, 0.086500f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Green(*) +[[ + ::anno::display_name("Polyethylene Opaque - Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.023153f, 0.346704f, 0.023153f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.054480f, 0.938686f, 0.054480f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Light_Green(*) +[[ + ::anno::display_name("Polyethylene Opaque - Light Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Light_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.034340f, 0.679542f, 0.031896f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.054480f, 0.930111f, 0.054480f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Lime_Green(*) +[[ + ::anno::display_name("Polyethylene Opaque - Lime Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "lime", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Lime_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.208637f, 0.597202f, 0.031896f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.300544f, 0.879622f, 0.043735f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Black(*) +[[ + ::anno::display_name("Polyethylene Opaque - Black"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Black.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.038204f, 0.038204f, 0.038204f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.038204f, 0.038204f, 0.038204f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Dark_Gray(*) +[[ + ::anno::display_name("Polyethylene Opaque - Dark Gray"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.127438f, 0.127438f, 0.127438f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.822786f, 0.822786f, 0.822786f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polyethylene_Light_Gray(*) +[[ + ::anno::display_name("Polyethylene Opaque - Light Gray"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polyethylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polyethylene", "PE", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "light", "neutral")), + ::anno::thumbnail("./.thumbs/Polyethylene_Opaque.Polyethylene_Light_Gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polyethylene_Opaque +( + thin_walled: false, + IOR: 1.61f, + roughness: 0.0f, + diffuse_tint: color(0.456411f, 0.456411f, 0.456411f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.991102f, 0.991102f, 0.991102f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Plastic/Polymethylmethacrylate_Clear.mdl b/code/third_party/vMaterials_2/Plastic/Polymethylmethacrylate_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d220ae2907589ff8c497a6a62565fe8731bd339b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polymethylmethacrylate_Clear.mdl @@ -0,0 +1,505 @@ +/****************************************************************************** + * 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 = "Clear polycarbonate material with IOR, abbe number and volumetric exhaustion"; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polymethylmethacrylate_Clear( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.49f [[ + ::anno::description("Index of refraction"), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float abbe_number = 58.f [[ + ::anno::description("Dispersion in relation to index of refraction"), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass"), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_mm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 20.0f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(0.92f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges") + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polymethylmethacrylate (PMMA) - Clear"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polymethylmethacrylate", "PMMA", "clear", "synthetic", "transparent", "design", "architecture", "molded", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polymethylmethacrylate_Clear.Polymethylmethacrylate_Clear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false); + + float roughness_smudges = ::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))); + + material_surface tmp1( + ::df::fresnel_layer( + ior, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect), + ::df::tint(color(1.f, 1.f, 1.f), + thin_walled ? transmittance : color(1.0f), + ::df::weighted_layer( + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness * roughness, + roughness * roughness, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect_transmit + ), + bsdf(), + normal) + ), + 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 = ::base::abbe_number_ior(ior, abbe_number); + + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polymethylmethacrylate_Smudged(*) +[[ + ::anno::display_name("Polymethylmethacrylate (PMMA) - Smudges"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polymethylmethacrylate", "PMMA", "clear", "synthetic", "transparent", "design", "architecture", "molded", "infinite tiling", "smooth", "smudges")), + ::anno::thumbnail("./.thumbs/Polymethylmethacrylate_Clear.Polymethylmethacrylate_Smudged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polymethylmethacrylate_Clear ( + thin_walled: false, + ior: 1.49f, + abbe_number: 0.0f, + roughness: 0.0f, + units_absorption_thickness: unit_mm, + absorption_thickness: 3.0f, + transmittance: color(.98f), + smudges: 0.85f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 0.5f, + across_materials: false, + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Plastic/Polypropylene_Clear.mdl b/code/third_party/vMaterials_2/Plastic/Polypropylene_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..adfb8df8da51d5921f7ad5617998581be535cbbc --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polypropylene_Clear.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"; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polypropylene_Clear( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.49f [[ + ::anno::description("Index of refraction"), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float abbe_number = 0.f [[ + ::anno::description("Dispersion in relation to index of refraction"), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass"), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.0f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(1.0f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polypropylene - Clear"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("A clear plastic material with IOR, Abbe Number and volumetric exhaustion"), + ::anno::key_words(string[]("plastic", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polypropylene_Clear.Polypropylene_Clear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + ::base::texture_coordinate_info vm_uvw = vmat_transform( + texture_translate, + texture_rotate, + texture_scale * smudge_scale, + ::base::texture_coordinate_uvw, + uv_space_index + ); + + color endless_tex_lookup = endless_texture(smudges_tex, vm_uvw, 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false); + float roughness_smudges = ::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))); + + + material_surface tmp1( + ::df::fresnel_layer( + ior, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect), + ::df::tint(color(1.f, 1.f, 1.f), + thin_walled ? transmittance : color(1.0f), + ::df::weighted_layer( + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness * roughness, + roughness * roughness, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect_transmit + ), + bsdf(), + normal) + ), + 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 = ::base::abbe_number_ior(ior, abbe_number); + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polypropylene_Smudged(*) +[[ + ::anno::display_name("Polypropylene - Smudges"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("A clear plastic material with IOR, Abbe Number and volumetric exhaustion"), + ::anno::key_words(string[]("plastic", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polypropylene_Clear.Polypropylene_Smudged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polypropylene_Clear ( + thin_walled: false, + ior: 1.49f, + abbe_number: 0.0f, + roughness: 0.0f, + units_absorption_thickness: unit_cm, + absorption_thickness: 10.0f, + transmittance: color(.98f), + smudges: 0.85f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 0.5f, + across_materials: false, + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Plastic/Polypropylene_Cloudy.mdl b/code/third_party/vMaterials_2/Plastic/Polypropylene_Cloudy.mdl new file mode 100644 index 0000000000000000000000000000000000000000..850bd393892286c929abfe42f4217df07b5b0dcf --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polypropylene_Cloudy.mdl @@ -0,0 +1,568 @@ +/****************************************************************************** + * 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"; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polypropylene_Cloudy( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.49f [[ + ::anno::description("Index of refraction"), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + float roughness = 0.331f [[ + ::anno::description("Creates a frosted look"), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + color diffuse_tint = color(1.f, 1.f, 1.f) [[ + ::anno::description(""), + ::anno::display_name("Diffuse Tint"), + ::anno::in_group("Appearance") + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + + uniform color transmissive_tint = color(0.915f) [[ + ::anno::display_name("Transmissive Tint"), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(0.96f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// BSDF Weights + float diffuse_reflection_weight = 0.0775f [[ + ::anno::description("The weight of diffuse reflection. Note that the sum of all BSDF weights will be normalized"), + ::anno::display_name("Diffuse Reflection Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + float diffuse_transmission_weight = 0.476f [[ + ::anno::description("The weight of diffuse transmission. Note that the sum of all BSDF weights will be normalized"), + ::anno::display_name("Diffuse Transmission Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + float specular_transmission_weight = 1.0f [[ + ::anno::description("The weight of specular transmission. Note that the sum of all BSDF weights will be normalized"), + ::anno::display_name("Specular Transmission Weight"), + ::anno::in_group("Appearance", "BSDF Weights"), + ::anno::hard_range(0.f, 1.f) + ]], + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polypropylene - Cloudy"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("A cloudy plastic material with IOR, Abbe Number and volumetric exhaustion"), + ::anno::key_words(string[]("plastic", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf((roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))) * (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))), (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))) * (roughness * 0.5f + ::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.20000005f, 0.5f, ::math::pow(smudges, 0.25f)))), 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::clamped_mix(::df::bsdf_component[](::df::bsdf_component(diffuse_reflection_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), ::df::diffuse_reflection_bsdf(diffuse_tint, 0.f)), ::df::bsdf_component(diffuse_transmission_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), ::df::diffuse_transmission_bsdf(transmissive_tint)), ::df::bsdf_component(specular_transmission_weight / (diffuse_reflection_weight + diffuse_transmission_weight + specular_transmission_weight), thin_walled ? ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, transmittance, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_transmit) : ::df::microfacet_ggx_smith_bsdf(roughness * roughness, roughness * roughness, color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_transmit)))), bsdf(), normal), 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 = ior; + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, transmissive_tint).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, transmissive_tint).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polypropylene_Cloudy_Soft(*) +[[ + ::anno::display_name("Polypropylene - Cloudy Soft"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("A cloudy plastic material with IOR, Abbe Number and volumetric exhaustion"), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Soft.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polypropylene_Cloudy( + thin_walled: false, + ior: 1.49f, + roughness: 0.12, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(1.0f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.05f, + diffuse_transmission_weight: 0.35f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); + + + +export material Polypropylene_Cloudy_Rough(*) +[[ + ::anno::display_name("Polypropylene - Cloudy Rough"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("A cloudy plastic material with IOR, Abbe Number and volumetric exhaustion"), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polypropylene_Cloudy( + thin_walled: false, + ior: 1.49f, + roughness: 0.715f, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(1.0f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.035f, + diffuse_transmission_weight: 0.357f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); + + + + +export material Polypropylene_Cloudy_Thick(*) +[[ + ::anno::display_name("Polypropylene - Cloudy Thick"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("A thick cloudy polypropylene material with IOR, Abbe Number and volumetric exhaustion"), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "cloudy", "synthetic", "translucent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Thick.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polypropylene_Cloudy( + thin_walled: false, + ior: 1.49f, + roughness: 0.2f, + diffuse_tint: color(1.0f), + units_absorption_thickness: unit_cm, + absorption_thickness: 1.0f, + transmissive_tint: color(1.0f), + transmittance: color(0.186989f, 0.002932f, 0.827726f), + smudges: 0.0f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + diffuse_reflection_weight: 0.035f, + diffuse_transmission_weight: 0.357f, + specular_transmission_weight: 1.0f, + round_corners: false, + radius: .5f, + across_materials: false, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Plastic/Polypropylene_Opaque.mdl b/code/third_party/vMaterials_2/Plastic/Polypropylene_Opaque.mdl new file mode 100644 index 0000000000000000000000000000000000000000..dd0d5610382004b44870092fa7879f46a0747b20 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polypropylene_Opaque.mdl @@ -0,0 +1,1091 @@ +/****************************************************************************** + * 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"; + + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polypropylene_Opaque( + +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes t he material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float IOR = 1.49f [[ + ::anno::description("Sets the Index of refraction. For PP the ior is typically 1.49."), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(1.1f, 3.0f), + ::anno::ui_order(1) + ]], + float roughness = 0.f [[ + ::anno::description("Hight values lead to a blurrier reflection."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + color diffuse_tint = color(0.752942f) [[ + ::anno::description("Adjusts the diffuse color of the surface."), + ::anno::display_name("Diffuse Tint"), + ::anno::in_group("Appearance"), + ::anno::ui_order(3) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance"), + ::anno::ui_order(4) + ]], + uniform float absorption_thickness = 20.f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance"), + ::anno::ui_order(5) + ]], + uniform color transmissive_tint = color(1.000000f) [[ + ::anno::description("Adjusts the transmissive color of the material. The color is influenced by the \"Diffuse Tint\" color parameter."), + ::anno::display_name("Transmissive Tint"), + ::anno::in_group("Appearance"), + ::anno::ui_order(6) + ]], + +// Smudges + float smudges = 0.10f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::anno::ui_order(8) + ]], + +// Transform + 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(9) + ]], + 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(10) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(0.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::anno::ui_order(11) + ]], + + +// Round Corners + uniform bool 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("Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]], + uniform float radius = 0.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(13) + ]], + 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(14) + ]], + +// 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::ui_order(15) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced"), + ::anno::ui_order(16) + ]]) +[[ + ::anno::description("A polypropylene plastic material."), + ::anno::display_name("Polypropylene Opaque - White"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Opaque.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false); + + float roughness_smudges = (::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f); + + volume_info vol_inf = custom_volume_transmittance(units_absorption_thickness, absorption_thickness, color(0.214f, 0.214f, 0.214f), transmissive_tint); + + material_surface tmp1( + ::df::fresnel_layer( + IOR, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + 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( + 0.508f, + ::df::diffuse_reflection_bsdf( + diffuse_tint, 0.f + ), + ::df::weighted_layer( + 1.f, + ::df::diffuse_transmission_bsdf(transmissive_tint), + bsdf(), + normal), + normal + ), + 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)); + material_volume tmp4 = thin_walled ? + material_volume( + scattering: vdf(), + absorption_coefficient: color(0.f, 0.f, 0.f), + scattering_coefficient: color(0.f, 0.f, 0.f)) : + material_volume(vdf(), + vol_inf.absorption_coefficient, + vol_inf.scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.001f, across_materials, 1.f) : ::state::normal()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: color(1.f, 1.f, 1.f), + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +export material Polypropylene_Ivory(*) +[[ + ::anno::display_name("Polypropylene Opaque - Ivory"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "ivory", "white", "light", "neutral")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Ivory.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.896269f, 0.838799f, 0.686685f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.896269f, 0.730461f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Polypropylene_Lemon(*) +[[ + ::anno::display_name("Polypropylene Opaque - Lemon"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "lemon", "yellow", "saturated", "warm", "light")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Lemon.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.715694f, 0.715694f, 0.045186f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.964686f, 0.964686f, 0.059511f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Yellow(*) +[[ + ::anno::display_name("Polypropylene Opaque - Yellow"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "yellow", "warm", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Yellow.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.871367f, 0.603827f, 0.045186f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.686685f, 0.049707f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + +export material Polypropylene_Dark_Orange(*) +[[ + ::anno::display_name("Polypropylene Opaque - Dark Orange"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "dark", "orange", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.527115f, 0.127438f, 0.026241f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.955973f, 0.514918f, 0.040915f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Red(*) +[[ + ::anno::display_name("Polypropylene Opaque - Red"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "red", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.644480f, 0.036889f, 0.036889f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.921582f, 0.049707f, 0.049707f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Magenta(*) +[[ + ::anno::display_name("Polypropylene Opaque - Magenta"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "magenta", "saturated", "warm")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Magenta.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.539479f, 0.051269f, 0.545724f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.921582f, 0.049707f, 0.144128f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Purple(*) +[[ + ::anno::display_name("Polypropylene Opaque - Purple"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "purple", "saturated")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.191202f, 0.022174f, 0.456411f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.412543f, 0.049707f, 0.921582f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Dark_Blue(*) +[[ + ::anno::display_name("Polypropylene Opaque - Dark Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool", "dark")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.031896f, 0.061246f, 0.304987f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.056128f, 0.135633f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Blue(*) +[[ + ::anno::display_name("Polypropylene Opaque - Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.038204f, 0.171441f, 0.838799f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.042311f, 0.194618f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Sky_Blue(*) +[[ + ::anno::display_name("Polypropylene Opaque - Sky Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "sky", "light", "cool")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Sky_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.135633f, 0.356400f, 0.871367f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.070360f, 0.346704f, 0.964686f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Light_Blue(*) +[[ + ::anno::display_name("Polypropylene Opaque - Light Blue"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "light", "cool")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Sky_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.258183f, 0.768151f, 0.822786f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.300544f, 0.896269f, 0.955973f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Teal(*) +[[ + ::anno::display_name("Polypropylene Opaque - Teal"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "teal", "saturated", "cool")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Teal.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.040915f, 0.571125f, 0.323143f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.064803f, 0.955973f, 0.332452f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Dark_Green(*) +[[ + ::anno::display_name("Polypropylene Opaque - Dark Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "dark")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.026241f, 0.141263f, 0.026241f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.086500f, 0.854993f, 0.086500f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Green(*) +[[ + ::anno::display_name("Polypropylene Opaque - Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.023153f, 0.346704f, 0.023153f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.054480f, 0.938686f, 0.054480f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Light_Green(*) +[[ + ::anno::display_name("Polypropylene Opaque - Light Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Light_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.034340f, 0.679542f, 0.031896f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.054480f, 0.930111f, 0.054480f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Lime_Green(*) +[[ + ::anno::display_name("Polypropylene Opaque - Lime Green"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "lime", "saturated", "light")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Lime_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.208637f, 0.597202f, 0.031896f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.300544f, 0.879622f, 0.043735f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Black(*) +[[ + ::anno::display_name("Polypropylene Opaque - Black"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Black.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.038204f, 0.038204f, 0.038204f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.038204f, 0.038204f, 0.038204f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Dark_Gray(*) +[[ + ::anno::display_name("Polypropylene Opaque - Dark Gray"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.127438f, 0.127438f, 0.127438f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.822786f, 0.822786f, 0.822786f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + +export material Polypropylene_Light_Gray(*) +[[ + ::anno::display_name("Polypropylene Opaque - Light Gray"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), + ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "light", "neutral")), + ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Light_Gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Polypropylene_Opaque +( + thin_walled: false, + IOR: 1.49f, + roughness: 0.0f, + diffuse_tint: color(0.456411f, 0.456411f, 0.456411f), + units_absorption_thickness: unit_cm, + absorption_thickness: 20.0f, + transmissive_tint: color(0.991102f, 0.991102f, 0.991102f), + smudges: 0.1f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Plastic/Polystyrene_Clear.mdl b/code/third_party/vMaterials_2/Plastic/Polystyrene_Clear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..11529e66990e3d98d5e57f9486b07699dd03e74c --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Polystyrene_Clear.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 = "Clear polystyrene material with IOR, abbe number and volumetric exhaustion"; + +export enum unit_scale +[[ + ::anno::hidden() +]] +{ + unit_mm = 1, + unit_cm = 2, + unit_m = 3 +}; + +struct volume_info +[[ + ::anno::hidden() +]] +{ + color absorption_coefficient; + color scattering_coefficient; +}; + + +// simplified volume coefficients +// This function takes a transmittance value and and albedo and translates it into meaningful +// scattering and volume coefficients that are userfriendly +// +volume_info volume_transmittance_albedo( + uniform float density_scale = 1.0, + uniform color transmittance = color(0.5f), // transmittance color after unit distance + uniform color albedo = color(1.0f) +) +{ + color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; + color sigma_s = sigma_t * ::math::saturate(albedo); + return volume_info( + scattering_coefficient: sigma_s, + absorption_coefficient: sigma_t - sigma_s); +} + +// This function calculates the apropriate scattering and volume coefficients +// for a material of a given thickness. +// The user specifies the thickness of the material, e.g. 3mm and the amount +// of light passing through. The rest is automatically calculated for the material +// and the material_volume is returned. +volume_info custom_volume_transmittance( + uniform unit_scale unit_scale_select = unit_mm, + uniform float absorption_thickness = 3.0f, + uniform color transmittance = color(0.5f), + uniform color albedo = color(0.0f) +) +{ + absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; + float scalefactor; + switch(unit_scale_select){ + case unit_mm: scalefactor = 0.001f; break; + case unit_cm: scalefactor = 0.01f; break; + case unit_m: scalefactor = 1.0f; break; + default: scalefactor = 1.0f; + } + + + volume_info vol_coefficients = volume_transmittance_albedo( + density_scale: 1.0f/(absorption_thickness * scalefactor), + transmittance: transmittance, + albedo: albedo + ); + + return vol_coefficients; +} + + +::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)); +} + + +// 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)); +} + + + +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]); +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + +float2 rnd22(int2 p) { + 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 + + 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 + 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: 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, 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 Polystyrene_Clear( +// Appearance + uniform bool thin_walled = false [[ + ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), + ::anno::display_name("Thin Walled"), + ::anno::in_group("Appearance") + ]], + uniform float ior = 1.5894f [[ + ::anno::description("Index of refraction"), + ::anno::display_name("IOR"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 20.f), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float abbe_number = 31.3351f [[ + ::anno::description("Dispersion in relation to index of refraction"), + ::anno::display_name("Abbe Number"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 100.f) + ]], + float roughness = 0.f [[ + ::anno::description("Creates a frosted look of the glass"), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform unit_scale units_absorption_thickness = unit_cm [[ + ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), + ::anno::display_name("Units Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform float absorption_thickness = 10.0f [[ + ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), + ::anno::display_name("Absorption Thickness"), + ::anno::in_group("Appearance") + ]], + uniform color transmittance = color(1.0f) [[ + ::anno::description("The transmittance sets the amount of light that is left after light has travelled through a given material thickness which can be set with the parameter \"absorption thickness\". The transmittance can be set for RGB components separately to achieve a tinted appearance of the material."), + ::anno::display_name("Transmittance"), + ::anno::in_group("Appearance") + ]], + + +// Smudges + float smudges = 0.f [[ + ::anno::description("Determines the amount of smudges that appears on the surface of the material"), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 smudge_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Smudge Scale"), + ::anno::in_group("Appearance", "Smudges"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// 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.45f, .45f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + +// Round Corners + uniform bool 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 = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + 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") + ]], + +// 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) + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Override this input to provide a custom normal for the material."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Polystyrene - Clear"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polystyrene", "PS", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polystyrene_Clear.Polystyrene_Clear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = thin_walled; + + texture_2d smudges_tex = texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear); + + color endless_tex_lookup = endless_texture(smudges_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.0590000004f, 0.050999999f, 0.125f), 4.f, false); + + float roughness_smudges = ::math::pow(::math::max(float3(endless_tex_lookup)[0] * smudges, float3(endless_tex_lookup)[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))); + + material_surface tmp1( + ::df::fresnel_layer( + ior, + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness_smudges * roughness_smudges, + roughness_smudges * roughness_smudges, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect + ), + ::df::tint( + color(1.f, 1.f, 1.f), + thin_walled ? transmittance : color(1.0f), + ::df::weighted_layer( + 1.f, + ::df::microfacet_ggx_smith_bsdf( + roughness * roughness, + roughness * roughness, + color(1.f, 1.f, 1.f), + color(0.f, 0.f, 0.f), + ::state::texture_tangent_u(0), + ::df::scatter_reflect_transmit + ), + bsdf(), + normal + ) + ), + 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 = ::base::abbe_number_ior(ior, abbe_number); + + material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, transmittance, color(0.f, 0.f, 0.f)).scattering_coefficient); + material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 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 Polystyrene_Smudged(*) +[[ + ::anno::display_name("Polystyrene - Smudges"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("plastic", "polystyrene", "PS", "clear", "synthetic", "transparent", "design", "packagaing", "molded", "smudged", "smudges", "infinite tiling", "smooth")), + ::anno::thumbnail("./.thumbs/Polystyrene_Clear.Polystyrene_Smudged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Polystyrene_Clear ( + thin_walled: false, + ior: 1.5894f, + abbe_number: 31.3351f, + roughness: 0.0f, + units_absorption_thickness: unit_cm, + absorption_thickness: 10.0f, + transmittance: color(.98f), + smudges: 0.85f, + smudge_scale: float2(1.0f), + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + round_corners: false, + radius: 0.5f, + across_materials: false, + uv_space_index: 0, + normal: ::state::normal() +); diff --git a/code/third_party/vMaterials_2/Plastic/Styrofoam.mdl b/code/third_party/vMaterials_2/Plastic/Styrofoam.mdl new file mode 100644 index 0000000000000000000000000000000000000000..63702b5a06de575e52fba1262065309bf4d63ee0 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/Styrofoam.mdl @@ -0,0 +1,356 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + + +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 Styrofoam( + 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 brightness = 0.7f [[ + ::anno::description("Adjusts the lightness of the material"), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance") + ]], + float roughness = 0.7f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance") + ]], + float translucency_amount = .75f [[ + ::anno::description("Sets the amount of translucency for the material."), + ::anno::display_name("Transluceny Amount"), + ::anno::in_group("Appearance") + ]], + uniform bool subsurface_scattering = true [[ + ::anno::display_name("Subsurface Scattering"), + ::anno::description("Enables / Disables subsurface scattering"), + ::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(.12f, .12f)), + ::anno::in_group("Transform") + ]], + 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("Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters (mm)"), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners") + ]], + 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("Styrofoam"), + ::anno::description("Foamed polystyrene material with subsurface scattering"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Styrofoam.Styrofoam.png"), + ::anno::key_words(string[]("plastic", "styrofoam", "polystyrene", "SSS", "volumetric", "synthetic", "construction", "new", "translucent", "artificial", "packaging", "rough", "bumped", "white", "neutral", "light")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/styrofoam_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.74300003f, float3(0.624000013f, 0.961000025f, 0.486000001f), 1.74300003f, true) : ::base::file_texture(texture_2d("./textures/styrofoam_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.899999976f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/styrofoam_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.74300003f, float3(0.624000013f, 0.961000025f, 0.486000001f), 1.74300003f, true) : ::base::file_texture(texture_2d("./textures/styrofoam_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.899999976f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/styrofoam_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.74300003f, float3(0.624000013f, 0.961000025f, 0.486000001f), 1.74300003f, true) : ::base::file_texture(texture_2d("./textures/styrofoam_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.899999976f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/styrofoam_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.74300003f, float3(0.624000013f, 0.961000025f, 0.486000001f), 1.74300003f, true) : ::base::file_texture(texture_2d("./textures/styrofoam_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.899999976f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(translucency_amount * 0.5f, ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f)), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/styrofoam_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.74300003f, float3(0.819999993f, 0.842999995f, 0.870999992f), 1.74300003f, true) : ::base::file_texture(texture_2d("./textures/styrofoam_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.256999999f, 0.f, brightness), true).tint, 0.484000027f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/styrofoam_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.74300003f, float3(0.497999996f, 0.474999994f, 0.995999992f), 1.74300003f) : ::base::tangent_space_normal_texture(texture_2d("./textures/styrofoam_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)), ::state::normal()), infinite_tiling ? endless_normal(texture_2d("./textures/styrofoam_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.74300003f, float3(0.497999996f, 0.474999994f, 0.995999992f), 1.74300003f) : ::base::tangent_space_normal_texture(texture_2d("./textures/styrofoam_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 = subsurface_scattering ? material_volume(scattering: vdf(), absorption_coefficient: color(0.223414004f, 0.223414004f, 0.223414004f), scattering_coefficient: color(12.8298368f, 9.16941357f, 7.8158741f)) : material_volume(scattering: vdf(), absorption_coefficient: color(0.223414004f, 0.223414004f, 0.223414004f), 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 * 0.00100000005f, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Styrofoam_no_SSS(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Styrofoam wo. SSS"), + ::anno::description("Foamed polystyrene material with subsurface scattering"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Styrofoam.Styrofoam_no_SSS.png"), + ::anno::key_words(string[]("plastic", "styrofoam", "polystyrene", "SSS", "volumetric", "synthetic", "construction", "new", "translucent", "artificial", "packaging", "rough", "bumped", "white", "neutral", "light")) +]] = Styrofoam( + infinite_tiling: true, + brightness: 0.7f, + roughness: 0.7f, + translucency_amount: 0.75f , + subsurface_scattering: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/mirror_manifest.json b/code/third_party/vMaterials_2/mirror_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..e19c80e14c8d758db4be0a5a90b28b6a02f84969 --- /dev/null +++ b/code/third_party/vMaterials_2/mirror_manifest.json @@ -0,0 +1,26298 @@ +{ + "source_bucket": "https://omniverse-content-production.s3.us-west-2.amazonaws.com", + "source_prefix": "Materials/vMaterials_2/", + "mirrored_utc": "2026-07-07T20:52:11Z", + "file_count": 6572, + "total_bytes": 2259286632, + "failed_keys": [], + "files": [ + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Carpet_Woven.mdl.png", + "size": 99199 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Carpet_Woven.mdl@Carpet_Woven.png", + "size": 99199 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Carpet_Woven.mdl@Carpet_Woven_Bordeaux.png", + "size": 106366 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Carpet_Woven.mdl@Carpet_Woven_Cherry_Red.png", + "size": 107979 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Carpet_Woven.mdl@Carpet_Woven_Dark_Blue_Gray.png", + "size": 97449 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Carpet_Woven.mdl@Carpet_Woven_Green.png", + "size": 107796 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Carpet_Woven.mdl@Carpet_Woven_Orange.png", + "size": 107723 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Carpet_Woven.mdl@Carpet_Woven_Sky_Blue.png", + "size": 107379 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl.png", + "size": 116118 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl@Fabric_Carpet_Long_Floor.png", + "size": 116118 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl@Fabric_Carpet_Long_Floor_Blue.png", + "size": 113475 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl@Fabric_Carpet_Long_Floor_Bordeaux.png", + "size": 110274 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl@Fabric_Carpet_Long_Floor_Green.png", + "size": 109300 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl@Fabric_Carpet_Long_Floor_Light_Green.png", + "size": 113478 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl@Fabric_Carpet_Long_Floor_Orange.png", + "size": 110909 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl@Fabric_Carpet_Long_Floor_Rose.png", + "size": 113283 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Fabric_Carpet_Long_Floor.mdl@Fabric_Carpet_Long_Floor_Yellow.png", + "size": 115187 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Rug_Carpet.mdl.png", + "size": 83053 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Rug_Carpet.mdl@Rug_Carpet_Base.png", + "size": 83053 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Rug_Carpet.mdl@Rug_Carpet_Hexagonal.png", + "size": 83031 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Rug_Carpet.mdl@Rug_Carpet_Honeycomb.png", + "size": 85236 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/256x256/Rug_Carpet.mdl@Rug_Carpet_Lines.png", + "size": 83058 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Carpet_Woven.Carpet_Woven.png", + "size": 96948 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Carpet_Woven.Carpet_Woven_Bordeaux.png", + "size": 99310 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Carpet_Woven.Carpet_Woven_Cherry_Red.png", + "size": 102007 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Carpet_Woven.Carpet_Woven_Dark_Blue_Gray.png", + "size": 90588 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Carpet_Woven.Carpet_Woven_Green.png", + "size": 100675 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Carpet_Woven.Carpet_Woven_Orange.png", + "size": 102034 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Carpet_Woven.Carpet_Woven_Sky_Blue.png", + "size": 100367 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor.png", + "size": 99832 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Blue.png", + "size": 87019 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Bordeaux.png", + "size": 82680 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Green.png", + "size": 83037 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Light_Green.png", + "size": 87466 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Orange.png", + "size": 85944 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Rose.png", + "size": 87953 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Yellow.png", + "size": 89732 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Rug_Carpet.Rug_Carpet_Base.png", + "size": 88435 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Rug_Carpet.Rug_Carpet_Hexagonal.png", + "size": 86417 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Rug_Carpet.Rug_Carpet_Honeycomb.png", + "size": 89133 + }, + { + "key": "Materials/vMaterials_2/Carpet/.thumbs/Rug_Carpet.Rug_Carpet_Lines.png", + "size": 88413 + }, + { + "key": "Materials/vMaterials_2/Carpet/Carpet_Woven.mdl", + "size": 19522 + }, + { + "key": "Materials/vMaterials_2/Carpet/Fabric_Carpet_Long_Floor.mdl", + "size": 23823 + }, + { + "key": "Materials/vMaterials_2/Carpet/Rug_Carpet.mdl", + "size": 35621 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/carpet_rough_woven_diff.jpg", + "size": 2250464 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.jpg", + "size": 6302294 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/carpet_rough_woven_norm.jpg", + "size": 4368264 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/long_floor_carpet_diff.jpg", + "size": 2420790 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/long_floor_carpet_multi_R_rough_G_ao.jpg", + "size": 4294058 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/long_floor_carpet_norm.jpg", + "size": 6686555 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/rug_carpet_01_multi_R_rough_G_ao_B_bumpao.jpg", + "size": 1735029 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/rug_carpet_01_norm.jpg", + "size": 1943452 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/rug_carpet_02_multi_R_rough_G_ao_B_bumpao.jpg", + "size": 1985704 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/rug_carpet_02_norm.jpg", + "size": 1915656 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/rug_carpet_03_multi_R_rough_G_ao_B_bumpao.jpg", + "size": 1442332 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/rug_carpet_03_norm.jpg", + "size": 1564776 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/rug_carpet_anisotropy.jpg", + "size": 1797463 + }, + { + "key": "Materials/vMaterials_2/Carpet/textures/rug_carpet_multi_fibers.jpg", + "size": 6690497 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl.png", + "size": 81326 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Antique_White.png", + "size": 91100 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Antique_White_Dirty.png", + "size": 92261 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Black.png", + "size": 71913 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Black_Matte.png", + "size": 80739 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Black_Matte_Rough.png", + "size": 76684 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Dark_Blue_New_Matte.png", + "size": 84260 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Dark_Blue_Varied_New.png", + "size": 85207 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Graphite.png", + "size": 77133 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Graphite_Matte.png", + "size": 77081 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Graphite_Varied.png", + "size": 76299 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Green.png", + "size": 93400 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Green_Matte.png", + "size": 90288 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Green_Varied.png", + "size": 92778 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Lime_Green.png", + "size": 86003 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Lime_Green_Varied.png", + "size": 86298 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Mint.png", + "size": 79083 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Mint_Varied.png", + "size": 78830 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Petrol.png", + "size": 77521 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Petrol_Varied.png", + "size": 77583 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Red.png", + "size": 80417 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Red_Varied.png", + "size": 80865 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Sky.png", + "size": 98193 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Vintage_Green_Bathroom.png", + "size": 100700 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_White_Matte.png", + "size": 79382 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Yellow.png", + "size": 87754 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Diamond_Yellow_Varied.png", + "size": 88375 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond.mdl@Ceramic_Tiles_Glazed_Diamond.png", + "size": 81326 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl.png", + "size": 81350 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Glazed_Diamond_Offset.png", + "size": 81350 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Antique_White.png", + "size": 91090 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Antique_White_Dirty.png", + "size": 92350 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Black.png", + "size": 72121 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Black_Matte.png", + "size": 80455 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Dark_Blue_New_Matte.png", + "size": 84167 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Dark_Blue_Varied_New.png", + "size": 82266 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Graphite.png", + "size": 77068 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Graphite_Matte.png", + "size": 77098 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Graphite_Varied.png", + "size": 77708 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Green.png", + "size": 93917 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Green_Matte.png", + "size": 90291 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Green_Varied.png", + "size": 90323 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Lime_Green.png", + "size": 86146 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Lime_Green_Varied.png", + "size": 87550 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Mint.png", + "size": 79328 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Mint_Varied.png", + "size": 79610 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Petrol.png", + "size": 77853 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Petrol_Varied.png", + "size": 78245 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Red.png", + "size": 81099 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Red_Varied.png", + "size": 82283 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Sky.png", + "size": 98553 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Vintage_Green_Bathroom.png", + "size": 102807 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_White_Matte.png", + "size": 79587 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Yellow.png", + "size": 88427 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Diamond_Offset.mdl@Ceramic_Tiles_Offset_Diamond_Yellow_Varied.png", + "size": 89709 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl.png", + "size": 88020 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Glazed_Mosaic_Shifted.png", + "size": 88020 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Antique_White.png", + "size": 90340 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Antique_White_Dirty.png", + "size": 94782 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Black.png", + "size": 77766 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Black_Matte.png", + "size": 77621 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Black_Matte_Rough.png", + "size": 80156 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Brown.png", + "size": 83359 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Dark_Blue_Matte.png", + "size": 88385 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Dark_Blue_Varied_New.png", + "size": 87231 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Dark_Gray.png", + "size": 79398 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Dark_Gray_Matte.png", + "size": 78096 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Dark_Green_Matte.png", + "size": 87746 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Dark_Green_New.png", + "size": 90191 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Dark_Green_Varied_New.png", + "size": 89230 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Gray.png", + "size": 80969 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Gray_Matte.png", + "size": 79812 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Gray_Matte_Varied.png", + "size": 80170 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Lime_Green.png", + "size": 87836 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Lime_Green_Varied.png", + "size": 87550 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Mint.png", + "size": 83711 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Mint_Varied.png", + "size": 83431 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Petrol.png", + "size": 82941 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Petrol_Varied.png", + "size": 84638 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Red.png", + "size": 88097 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Red_Varied.png", + "size": 87788 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_White.png", + "size": 82310 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_White_Matte.png", + "size": 81654 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_White_Worn_Matte.png", + "size": 92206 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Yellow.png", + "size": 88809 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl@Ceramic_Tiles_Mosaic_Shifted_Yellow_Varied.png", + "size": 88915 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl.png", + "size": 81944 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Glazed_Paseo.png", + "size": 81944 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Black.png", + "size": 72828 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Black_Matte.png", + "size": 73143 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Black_Matte_Rough.png", + "size": 75970 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Brown.png", + "size": 78046 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Dark_Blue_Matte.png", + "size": 83704 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Dark_Blue_Varied_New.png", + "size": 81581 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Dark_Gray.png", + "size": 74360 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Dark_Gray_Matte.png", + "size": 73787 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Dark_Green_Matte.png", + "size": 82041 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Dark_Green_New.png", + "size": 85164 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Dark_Green_Varied_New.png", + "size": 85112 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Gray.png", + "size": 76603 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Gray_Matte.png", + "size": 75049 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Gray_Matte_Varied.png", + "size": 75378 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Lime_Green.png", + "size": 82522 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Lime_Green_Varied.png", + "size": 82968 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Mint.png", + "size": 78424 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Mint_Varied.png", + "size": 78923 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Petrol.png", + "size": 77780 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Petrol_Varied.png", + "size": 78578 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Red.png", + "size": 82354 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Red_Varied.png", + "size": 82670 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_White.png", + "size": 77811 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_White_Matte.png", + "size": 77309 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_White_Worn_Matte.png", + "size": 88994 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_White_Worn_Matte_Dirty.png", + "size": 96959 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Yellow.png", + "size": 83094 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Paseo.mdl@Ceramic_Tiles_Paseo_Yellow_Varied.png", + "size": 83782 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl.png", + "size": 114032 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Glazed_Penny.png", + "size": 114032 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Antique_White.png", + "size": 111766 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Black.png", + "size": 102216 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Black_Matte.png", + "size": 102098 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Dark_Blue_New_Matte.png", + "size": 111817 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Dark_Blue_Varied_New.png", + "size": 116162 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Graphite.png", + "size": 98996 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Graphite_Matte.png", + "size": 96198 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Graphite_Varied.png", + "size": 99781 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Green.png", + "size": 116949 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Green_Matte.png", + "size": 112647 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Green_Varied.png", + "size": 117404 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Lime_Green.png", + "size": 116461 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Lime_Green_Varied.png", + "size": 117553 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Mint.png", + "size": 109347 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Mint_Varied.png", + "size": 109871 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Petrol.png", + "size": 111994 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Petrol_Varied.png", + "size": 112692 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Red.png", + "size": 112491 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Red_Varied.png", + "size": 112645 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Sky.png", + "size": 121933 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Vintage_Green_Bathroom.png", + "size": 120531 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_White_Matte.png", + "size": 103650 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Yellow.png", + "size": 119180 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Penny.mdl@Ceramic_Tiles_Penny_Yellow_Varied.png", + "size": 120280 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl.png", + "size": 81832 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Glazed_Pinwheel.png", + "size": 81832 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Antique_White.png", + "size": 86256 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Antique_White_Dirty.png", + "size": 88654 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Black.png", + "size": 74535 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Black_Matte.png", + "size": 80922 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Black_Matte_Rough.png", + "size": 77827 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Dark_Blue_New_Matte.png", + "size": 83551 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Dark_Blue_Varied_New.png", + "size": 84081 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Graphite.png", + "size": 76946 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Graphite_Matte.png", + "size": 76329 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Graphite_Varied.png", + "size": 75075 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Green.png", + "size": 92808 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Green_Matte.png", + "size": 88744 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Green_Varied.png", + "size": 90567 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Lime_Green.png", + "size": 83701 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Lime_Green_Varied.png", + "size": 84510 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Mint.png", + "size": 77490 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Mint_Varied.png", + "size": 77386 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Petrol.png", + "size": 78778 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Petrol_Varied.png", + "size": 78621 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Red.png", + "size": 79188 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Red_Varied.png", + "size": 79385 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Sky.png", + "size": 96302 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Vintage_Green_Bathroom.png", + "size": 99887 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_White_Matte.png", + "size": 76965 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Yellow.png", + "size": 85141 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Pinwheel.mdl@Ceramic_Tiles_Pinwheel_Yellow_Varied.png", + "size": 86042 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl.png", + "size": 87855 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Glazed_Square.png", + "size": 87855 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Antique_White.png", + "size": 93194 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Antique_White_Dirty.png", + "size": 98251 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Black.png", + "size": 77908 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Black_Matte.png", + "size": 78911 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Black_Matte_Rough.png", + "size": 81090 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Brown.png", + "size": 83206 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Dark_Blue_New_Matte.png", + "size": 89291 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Dark_Blue_Varied_New.png", + "size": 87777 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Dark_Gray.png", + "size": 79103 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Dark_Gray_Matte.png", + "size": 78862 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Dark_Green_New.png", + "size": 89339 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Dark_Green_New_Matte.png", + "size": 86833 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Dark_Green_Varied_New.png", + "size": 89373 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Gray.png", + "size": 80296 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Gray_Matte.png", + "size": 79702 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Gray_Matte_Varied.png", + "size": 80171 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Lime_Green.png", + "size": 88314 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Lime_Green_Varied.png", + "size": 88105 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Mint.png", + "size": 83988 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Mint_Varied.png", + "size": 84201 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Petrol.png", + "size": 83652 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Petrol_Varied.png", + "size": 84396 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Red.png", + "size": 88134 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Red_Varied.png", + "size": 87913 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_White.png", + "size": 82515 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_White_Matte.png", + "size": 81971 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_White_Worn_Matte.png", + "size": 95249 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Yellow.png", + "size": 89234 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square.mdl@Ceramic_Tiles_Square_Yellow_Varied.png", + "size": 89269 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl.png", + "size": 84005 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Glazed_Square_Brick.png", + "size": 84005 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Black.png", + "size": 74194 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Black_Matte.png", + "size": 74603 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Black_Matte_Rough.png", + "size": 77424 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Brown.png", + "size": 79600 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Dark_Blue_Matte.png", + "size": 84847 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Dark_Blue_Varied_New.png", + "size": 83326 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Dark_Gray.png", + "size": 75822 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Dark_Gray_Matte.png", + "size": 74737 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Dark_Green_Matte.png", + "size": 82713 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Dark_Green_New.png", + "size": 85723 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Dark_Green_Varied_New.png", + "size": 84664 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Gray.png", + "size": 77762 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Gray_Matte.png", + "size": 76209 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Gray_Matte_Varied.png", + "size": 76648 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Lime_Green.png", + "size": 84177 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Lime_Green_Varied.png", + "size": 84285 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Mint.png", + "size": 80446 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Mint_Varied.png", + "size": 80309 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Petrol.png", + "size": 79392 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Petrol_Varied.png", + "size": 79909 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Red.png", + "size": 83956 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Red_Varied.png", + "size": 83063 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_White.png", + "size": 79253 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_White_Matte.png", + "size": 78537 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_White_Worn_Matte.png", + "size": 90962 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Yellow.png", + "size": 84993 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Square_Brick.mdl@Ceramic_Tiles_Square_Brick_Yellow_Varied.png", + "size": 85198 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl.png", + "size": 90450 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Glazed_Subway.png", + "size": 90450 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Antique_White_Dirty.png", + "size": 94995 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Black.png", + "size": 76140 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Black_Matte.png", + "size": 76863 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Black_Matte_Rough.png", + "size": 79592 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Cappucino.png", + "size": 83903 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Dark_Gray.png", + "size": 77838 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Dark_Gray_Matte.png", + "size": 77270 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Dark_Green_Matte.png", + "size": 84842 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Dark_Green_New.png", + "size": 86971 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Dark_Green_Varied_New.png", + "size": 87187 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Gray.png", + "size": 80299 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Gray_Matte.png", + "size": 78736 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Gray_Matte_Varied.png", + "size": 79024 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Lime_Green.png", + "size": 87440 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Lime_Green_Varied.png", + "size": 87418 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Mint.png", + "size": 83366 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Mint_Varied.png", + "size": 82475 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Petrol.png", + "size": 82005 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Petrol_Varied.png", + "size": 83224 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Red.png", + "size": 86694 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Red_Varied.png", + "size": 87294 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_White.png", + "size": 81486 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_White_Matte.png", + "size": 81041 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_White_Worn_Matte.png", + "size": 90836 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Yellow.png", + "size": 87966 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Subway.mdl@Ceramic_Tiles_Subway_Yellow_Varied.png", + "size": 87899 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl.png", + "size": 83769 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Glazed_Versailles.png", + "size": 83769 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Antique_White.png", + "size": 90397 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Antique_White_Dirty.png", + "size": 91779 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Black.png", + "size": 75509 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Black_Matte.png", + "size": 82301 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Black_Matte_Rough.png", + "size": 79223 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Dark_Blue_New_Matte.png", + "size": 86111 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Dark_Blue_Varied_New.png", + "size": 87709 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Graphite.png", + "size": 78196 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Graphite_Matte.png", + "size": 78016 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Graphite_Varied.png", + "size": 77754 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Green.png", + "size": 94504 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Green_Matte.png", + "size": 90938 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Green_Varied.png", + "size": 95053 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Lime_Green.png", + "size": 87058 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Lime_Green_Varied.png", + "size": 87299 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Mint.png", + "size": 81495 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Mint_Varied.png", + "size": 81321 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Petrol.png", + "size": 80152 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Petrol_Varied.png", + "size": 79611 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Red.png", + "size": 82821 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Red_Varied.png", + "size": 82553 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Sky.png", + "size": 99594 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Vintage_Green_Bathroom.png", + "size": 105269 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_White_Matte.png", + "size": 81146 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Yellow.png", + "size": 88897 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Ceramic_Tiles_Glazed_Versailles.mdl@Ceramic_Tiles_Versailles_Yellow_Varied.png", + "size": 89678 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Grog_Fired_Clay.mdl.png", + "size": 93948 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Grog_Fired_Clay.mdl@Grog_Fired_Clay.png", + "size": 93948 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Grog_Fired_Clay.mdl@Grog_Fired_Clay_Dirt.png", + "size": 98906 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Grog_Fired_Clay.mdl@Grog_Fired_Clay_Dried_Dirt.png", + "size": 95665 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/256x256/Grog_Fired_Clay.mdl@Grog_Fired_Clay_Glaced.png", + "size": 94600 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Antique_White.png", + "size": 96954 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Antique_White_Dirty.png", + "size": 95879 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Black.png", + "size": 88156 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Black_Matte.png", + "size": 88648 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Black_Matte_Rough.png", + "size": 87405 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Dark_Blue_New_Matte.png", + "size": 95727 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Dark_Blue_Varied_New.png", + "size": 94480 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Graphite.png", + "size": 90850 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Graphite_Matte.png", + "size": 90336 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Graphite_Varied.png", + "size": 89434 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Green.png", + "size": 92467 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Green_Matte.png", + "size": 92817 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Green_Varied.png", + "size": 92600 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Lime_Green.png", + "size": 92834 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Lime_Green_Varied.png", + "size": 94317 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Mint.png", + "size": 92111 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Mint_Varied.png", + "size": 93052 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Petrol.png", + "size": 89014 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Petrol_Varied.png", + "size": 90383 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Red.png", + "size": 89516 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Red_Varied.png", + "size": 90371 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Sky.png", + "size": 101104 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Vintage_Green_Bathroom.png", + "size": 98228 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_White_Matte.png", + "size": 99574 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Yellow.png", + "size": 96128 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Diamond_Yellow_Varied.png", + "size": 97666 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond.Ceramic_Tiles_Glazed_Diamond.png", + "size": 95569 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Glazed_Diamond_Offset.png", + "size": 90816 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Antique_White.png", + "size": 95286 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Antique_White_Dirty.png", + "size": 93896 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Black.png", + "size": 82766 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Black_Matte.png", + "size": 83284 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Dark_Blue_New_Matte.png", + "size": 90879 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Dark_Blue_Varied_New.png", + "size": 90823 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Graphite.png", + "size": 88047 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Graphite_Matte.png", + "size": 87644 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Graphite_Varied.png", + "size": 88944 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Green.png", + "size": 88458 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Green_Matte.png", + "size": 87996 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Green_Varied.png", + "size": 89574 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Lime_Green.png", + "size": 91972 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Lime_Green_Varied.png", + "size": 93734 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Mint.png", + "size": 90557 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Mint_Varied.png", + "size": 91887 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Petrol.png", + "size": 86682 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Petrol_Varied.png", + "size": 87551 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Red.png", + "size": 89557 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Red_Varied.png", + "size": 90594 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Sky.png", + "size": 97967 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Vintage_Green_Bathroom.png", + "size": 97605 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_White_Matte.png", + "size": 97401 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Yellow.png", + "size": 95159 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Yellow_Varied.png", + "size": 96948 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Glazed_Mosaic_Shifted.png", + "size": 92917 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Antique_White.png", + "size": 104037 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Antique_White_Dirty.png", + "size": 101708 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Black.png", + "size": 86286 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Black_Matte.png", + "size": 85499 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Black_Matte_Rough.png", + "size": 85935 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Brown.png", + "size": 86504 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Dark_Blue_Matte.png", + "size": 92242 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Dark_Blue_Varied_New.png", + "size": 95939 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Dark_Gray.png", + "size": 84722 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Dark_Gray_Matte.png", + "size": 83647 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Dark_Green_Matte.png", + "size": 89302 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Dark_Green_New.png", + "size": 90113 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Dark_Green_Varied_New.png", + "size": 90618 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Gray.png", + "size": 85265 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Gray_Matte.png", + "size": 84207 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Gray_Matte_Varied.png", + "size": 91759 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Lime_Green.png", + "size": 96925 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Lime_Green_Varied.png", + "size": 99356 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Mint.png", + "size": 91488 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Mint_Varied.png", + "size": 95533 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Petrol.png", + "size": 89126 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Petrol_Varied.png", + "size": 93999 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Red.png", + "size": 95094 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Red_Varied.png", + "size": 96414 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_White.png", + "size": 101052 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_White_Matte.png", + "size": 100840 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_White_Worn_Matte.png", + "size": 103963 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Yellow.png", + "size": 100168 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Mosaic_Shifted.Ceramic_Tiles_Mosaic_Shifted_Yellow_Varied.png", + "size": 101830 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Glazed_Paseo.png", + "size": 87050 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Black.png", + "size": 82423 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Black_Matte.png", + "size": 81578 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Black_Matte_Rough.png", + "size": 82227 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Brown.png", + "size": 83804 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Dark_Blue_Matte.png", + "size": 89090 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Dark_Blue_Varied_New.png", + "size": 92174 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Dark_Gray.png", + "size": 82081 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Dark_Gray_Matte.png", + "size": 81611 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Dark_Green_Matte.png", + "size": 86563 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Dark_Green_New.png", + "size": 87007 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Dark_Green_Varied_New.png", + "size": 87287 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Gray.png", + "size": 81744 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Gray_Matte.png", + "size": 80858 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Gray_Matte_Varied.png", + "size": 87560 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Lime_Green.png", + "size": 91809 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Lime_Green_Varied.png", + "size": 94078 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Mint.png", + "size": 86519 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Mint_Varied.png", + "size": 90567 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Petrol.png", + "size": 85948 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Petrol_Varied.png", + "size": 89414 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Red.png", + "size": 91493 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Red_Varied.png", + "size": 92902 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_White.png", + "size": 92690 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_White_Matte.png", + "size": 92507 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_White_Worn_Matte.png", + "size": 95276 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_White_Worn_Matte_Dirty.png", + "size": 96980 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Yellow.png", + "size": 94210 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Paseo.Ceramic_Tiles_Paseo_Yellow_Varied.png", + "size": 96309 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Glazed_Penny.png", + "size": 115462 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Antique_White.png", + "size": 129262 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Black.png", + "size": 115926 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Black_Matte.png", + "size": 115476 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Dark_Blue_New.png", + "size": 115483 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Dark_Blue_New_Matte.png", + "size": 114567 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Dark_Blue_Varied_New.png", + "size": 115086 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Graphite.png", + "size": 96419 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Graphite_Matte.png", + "size": 93925 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Graphite_Varied.png", + "size": 106462 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Green.png", + "size": 103881 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Green_Matte.png", + "size": 100432 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Green_Varied.png", + "size": 106352 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Lime_Green.png", + "size": 110228 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Lime_Green_Varied.png", + "size": 113832 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Mint.png", + "size": 104349 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Mint_Varied.png", + "size": 108880 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Petrol.png", + "size": 103334 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Petrol_Varied.png", + "size": 105624 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Red.png", + "size": 110356 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Red_Varied.png", + "size": 112025 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Sky.png", + "size": 112341 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Vintage_Green_Bathroom.png", + "size": 104902 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_White_Matte.png", + "size": 130854 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Yellow.png", + "size": 115627 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Penny.Ceramic_Tiles_Penny_Yellow_Varied.png", + "size": 117815 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Glazed_Pinwheel.png", + "size": 99807 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Antique_White.png", + "size": 97865 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Antique_White_Dirty.png", + "size": 96905 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Black.png", + "size": 94358 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Black_Matte.png", + "size": 95280 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Black_Matte_Rough.png", + "size": 94598 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Dark_Blue_New_Matte.png", + "size": 100475 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Dark_Blue_Varied_New.png", + "size": 99294 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Graphite.png", + "size": 93250 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Graphite_Matte.png", + "size": 92790 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Graphite_Varied.png", + "size": 87992 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Green.png", + "size": 95748 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Green_Matte.png", + "size": 96799 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Green_Varied.png", + "size": 96315 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Lime_Green.png", + "size": 94055 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Lime_Green_Varied.png", + "size": 94505 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Mint.png", + "size": 92495 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Mint_Varied.png", + "size": 92688 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Petrol.png", + "size": 91682 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Petrol_Varied.png", + "size": 91683 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Red.png", + "size": 90203 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Red_Varied.png", + "size": 90180 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Sky.png", + "size": 102901 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Vintage_Green_Bathroom.png", + "size": 97582 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_White_Matte.png", + "size": 101253 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Yellow.png", + "size": 97110 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Pinwheel.Ceramic_Tiles_Pinwheel_Yellow_Varied.png", + "size": 97539 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Glazed_Square.png", + "size": 92577 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Antique_White.png", + "size": 101405 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Antique_White_Dirty.png", + "size": 99020 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Black.png", + "size": 86349 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Black_Matte.png", + "size": 85459 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Black_Matte_Rough.png", + "size": 85726 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Brown.png", + "size": 86244 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Dark_Blue_New.png", + "size": 92580 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Dark_Blue_New_Matte.png", + "size": 92207 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Dark_Blue_Varied_New.png", + "size": 97463 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Dark_Gray.png", + "size": 84445 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Dark_Gray_Matte.png", + "size": 83769 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Dark_Green_New.png", + "size": 90091 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Dark_Green_New_Matte.png", + "size": 89347 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Dark_Green_Varied_New.png", + "size": 90954 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Gray.png", + "size": 84014 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Gray_Matte.png", + "size": 83216 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Gray_Matte_Varied.png", + "size": 93410 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Lime_Green.png", + "size": 96146 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Lime_Green_Varied.png", + "size": 99940 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Mint.png", + "size": 90276 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Mint_Varied.png", + "size": 97258 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Petrol.png", + "size": 88598 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Petrol_Varied.png", + "size": 94977 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Red.png", + "size": 94766 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Red_Varied.png", + "size": 97345 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_White.png", + "size": 99186 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_White_Matte.png", + "size": 98900 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_White_Worn_Matte.png", + "size": 102511 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Yellow.png", + "size": 99099 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square.Ceramic_Tiles_Square_Yellow_Varied.png", + "size": 102393 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Glazed_Square_Brick.png", + "size": 90673 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Black.png", + "size": 83877 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Black_Matte.png", + "size": 82954 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Black_Matte_Rough.png", + "size": 83944 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Brown.png", + "size": 84204 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Dark_Blue.png", + "size": 90862 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Dark_Blue_Matte.png", + "size": 90271 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Dark_Blue_Varied_New.png", + "size": 93862 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Dark_Gray.png", + "size": 82449 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Dark_Gray_Matte.png", + "size": 82058 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Dark_Green_Matte.png", + "size": 87644 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Dark_Green_New.png", + "size": 87899 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Dark_Green_Varied_New.png", + "size": 88436 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Gray.png", + "size": 83118 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Gray_Matte.png", + "size": 82261 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Gray_Matte_Varied.png", + "size": 89430 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Lime_Green.png", + "size": 94566 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Lime_Green_Varied.png", + "size": 96751 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Mint.png", + "size": 89284 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Mint_Varied.png", + "size": 93765 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Petrol.png", + "size": 86922 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Petrol_Varied.png", + "size": 91262 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Red.png", + "size": 92860 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Red_Varied.png", + "size": 94546 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_White.png", + "size": 97550 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_White_Matte.png", + "size": 97240 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_White_Worn_Matte.png", + "size": 100916 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Yellow.png", + "size": 97474 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Square_Brick.Ceramic_Tiles_Square_Brick_Yellow_Varied.png", + "size": 99161 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Glazed_Subway.png", + "size": 104284 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Antique_White_Dirty.png", + "size": 107289 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Black.png", + "size": 94289 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Black_Matte.png", + "size": 89854 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Black_Matte_Rough.png", + "size": 92754 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Cappucino.png", + "size": 98120 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Dark_Gray.png", + "size": 92789 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Dark_Gray_Matte.png", + "size": 88719 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Dark_Green_Matte.png", + "size": 94014 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Dark_Green_New.png", + "size": 97804 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Dark_Green_Varied_New.png", + "size": 98082 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Gray.png", + "size": 90768 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Gray_Matte.png", + "size": 88124 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Gray_Matte_Varied.png", + "size": 92200 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Lime_Green.png", + "size": 101010 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Lime_Green_Varied.png", + "size": 102539 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Mint.png", + "size": 95612 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Mint_Varied.png", + "size": 98850 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Petrol.png", + "size": 96611 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Petrol_Varied.png", + "size": 98673 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Red.png", + "size": 101634 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Red_Varied.png", + "size": 102480 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_White.png", + "size": 101039 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_White_Matte.png", + "size": 100393 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_White_Worn_Matte.png", + "size": 104188 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Yellow.png", + "size": 102261 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Subway.Ceramic_Tiles_Subway_Yellow_Varied.png", + "size": 103794 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Glazed_Versailles.png", + "size": 108882 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Antique_White.png", + "size": 103306 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Antique_White_Dirty.png", + "size": 102648 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Black.png", + "size": 100656 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Black_Matte.png", + "size": 100807 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Black_Matte_Rough.png", + "size": 100001 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Dark_Blue_New_Matte.png", + "size": 108366 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Dark_Blue_Varied_New.png", + "size": 110819 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Graphite.png", + "size": 98887 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Graphite_Matte.png", + "size": 98541 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Graphite_Varied.png", + "size": 95727 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Green.png", + "size": 105511 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Green_Matte.png", + "size": 104322 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Green_Varied.png", + "size": 107886 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Lime_Green.png", + "size": 103710 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Lime_Green_Varied.png", + "size": 106301 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Mint.png", + "size": 101446 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Mint_Varied.png", + "size": 102670 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Petrol.png", + "size": 99379 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Petrol_Varied.png", + "size": 102192 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Red.png", + "size": 102285 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Red_Varied.png", + "size": 103631 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Sky.png", + "size": 114596 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Vintage_Green_Bathroom.png", + "size": 110094 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_White_Matte.png", + "size": 105951 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Yellow.png", + "size": 109395 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Ceramic_Tiles_Glazed_Versailles.Ceramic_Tiles_Versailles_Yellow_Varied.png", + "size": 111863 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Grog_Fired_Clay.Grog_Fired_Clay.png", + "size": 103187 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Grog_Fired_Clay.Grog_Fired_Clay_Dirt.png", + "size": 104584 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Grog_Fired_Clay.Grog_Fired_Clay_Dried_Dirt.png", + "size": 101205 + }, + { + "key": "Materials/vMaterials_2/Ceramic/.thumbs/Grog_Fired_Clay.Grog_Fired_Clay_Glaced.png", + "size": 104324 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Diamond.mdl", + "size": 101176 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Diamond_Offset.mdl", + "size": 98677 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Mosaic_Shifted.mdl", + "size": 103472 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Paseo.mdl", + "size": 99446 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Penny.mdl", + "size": 91726 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Pinwheel.mdl", + "size": 101071 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Square.mdl", + "size": 99028 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Square_Brick.mdl", + "size": 99089 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Subway.mdl", + "size": 95273 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Ceramic_Tiles_Glazed_Versailles.mdl", + "size": 101654 + }, + { + "key": "Materials/vMaterials_2/Ceramic/Grog_Fired_Clay.mdl", + "size": 23693 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/diamond_R_id_G_offs_B_color.png", + "size": 9322 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/diamond_alternated_R_id_G_offs_B_color.png", + "size": 23138 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/diamond_alternated_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1492477 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/diamond_alternated_norm.jpg", + "size": 843179 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/diamond_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1324396 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/diamond_multi_R_noise1_G_noise2_B_craquelure.jpg", + "size": 4231676 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/diamond_multi_R_rough_G_thickness_B_drops.jpg", + "size": 6882962 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/diamond_norm.jpg", + "size": 866744 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/fired_clay_fired_clay_diff.jpg", + "size": 2566543 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/fired_clay_fired_clay_norm.jpg", + "size": 1451977 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/fired_clay_multi_R_rough_G_ao_B_dirt.jpg", + "size": 4018055 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/mortar_diff.jpg", + "size": 1973915 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/mortar_multi_R_rough_G_ao_B_noise.jpg", + "size": 5753857 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/mortar_norm.jpg", + "size": 4323469 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/mosaic_shifted_R_id_G_offs_B_rotation.png", + "size": 7252 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/mosaic_shifted_round_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1395551 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/mosaic_shifted_round_norm.jpg", + "size": 332183 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/mosaic_shifted_sharp_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1507557 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/mosaic_shifted_sharp_norm.jpg", + "size": 325678 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/paseo_R_id_G_offs_B_rotation.png", + "size": 15467 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/paseo_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1408330 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/paseo_norm.jpg", + "size": 122945 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/penny_R_id_G_offs_B_rotation.png", + "size": 310527 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/penny_multi_R_height_G_edgefade_B_ao.jpg", + "size": 4524211 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/penny_norm.jpg", + "size": 1352708 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/pinwheel_R_id_G_offs_B_color.png", + "size": 18853 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/pinwheel_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1445565 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/pinwheel_norm.jpg", + "size": 755666 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/square_tiles_R_id_G_offs_B_rotation.png", + "size": 236155 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/square_tiles_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1974786 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/square_tiles_norm.jpg", + "size": 1093043 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/squarebricktiles_R_id_G_offs_B_rotation.png", + "size": 7228 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/squarebricktiles_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1973447 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/squarebricktiles_norm.jpg", + "size": 768405 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/subway_R_id_G_offs_B_rotation.png", + "size": 3598 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/subway_multi_R_height_G_edgefade_B_ao.jpg", + "size": 3197836 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/subway_norm.jpg", + "size": 1040901 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/tiles2_multi_R_noise1_G_noise2_B_craquelure.png", + "size": 29457521 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/tiles_multi_R_noise1_G_noise2_B_craquelure.jpg", + "size": 2057934 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/tiles_multi_R_rough_G_thickness_B_drops.jpg", + "size": 4405716 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/versailles2_R_id_G_offs_B_color.png", + "size": 20093 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/versailles2_multi_R_height_G_edgefade_B_ao.jpg", + "size": 1111354 + }, + { + "key": "Materials/vMaterials_2/Ceramic/textures/versailles2_norm.jpg", + "size": 801425 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl.png", + "size": 89599 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl@Carbon_Fiber.png", + "size": 89599 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl@Carbon_Fiber_Aluminized.png", + "size": 94096 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl@Carbon_Fiber_Aluminized_Coated.png", + "size": 92844 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl@Carbon_Fiber_Dusty_Coating.png", + "size": 87454 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl@Carbon_Fiber_Matte_Coating.png", + "size": 85340 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl@Carbon_Fiber_Matte_Uncoated.png", + "size": 84554 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl@Carbon_Fiber_Shiny_Coating.png", + "size": 87920 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Carbon_Fiber.mdl@Carbon_Fiber_Worn_Coating.png", + "size": 88921 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass.mdl.png", + "size": 124154 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass.mdl@Fiberglass.png", + "size": 124154 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass.mdl@Fiberglass_Blueish.png", + "size": 124793 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass.mdl@Fiberglass_Flat_Weave.png", + "size": 118426 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass.mdl@Fiberglass_Shiny.png", + "size": 126598 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass.mdl@Fiberglass_Yellowish.png", + "size": 128648 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass_Imperfections.mdl.png", + "size": 136470 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass_Imperfections.mdl@Fiberglass_Bumpy_Imperfections.png", + "size": 129750 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass_Imperfections.mdl@Fiberglass_Imperfections.png", + "size": 136470 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass_Imperfections.mdl@Fiberglass_Torn_Imperfections.png", + "size": 130159 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/256x256/Fiberglass_Imperfections.mdl@Fiberglass_Warped_Imperfections.png", + "size": 130147 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Carbon_Fiber.Carbon_Fiber.png", + "size": 91418 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Carbon_Fiber.Carbon_Fiber_Aluminized.png", + "size": 96572 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Carbon_Fiber.Carbon_Fiber_Aluminized_Coated.png", + "size": 96505 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Carbon_Fiber.Carbon_Fiber_Dusty_Coating.png", + "size": 91204 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Carbon_Fiber.Carbon_Fiber_Matte_Coating.png", + "size": 90295 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Carbon_Fiber.Carbon_Fiber_Matte_Uncoated.png", + "size": 88815 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Carbon_Fiber.Carbon_Fiber_Shiny_Coating.png", + "size": 91588 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Carbon_Fiber.Carbon_Fiber_Worn_Coating.png", + "size": 91476 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass.Fiberglass.png", + "size": 112791 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass.Fiberglass_Blueish.png", + "size": 113289 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass.Fiberglass_Flat_Weave.png", + "size": 110897 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass.Fiberglass_Shiny.png", + "size": 115325 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass.Fiberglass_Yellowish.png", + "size": 116346 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass_Imperfections.Fiberglass_Bumpy_Imperfections.png", + "size": 103373 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass_Imperfections.Fiberglass_Imperfections.png", + "size": 104407 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass_Imperfections.Fiberglass_Torn_Imperfections.png", + "size": 103352 + }, + { + "key": "Materials/vMaterials_2/Composite/.thumbs/Fiberglass_Imperfections.Fiberglass_Warped_Imperfections.png", + "size": 103456 + }, + { + "key": "Materials/vMaterials_2/Composite/Carbon_Fiber.mdl", + "size": 45344 + }, + { + "key": "Materials/vMaterials_2/Composite/Fiberglass.mdl", + "size": 22947 + }, + { + "key": "Materials/vMaterials_2/Composite/Fiberglass_Imperfections.mdl", + "size": 56992 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/carbon_fiber_fibers_norm.jpg", + "size": 2873884 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", + "size": 2360404 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/carbon_fiber_weaving_norm.png", + "size": 59261 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiber_blue_noise_placement_512x512.png", + "size": 577772 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiber_bump.jpg", + "size": 1604007 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiber_kernel.jpg", + "size": 37107 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiber_multi_R_rough_G_ao_B_mask.jpg", + "size": 2144968 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiber_norm.jpg", + "size": 1089437 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiber_tears.png", + "size": 42222 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiber_warp_direction_noise.jpg", + "size": 74934 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiber_waves_norm.jpg", + "size": 243234 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiberglass_bump.jpg", + "size": 1294683 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", + "size": 1300931 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiberglass_norm.jpg", + "size": 1180124 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/fiberglass_warps.jpg", + "size": 202217 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/generic_surface_rough.jpg", + "size": 2071242 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/surface_damages_multi_R_rough_B_rough2.jpg", + "size": 4094197 + }, + { + "key": "Materials/vMaterials_2/Composite/textures/surface_damages_norm.jpg", + "size": 1307147 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Floor_Damage.mdl.png", + "size": 98233 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Floor_Damage.mdl@Concrete_Floor_Damage.png", + "size": 98233 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Floor_Damage.mdl@Dark_Damaged_Concrete.png", + "size": 84656 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Floor_Damage.mdl@Dark_Rough_Concrete.png", + "size": 83811 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Floor_Damage.mdl@Defined_Reflections_Damaged_Concrete.png", + "size": 106539 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Floor_Damage.mdl@Matt_Damaged_Concrete.png", + "size": 101409 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Floor_Damage.mdl@Shiny_Damaged_Concrete.png", + "size": 101920 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Floor_Damage.mdl@Soft_Reflections_Damaged_Concrete.png", + "size": 102681 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Formed.mdl.png", + "size": 92767 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Formed.mdl@Concrete_Formed.png", + "size": 92767 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Formed.mdl@Concrete_Formed_Rough.png", + "size": 90527 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Polished.mdl.png", + "size": 87581 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Polished.mdl@Concrete_Polished.png", + "size": 87581 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Polished.mdl@Concrete_Polished_Matte.png", + "size": 86241 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl.png", + "size": 88584 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@Concrete_Precast.png", + "size": 88584 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@concrete_precast_dark_charcoal.png", + "size": 98634 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@concrete_precast_dark_gray.png", + "size": 99410 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@concrete_precast_ivory.png", + "size": 94607 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@concrete_precast_light_gray.png", + "size": 97101 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@concrete_precast_light_warm_gray.png", + "size": 98185 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@concrete_precast_sienna.png", + "size": 101355 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@concrete_precast_walnut.png", + "size": 103708 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Precast.mdl@concrete_precast_warm_gray.png", + "size": 98182 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Rough.mdl.png", + "size": 112153 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Rough.mdl@Concrete_Rough.png", + "size": 112153 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Rough.mdl@Concrete_Rough_Dirty.png", + "size": 111689 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Rough.mdl@Concrete_Rough_Heavy_Decay.png", + "size": 122677 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Rough.mdl@Concrete_Rough_Mossy.png", + "size": 115906 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged.mdl.png", + "size": 94283 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged.mdl@Concrete_Wall_Aged.png", + "size": 94283 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged.mdl@Concrete_Wall_Aged_Rough_Black_Grunge.png", + "size": 96709 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged.mdl@Concrete_Wall_Aged_Slight_Grunge.png", + "size": 96121 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged_Scratched.mdl.png", + "size": 92854 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged_Scratched.mdl@Concrete_Wall_Aged_Scratched.png", + "size": 92854 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged_Scratched.mdl@Concrete_Wall_Aged_Scratched_Heavy_Grime.png", + "size": 97421 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged_Scratched.mdl@Concrete_Wall_Aged_Scratched_Medium_Grime.png", + "size": 95426 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Aged_Scratched.mdl@Concrete_Wall_Aged_Scratched_Shiny.png", + "size": 94240 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Even.mdl.png", + "size": 78704 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Even.mdl@Concrete_Wall_Even.png", + "size": 78704 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Even.mdl@Concrete_Wall_Even_Brownish_Dirty.png", + "size": 89585 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Even.mdl@Concrete_Wall_Even_Greenish_Dirty.png", + "size": 91437 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Concrete_Wall_Even.mdl@Concrete_Wall_Even_New_Shiny.png", + "size": 80205 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl.png", + "size": 94054 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl@Mortar.png", + "size": 94054 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl@Mortar_Antique_White.png", + "size": 94101 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl@Mortar_Clay.png", + "size": 94082 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl@Mortar_Moist.png", + "size": 91593 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl@Mortar_Sand_White.png", + "size": 95315 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl@Mortar_Tan.png", + "size": 91413 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl@Mortar_White.png", + "size": 95852 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Mortar.mdl@Mortar_Yellow.png", + "size": 94387 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered.mdl.png", + "size": 97724 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered.mdl@Spongy_Concrete_Weathered.png", + "size": 97724 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered.mdl@Spongy_Concrete_Weathered_Dark_Dirt.png", + "size": 91478 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered.mdl@Spongy_Concrete_Weathered_Light_Dirt.png", + "size": 82057 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered.mdl@Spongy_Concrete_Weathered_Rough.png", + "size": 97729 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered.mdl@Spongy_Concrete_Weathered_Wet_Flows.png", + "size": 98683 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered_Mossy.mdl.png", + "size": 100837 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered_Mossy.mdl@Spongy_Concrete_Weathered_Mossy.png", + "size": 100837 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered_Mossy.mdl@Spongy_Concrete_Weathered_Mossy_Dark_Dirt.png", + "size": 98931 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered_Mossy.mdl@Spongy_Concrete_Weathered_Mossy_Light_Dirt.png", + "size": 92552 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Spongy_Concrete_Weathered_Mossy.mdl@Spongy_Concrete_Weathered_Mossy_Rough.png", + "size": 100946 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Stone_Pores_Weathered.mdl.png", + "size": 105679 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Stone_Pores_Weathered.mdl@Dry_Bright_Stone.png", + "size": 99612 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Stone_Pores_Weathered.mdl@Fadely_Yellowish_Moss.png", + "size": 108261 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Stone_Pores_Weathered.mdl@Matte_Stone.png", + "size": 95111 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Stone_Pores_Weathered.mdl@Saturated_Green_Patches.png", + "size": 103426 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Stone_Pores_Weathered.mdl@Slightly_Grown_Moss.png", + "size": 108239 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Stone_Pores_Weathered.mdl@Soft_Grown_Moss.png", + "size": 107026 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/256x256/Stone_Pores_Weathered.mdl@Stone_Pores_Weathered.png", + "size": 105679 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Floor_Damage.Concrete_Floor_Damage.png", + "size": 88635 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Floor_Damage.Dark_Damaged_Concrete.png", + "size": 70502 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Floor_Damage.Dark_Rough_Concrete.png", + "size": 72709 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Floor_Damage.Defined_Reflections_Damaged_Concrete.png", + "size": 90146 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Floor_Damage.Matt_Damaged_Concrete.png", + "size": 89101 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Floor_Damage.Shiny_Damaged_Concrete.png", + "size": 89150 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Floor_Damage.Soft_Reflections_Damaged_Concrete.png", + "size": 89345 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Formed.Concrete_Formed.png", + "size": 87045 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Formed.Concrete_Formed_Rough.png", + "size": 85789 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Polished.Concrete_Polished.png", + "size": 82558 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Polished.Concrete_Polished_Matte.png", + "size": 83205 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.Concrete_Precast.png", + "size": 88218 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_dark_charcoal.png", + "size": 83929 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_dark_gray.png", + "size": 90080 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_gray.png", + "size": 88222 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_ivory.png", + "size": 90903 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_light_gray.png", + "size": 90495 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_light_warm_gray.png", + "size": 92823 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_sienna.png", + "size": 89546 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_walnut.png", + "size": 88685 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Precast.concrete_precast_warm_gray.png", + "size": 92831 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Rough.Concrete_Rough.png", + "size": 98779 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Rough.Concrete_Rough_Dirty.png", + "size": 100102 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Rough.Concrete_Rough_Heavy_Decay.png", + "size": 107925 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Rough.Concrete_Rough_Mossy.png", + "size": 106070 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged.png", + "size": 88976 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged_Rough_Black_Grunge.png", + "size": 89768 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged_Slight_Grunge.png", + "size": 89123 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched.png", + "size": 88887 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Heavy_Grime.png", + "size": 92740 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Medium_Grime.png", + "size": 91826 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Shiny.png", + "size": 90077 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Even.Concrete_Wall_Even.png", + "size": 82833 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_Brownish_Dirty.png", + "size": 88667 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_Greenish_Dirty.png", + "size": 90296 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_New_Shiny.png", + "size": 80835 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Mortar.Mortar.png", + "size": 83957 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Mortar.Mortar_Antique_White.png", + "size": 90908 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Mortar.Mortar_Clay.png", + "size": 86902 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Mortar.Mortar_Moist.png", + "size": 74970 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Mortar.Mortar_Sand_White.png", + "size": 89263 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Mortar.Mortar_Tan.png", + "size": 82905 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Mortar.Mortar_White.png", + "size": 89898 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Mortar.Mortar_Yellow.png", + "size": 89301 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered.png", + "size": 85567 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Dark_Dirt.png", + "size": 86258 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Light_Dirt.png", + "size": 81950 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Rough.png", + "size": 85485 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Wet_Flows.png", + "size": 87186 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy.png", + "size": 92558 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Dark_Dirt.png", + "size": 90552 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Light_Dirt.png", + "size": 87710 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Rough.png", + "size": 92572 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Stone_Pores_Weathered.Dry_Bright_Stone.png", + "size": 88831 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Stone_Pores_Weathered.Fadely_Yellowish_Moss.png", + "size": 86323 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Stone_Pores_Weathered.Matte_Stone.png", + "size": 83633 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Stone_Pores_Weathered.Saturated_Green_Patches.png", + "size": 85995 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Stone_Pores_Weathered.Slightly_Grown_Moss.png", + "size": 89940 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Stone_Pores_Weathered.Soft_Grown_Moss.png", + "size": 84066 + }, + { + "key": "Materials/vMaterials_2/Concrete/.thumbs/Stone_Pores_Weathered.Stone_Pores_Weathered.png", + "size": 91707 + }, + { + "key": "Materials/vMaterials_2/Concrete/Concrete_Floor_Damage.mdl", + "size": 26744 + }, + { + "key": "Materials/vMaterials_2/Concrete/Concrete_Formed.mdl", + "size": 14244 + }, + { + "key": "Materials/vMaterials_2/Concrete/Concrete_Polished.mdl", + "size": 22126 + }, + { + "key": "Materials/vMaterials_2/Concrete/Concrete_Precast.mdl", + "size": 57062 + }, + { + "key": "Materials/vMaterials_2/Concrete/Concrete_Rough.mdl", + "size": 35386 + }, + { + "key": "Materials/vMaterials_2/Concrete/Concrete_Wall_Aged.mdl", + "size": 27838 + }, + { + "key": "Materials/vMaterials_2/Concrete/Concrete_Wall_Aged_Scratched.mdl", + "size": 28101 + }, + { + "key": "Materials/vMaterials_2/Concrete/Concrete_Wall_Even.mdl", + "size": 26550 + }, + { + "key": "Materials/vMaterials_2/Concrete/Mortar.mdl", + "size": 30216 + }, + { + "key": "Materials/vMaterials_2/Concrete/Spongy_Concrete_Weathered.mdl", + "size": 25746 + }, + { + "key": "Materials/vMaterials_2/Concrete/Spongy_Concrete_Weathered_Mossy.mdl", + "size": 18671 + }, + { + "key": "Materials/vMaterials_2/Concrete/Stone_Pores_Weathered.mdl", + "size": 52975 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_floor_damage_diff.jpg", + "size": 2109752 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", + "size": 4077137 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_floor_damage_norm.jpg", + "size": 2318712 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_rough_ORM.jpg", + "size": 2086875 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_rough_diff.jpg", + "size": 1441663 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_rough_norm.jpg", + "size": 1381045 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", + "size": 6333377 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_aged_diff.jpg", + "size": 2356253 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_aged_norm.jpg", + "size": 3162754 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", + "size": 5939090 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_aged_scratched_diff.jpg", + "size": 1894571 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_aged_scratched_norm.jpg", + "size": 3010902 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", + "size": 6278524 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_even_diff.jpg", + "size": 1124413 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/concrete_wall_even_norm.jpg", + "size": 2145282 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/conrete_formed_ORM.jpg", + "size": 1403095 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/conrete_formed_diff.jpg", + "size": 665448 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/conrete_formed_norm.jpg", + "size": 908661 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/conrete_polished_ORM.jpg", + "size": 1516401 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/conrete_polished_diff.jpg", + "size": 380583 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/conrete_polished_norm.jpg", + "size": 518141 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/mortar_diff.jpg", + "size": 1973915 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/mortar_multi_R_rough_G_ao_B_noise.jpg", + "size": 5753857 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/mortar_norm.jpg", + "size": 4323469 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/moss_diff.jpg", + "size": 990554 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/moss_multi_R_rough_G_ao_B_height.jpg", + "size": 1367046 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/moss_norm.jpg", + "size": 1231076 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/multi_moss.jpg", + "size": 3652432 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/multi_stone.jpg", + "size": 2550129 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/precastconcrete_diff.png", + "size": 7238964 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/precastconcrete_grunge_mask.png", + "size": 7990326 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/precastconcrete_norm.jpg", + "size": 5003204 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/precastconcrete_rough.png", + "size": 7914960 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_dirt_mask.jpg", + "size": 2961888 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_weatheredMoss_diff.jpg", + "size": 5261075 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", + "size": 4807673 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_weatheredMoss_norm.jpg", + "size": 2985036 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_weathered_diff.jpg", + "size": 3950444 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_weathered_mask_dirt.jpg", + "size": 2961888 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_weathered_mask_wet.png", + "size": 1909512 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", + "size": 5412354 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/spongy_concrete_weathered_norm.jpg", + "size": 2747016 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/stone_diff.jpg", + "size": 2274051 + }, + { + "key": "Materials/vMaterials_2/Concrete/textures/stone_norm.jpg", + "size": 2717520 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl.png", + "size": 87730 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting.png", + "size": 87730 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Amazon_Clay.png", + "size": 80134 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Ash_Brown.png", + "size": 78244 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Autumn.png", + "size": 91415 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Black.png", + "size": 75400 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Burgundy.png", + "size": 86300 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Champagne.png", + "size": 87523 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Chocolate.png", + "size": 82923 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Crimson.png", + "size": 89807 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Electric.png", + "size": 91821 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Flaxen.png", + "size": 90474 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Lavender.png", + "size": 88326 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mint.png", + "size": 87303 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mustard.png", + "size": 92742 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Olive.png", + "size": 80905 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Potters_Clay.png", + "size": 86937 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Purple.png", + "size": 87406 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rose.png", + "size": 93107 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rosy_Peach.png", + "size": 89892 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Silver.png", + "size": 85992 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Sky_Blue.png", + "size": 89839 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Smoke.png", + "size": 82665 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Teal.png", + "size": 83648 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl.png", + "size": 104673 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim.png", + "size": 104673 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Black.png", + "size": 100755 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Bleached_Light_Blue.png", + "size": 110097 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Carbon.png", + "size": 99394 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Independence_Blue.png", + "size": 101164 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Light_Blue.png", + "size": 107884 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Washed_Blue.png", + "size": 109135 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl.png", + "size": 91955 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry.png", + "size": 91955 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Brown.png", + "size": 83272 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Burgundy.png", + "size": 81066 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Blue.png", + "size": 78697 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Gray.png", + "size": 71384 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Electric_Blue.png", + "size": 91218 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fox_Red.png", + "size": 86036 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fuchsia.png", + "size": 90293 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Gray.png", + "size": 87068 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Harbor_Gray.png", + "size": 87439 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Mid_Gray.png", + "size": 75742 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Olive_Green.png", + "size": 79675 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Petrol.png", + "size": 86595 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Saffron.png", + "size": 89134 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Sand.png", + "size": 89433 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Shrimp.png", + "size": 90177 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Terracotta.png", + "size": 90569 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl.png", + "size": 102236 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford.png", + "size": 102236 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Blue_Jay.png", + "size": 108516 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Carbon.png", + "size": 89697 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Coffee_Bean.png", + "size": 92696 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Fog.png", + "size": 112026 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Fuchsia.png", + "size": 111628 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Garnet.png", + "size": 108561 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Green_Tea.png", + "size": 110115 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Ink.png", + "size": 107442 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Jungle.png", + "size": 106288 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Paprika.png", + "size": 121742 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Peacock.png", + "size": 108980 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Pepper.png", + "size": 117264 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Plum.png", + "size": 111691 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Saffron.png", + "size": 123564 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Sand.png", + "size": 109222 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Tobacco.png", + "size": 108872 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl.png", + "size": 132893 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Cotton_Roughly_Woven.png", + "size": 132893 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Cheery_Red.png", + "size": 109768 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Dark_Ash.png", + "size": 95531 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Dark_Red.png", + "size": 106218 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Green.png", + "size": 119366 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Orange.png", + "size": 121099 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl.png", + "size": 87131 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey.png", + "size": 87131 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Almond.png", + "size": 90002 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Amethyst.png", + "size": 90082 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Black.png", + "size": 77228 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Brick_Red.png", + "size": 91994 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Bubblegum.png", + "size": 92506 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Burgundy.png", + "size": 87936 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Charcoal.png", + "size": 78335 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Cinnamon.png", + "size": 87293 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Grass_Green.png", + "size": 94192 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Gray.png", + "size": 82177 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Hunter_Green.png", + "size": 88914 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Khaki.png", + "size": 87649 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Lemon.png", + "size": 97006 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Lime.png", + "size": 96373 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Mint.png", + "size": 90339 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Navy_Blue.png", + "size": 85477 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Orange.png", + "size": 95554 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Plum.png", + "size": 94619 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Purple.png", + "size": 88737 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Raspberry.png", + "size": 91685 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Red.png", + "size": 94521 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Royal_Blue.png", + "size": 90611 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Shrimp.png", + "size": 90612 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Silver.png", + "size": 85339 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Slate.png", + "size": 91308 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Teal.png", + "size": 94337 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Terracotta.png", + "size": 92004 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Turquoise.png", + "size": 96375 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl.png", + "size": 98776 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine.png", + "size": 98776 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Aubergine.png", + "size": 91283 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Black_Pepper.png", + "size": 89659 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Blue_Jay.png", + "size": 104390 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Carbon.png", + "size": 88998 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Charcoal.png", + "size": 89293 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Fog.png", + "size": 98332 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Fuchsia.png", + "size": 105456 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Garnet.png", + "size": 98745 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Jungle.png", + "size": 90209 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Morning_Glory.png", + "size": 97748 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Oyster.png", + "size": 100384 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Paprika.png", + "size": 105760 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Saffron.png", + "size": 107229 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Sand.png", + "size": 100624 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Tobacco.png", + "size": 97360 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl.png", + "size": 118139 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven.png", + "size": 118139 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Cheery_Red.png", + "size": 125901 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Dark_Green.png", + "size": 116883 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Dark_Red.png", + "size": 119457 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Light_Blue.png", + "size": 127624 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Orange.png", + "size": 128101 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Petrol.png", + "size": 118606 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Yellow.png", + "size": 129361 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl.png", + "size": 123213 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave.png", + "size": 123213 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Amethyst.png", + "size": 117901 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Burnt_Coral.png", + "size": 122675 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Buttercream.png", + "size": 118573 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Carulean.png", + "size": 118578 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Desert_Mist.png", + "size": 120557 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_French_Blue.png", + "size": 118574 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Gray.png", + "size": 113506 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Green_Ash.png", + "size": 121220 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Inkwell.png", + "size": 106992 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Mint.png", + "size": 123654 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Raspberry.png", + "size": 122365 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Rust.png", + "size": 118578 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Yellow.png", + "size": 126127 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl.png", + "size": 95414 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Academyblue.png", + "size": 92036 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Black.png", + "size": 75728 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Brick.png", + "size": 90370 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Brown.png", + "size": 85582 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Burgundy.png", + "size": 90266 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Charcoal.png", + "size": 72943 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Darkgreen.png", + "size": 82459 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Electricblue.png", + "size": 98208 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Euroblue.png", + "size": 91904 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Golden.png", + "size": 92827 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Khaki.png", + "size": 89244 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Navyblue.png", + "size": 79813 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Red.png", + "size": 90593 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Steelgray.png", + "size": 86531 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Taupe.png", + "size": 82497 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Plain.png", + "size": 95414 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl.png", + "size": 87610 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse.png", + "size": 87610 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Aqua_Blue.png", + "size": 83681 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Black.png", + "size": 73770 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Gold.png", + "size": 85439 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Lemon.png", + "size": 85543 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Lime_Green.png", + "size": 83888 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Orange.png", + "size": 83219 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Purple.png", + "size": 82281 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Red.png", + "size": 79968 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Silver.png", + "size": 84830 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Teal.png", + "size": 81035 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl.png", + "size": 87894 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine.png", + "size": 87894 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Anthracite.png", + "size": 81000 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Black.png", + "size": 79143 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Dark_Green.png", + "size": 81657 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Lime_Green.png", + "size": 85680 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Orange.png", + "size": 86297 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Petrol.png", + "size": 83888 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Pink.png", + "size": 87258 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Purple.png", + "size": 84514 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Red.png", + "size": 82763 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Rose.png", + "size": 86774 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Sky_Blue.png", + "size": 86055 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl.png", + "size": 92865 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone.png", + "size": 92865 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Beige.png", + "size": 100113 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Brown.png", + "size": 97480 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Burgundy.png", + "size": 103591 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Green.png", + "size": 99867 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Light_Brown.png", + "size": 103045 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Light_Grey.png", + "size": 110884 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Maroon.png", + "size": 100698 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Orange.png", + "size": 111195 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Pastel_Blue.png", + "size": 99126 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Royal_Blue.png", + "size": 102208 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Silver.png", + "size": 95857 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Tan.png", + "size": 109950 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Yellow.png", + "size": 111273 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl.png", + "size": 95842 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill.png", + "size": 95842 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Beige.png", + "size": 103971 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Brown.png", + "size": 101644 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Light_Brown.png", + "size": 107304 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Light_Grey.png", + "size": 115430 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Silver.png", + "size": 96953 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Tan.png", + "size": 114121 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl.png", + "size": 82195 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse.png", + "size": 82195 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Blue.png", + "size": 80708 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Champagne.png", + "size": 81238 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Lavender.png", + "size": 80825 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Light_Blue.png", + "size": 82242 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Natural.png", + "size": 82130 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Orange.png", + "size": 83020 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Purple.png", + "size": 79015 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Rose.png", + "size": 81495 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Sand.png", + "size": 80373 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Silver.png", + "size": 81212 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl.png", + "size": 104227 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin.png", + "size": 104227 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Champagne.png", + "size": 103897 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Electric_Blue.png", + "size": 111117 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Forest_Green.png", + "size": 100107 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Natural.png", + "size": 103233 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Pink.png", + "size": 110029 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Purple.png", + "size": 109455 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Red.png", + "size": 113531 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Rose.png", + "size": 106569 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Royal_Blue.png", + "size": 105821 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Shiny_Moss.png", + "size": 105914 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Yellow.png", + "size": 109408 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl.png", + "size": 88362 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine.png", + "size": 88362 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Champagne.png", + "size": 87529 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Forest_Green.png", + "size": 82246 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Moss.png", + "size": 86018 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Natural.png", + "size": 88125 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Pink.png", + "size": 87577 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Purple.png", + "size": 87163 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Red.png", + "size": 83311 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Rose.png", + "size": 88680 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Royal_Blue.png", + "size": 82241 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Sky_Blue.png", + "size": 87041 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Yellow.png", + "size": 86476 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl.png", + "size": 110439 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette.png", + "size": 110439 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Beige.png", + "size": 107307 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Electric_Blue.png", + "size": 111440 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Fuchsia.png", + "size": 111172 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Green.png", + "size": 110650 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Lavender.png", + "size": 105366 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Mint_Green.png", + "size": 114171 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Orange.png", + "size": 114854 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Purple.png", + "size": 106567 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Red.png", + "size": 110520 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Rose.png", + "size": 110266 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Silver.png", + "size": 103811 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Sky_Blue.png", + "size": 114689 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Turquoise.png", + "size": 110619 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Yellow.png", + "size": 113856 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl.png", + "size": 128123 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon.png", + "size": 128123 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon_Natural.png", + "size": 128165 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon_Shiny.png", + "size": 128179 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl.png", + "size": 127781 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone.png", + "size": 127781 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Black_White.png", + "size": 110746 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Blue_Khaki.png", + "size": 123599 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Brown.png", + "size": 115398 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Dark_Blue.png", + "size": 120149 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Dark_Brown.png", + "size": 118598 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Gray.png", + "size": 105225 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Green_Blue.png", + "size": 125290 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Mustard.png", + "size": 124981 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Olive_Green.png", + "size": 116536 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Purple_Orange.png", + "size": 128950 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Red_Vanilla.png", + "size": 131117 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Saturated_Green.png", + "size": 115592 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl.png", + "size": 83181 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet.png", + "size": 83181 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Black.png", + "size": 75623 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Blue.png", + "size": 82837 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Bordeaux.png", + "size": 81551 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Dark_Grey.png", + "size": 77254 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Eggplant.png", + "size": 78507 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Green.png", + "size": 82608 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Ocean_Blue.png", + "size": 80083 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Orange.png", + "size": 87141 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Dark_Blue.png", + "size": 86062 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Dark_Red.png", + "size": 79137 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Emerald.png", + "size": 79315 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Purple.png", + "size": 80479 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Turquoise.png", + "size": 83557 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_White.png", + "size": 83558 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl.png", + "size": 95709 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton.png", + "size": 95709 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Aubergine.png", + "size": 98329 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Blue_Jay.png", + "size": 108648 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Carbon.png", + "size": 86515 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Fuchsia.png", + "size": 110135 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Garnet.png", + "size": 105612 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Gray.png", + "size": 96641 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Green_Tea.png", + "size": 107608 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Jungle.png", + "size": 98099 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Morning_Glory.png", + "size": 102404 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Paprika.png", + "size": 107745 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Saffron.png", + "size": 112662 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Sand.png", + "size": 105523 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Tobacco.png", + "size": 100942 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl.png", + "size": 100737 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit.png", + "size": 100737 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Aubergine.png", + "size": 89803 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Black_Pepper.png", + "size": 86507 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Blue_Jay.png", + "size": 102869 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Carbon.png", + "size": 84076 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Charcoal.png", + "size": 87539 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Emerald.png", + "size": 91066 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Fog.png", + "size": 97669 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Fuchsia.png", + "size": 96703 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Garnet.png", + "size": 95226 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Green_Tea.png", + "size": 104518 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Oyster.png", + "size": 105125 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Paprika.png", + "size": 103864 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Purple.png", + "size": 96701 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Saffron.png", + "size": 106524 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Sand.png", + "size": 105027 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Tobacco.png", + "size": 97489 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting.png", + "size": 96492 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Amazon_Clay.png", + "size": 86864 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Ash_Brown.png", + "size": 83538 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Autumn.png", + "size": 99851 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Black.png", + "size": 80046 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Burgundy.png", + "size": 94863 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Champagne.png", + "size": 94987 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Chocolate.png", + "size": 90332 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Crimson.png", + "size": 99204 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Electric.png", + "size": 99319 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Flaxen.png", + "size": 97263 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Lavender.png", + "size": 95153 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mint.png", + "size": 94783 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mustard.png", + "size": 102033 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Olive.png", + "size": 87010 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Potters_Clay.png", + "size": 94942 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Purple.png", + "size": 95193 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rose.png", + "size": 101936 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rosy_Peach.png", + "size": 98748 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Silver.png", + "size": 92176 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Sky_Blue.png", + "size": 97087 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Smoke.png", + "size": 88961 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Teal.png", + "size": 90335 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim.png", + "size": 92267 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Black.png", + "size": 90085 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Bleached_Light_Blue.png", + "size": 101892 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Carbon.png", + "size": 88692 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Independence_Blue.png", + "size": 90419 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Light_Blue.png", + "size": 96035 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Washed_Blue.png", + "size": 96882 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry.png", + "size": 98555 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Brown.png", + "size": 89118 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Burgundy.png", + "size": 88040 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Blue.png", + "size": 84208 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Gray.png", + "size": 80774 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Electric_Blue.png", + "size": 95396 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fox_Red.png", + "size": 92300 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fuchsia.png", + "size": 95503 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Gray.png", + "size": 91488 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Harbor_Gray.png", + "size": 91679 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Mid_Gray.png", + "size": 83996 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Olive_Green.png", + "size": 85832 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Petrol.png", + "size": 91200 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Saffron.png", + "size": 94510 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Sand.png", + "size": 94219 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Shrimp.png", + "size": 95550 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Terracotta.png", + "size": 95842 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford.png", + "size": 96004 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Blue_Jay.png", + "size": 93796 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Carbon.png", + "size": 81333 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Coffee_Bean.png", + "size": 84362 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fog.png", + "size": 98354 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fuchsia.png", + "size": 97608 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Garnet.png", + "size": 95310 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Green_Tea.png", + "size": 96172 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Ink.png", + "size": 89849 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Jungle.png", + "size": 90680 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Paprika.png", + "size": 104409 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Peacock.png", + "size": 92778 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Pepper.png", + "size": 101728 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Plum.png", + "size": 95469 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Saffron.png", + "size": 106201 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Sand.png", + "size": 96268 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Tobacco.png", + "size": 94426 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Cotton_Roughly_Woven.png", + "size": 114719 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Cheery_Red.png", + "size": 103189 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Ash.png", + "size": 87636 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Red.png", + "size": 97894 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Green.png", + "size": 105851 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Orange.png", + "size": 109031 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey.png", + "size": 95001 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Almond.png", + "size": 94887 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Amethyst.png", + "size": 95947 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Black.png", + "size": 81022 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Brick_Red.png", + "size": 96467 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Bubblegum.png", + "size": 100245 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Burgundy.png", + "size": 92098 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Charcoal.png", + "size": 82843 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Cinnamon.png", + "size": 90934 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Grass_Green.png", + "size": 98646 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Gray.png", + "size": 86638 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Hunter_Green.png", + "size": 92120 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Khaki.png", + "size": 93538 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lemon.png", + "size": 101988 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lime.png", + "size": 102141 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Mint.png", + "size": 97987 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Navy_Blue.png", + "size": 89326 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Orange.png", + "size": 101649 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Plum.png", + "size": 100429 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Purple.png", + "size": 92607 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Raspberry.png", + "size": 96904 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Red.png", + "size": 101200 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Royal_Blue.png", + "size": 95503 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Shrimp.png", + "size": 98164 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Silver.png", + "size": 90785 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Slate.png", + "size": 95800 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Teal.png", + "size": 98624 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Terracotta.png", + "size": 96781 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Turquoise.png", + "size": 101271 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine.png", + "size": 93486 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Aubergine.png", + "size": 88262 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Black_Pepper.png", + "size": 85443 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Blue_Jay.png", + "size": 98170 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Carbon.png", + "size": 84008 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Charcoal.png", + "size": 85106 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fog.png", + "size": 93477 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fuchsia.png", + "size": 99928 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Garnet.png", + "size": 95286 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Jungle.png", + "size": 86654 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Morning_Glory.png", + "size": 91777 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Oyster.png", + "size": 95946 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Paprika.png", + "size": 101246 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Saffron.png", + "size": 105159 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Sand.png", + "size": 96538 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Tobacco.png", + "size": 93247 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven.png", + "size": 100867 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Cheery_Red.png", + "size": 104486 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Green.png", + "size": 97293 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Red.png", + "size": 99906 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Light_Blue.png", + "size": 103578 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Orange.png", + "size": 104979 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Petrol.png", + "size": 96804 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Yellow.png", + "size": 105836 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave.png", + "size": 110842 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Amethyst.png", + "size": 105767 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Burnt_Coral.png", + "size": 109449 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Buttercream.png", + "size": 107694 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Carulean.png", + "size": 103964 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Desert_Mist.png", + "size": 107284 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_French_Blue.png", + "size": 107698 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Gray.png", + "size": 101766 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Green_Ash.png", + "size": 107435 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Inkwell.png", + "size": 97852 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Mint.png", + "size": 111497 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Raspberry.png", + "size": 110102 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Rust.png", + "size": 107697 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Yellow.png", + "size": 109785 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Academyblue.png", + "size": 78739 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Black.png", + "size": 65651 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Brick.png", + "size": 78483 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Brown.png", + "size": 74770 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Burgundy.png", + "size": 77733 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Charcoal.png", + "size": 68556 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Darkgreen.png", + "size": 72259 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Electricblue.png", + "size": 81919 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Euroblue.png", + "size": 78506 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Golden.png", + "size": 81907 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Khaki.png", + "size": 79763 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Navyblue.png", + "size": 70648 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Red.png", + "size": 78688 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Steelgray.png", + "size": 76961 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Taupe.png", + "size": 73687 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Tournamentgreen.png", + "size": 77838 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Plain.png", + "size": 93237 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse.png", + "size": 97147 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Aqua_Blue.png", + "size": 97476 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Black.png", + "size": 86715 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Gold.png", + "size": 99035 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lemon.png", + "size": 100203 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lime_Green.png", + "size": 98856 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Orange.png", + "size": 99210 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Purple.png", + "size": 97728 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Red.png", + "size": 97944 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Silver.png", + "size": 94491 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Teal.png", + "size": 95769 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine.png", + "size": 95875 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Anthracite.png", + "size": 90023 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Black.png", + "size": 88508 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Dark_Green.png", + "size": 94735 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Lime_Green.png", + "size": 99102 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Orange.png", + "size": 101469 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Petrol.png", + "size": 96177 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Pink.png", + "size": 102195 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Purple.png", + "size": 97251 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Red.png", + "size": 98524 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Rose.png", + "size": 99003 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Sky_Blue.png", + "size": 95485 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone.png", + "size": 85306 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Beige.png", + "size": 92341 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Brown.png", + "size": 87958 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Burgundy.png", + "size": 92529 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Green.png", + "size": 89458 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Brown.png", + "size": 92444 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Grey.png", + "size": 99295 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Maroon.png", + "size": 90766 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Orange.png", + "size": 100465 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Pastel_Blue.png", + "size": 91763 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Royal_Blue.png", + "size": 91705 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Silver.png", + "size": 89769 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Tan.png", + "size": 98710 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Yellow.png", + "size": 100766 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill.png", + "size": 85578 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Beige.png", + "size": 95858 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Brown.png", + "size": 89702 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Light_Brown.png", + "size": 95963 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Light_Grey.png", + "size": 103676 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Silver.png", + "size": 92935 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Tan.png", + "size": 103370 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse.png", + "size": 95111 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Blue.png", + "size": 97500 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Champagne.png", + "size": 95093 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Lavender.png", + "size": 95436 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Light_Blue.png", + "size": 96577 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Natural.png", + "size": 96252 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Orange.png", + "size": 102411 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Purple.png", + "size": 98329 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Rose.png", + "size": 96864 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Sand.png", + "size": 94583 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Silver.png", + "size": 94090 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin.png", + "size": 100046 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Champagne.png", + "size": 103064 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Electric_Blue.png", + "size": 108066 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Forest_Green.png", + "size": 101972 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Natural.png", + "size": 102273 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Pink.png", + "size": 109418 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Purple.png", + "size": 107736 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Red.png", + "size": 112932 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Rose.png", + "size": 106586 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Royal_Blue.png", + "size": 104205 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Shiny_Moss.png", + "size": 104097 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Yellow.png", + "size": 109030 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine.png", + "size": 97432 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Champagne.png", + "size": 98020 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Forest_Green.png", + "size": 95769 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Moss.png", + "size": 97104 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Natural.png", + "size": 98754 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Pink.png", + "size": 101556 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Purple.png", + "size": 100251 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Red.png", + "size": 98152 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Rose.png", + "size": 100871 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Royal_Blue.png", + "size": 93925 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Sky_Blue.png", + "size": 99016 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Yellow.png", + "size": 100976 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette.png", + "size": 106821 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Beige.png", + "size": 99810 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Electric_Blue.png", + "size": 104668 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Fuchsia.png", + "size": 105848 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Green.png", + "size": 105126 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Lavender.png", + "size": 96660 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Mint_Green.png", + "size": 110475 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Orange.png", + "size": 112882 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Purple.png", + "size": 97648 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Red.png", + "size": 105563 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Rose.png", + "size": 104913 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Silver.png", + "size": 94377 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Sky_Blue.png", + "size": 108136 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Turquoise.png", + "size": 104131 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Yellow.png", + "size": 109132 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon.png", + "size": 103606 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Natural.png", + "size": 102424 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Shiny.png", + "size": 102418 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone.png", + "size": 119870 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Black_White.png", + "size": 110928 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Blue_Khaki.png", + "size": 115470 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Brown.png", + "size": 108524 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Blue.png", + "size": 112390 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Brown.png", + "size": 113162 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Gray.png", + "size": 104156 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Green_Blue.png", + "size": 115384 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Mustard.png", + "size": 118914 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Olive_Green.png", + "size": 107623 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Purple_Orange.png", + "size": 120064 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Red_Vanilla.png", + "size": 123506 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Saturated_Green.png", + "size": 109955 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet.png", + "size": 98211 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Black.png", + "size": 87457 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Blue.png", + "size": 96756 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Bordeaux.png", + "size": 97512 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Dark_Grey.png", + "size": 87946 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Eggplant.png", + "size": 93397 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Green.png", + "size": 99306 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Ocean_Blue.png", + "size": 91466 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Orange.png", + "size": 102928 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Dark_Blue.png", + "size": 98300 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Dark_Red.png", + "size": 94323 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Emerald.png", + "size": 94536 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Purple.png", + "size": 94781 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Turquoise.png", + "size": 97607 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_White.png", + "size": 95380 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton.png", + "size": 99464 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Aubergine.png", + "size": 94228 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Blue_Jay.png", + "size": 104822 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Carbon.png", + "size": 86943 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Fuchsia.png", + "size": 106733 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Garnet.png", + "size": 101090 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Gray.png", + "size": 98187 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Green_Tea.png", + "size": 103110 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Jungle.png", + "size": 93762 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Morning_Glory.png", + "size": 98750 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Paprika.png", + "size": 107246 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Saffron.png", + "size": 110719 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Sand.png", + "size": 107885 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Tobacco.png", + "size": 96929 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit.png", + "size": 99475 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Aubergine.png", + "size": 85449 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Black_Pepper.png", + "size": 84506 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Blue_Jay.png", + "size": 97222 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Carbon.png", + "size": 80879 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Charcoal.png", + "size": 86341 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Emerald.png", + "size": 87580 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fog.png", + "size": 94774 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fuchsia.png", + "size": 92547 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Garnet.png", + "size": 91523 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Green_Tea.png", + "size": 100310 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Oyster.png", + "size": 100169 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Paprika.png", + "size": 102930 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Purple.png", + "size": 92547 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Saffron.png", + "size": 103078 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Sand.png", + "size": 100191 + }, + { + "key": "Materials/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Tobacco.png", + "size": 93924 + }, + { + "key": "Materials/vMaterials_2/Fabric/Cashmere_Wool_Suiting.mdl", + "size": 55379 + }, + { + "key": "Materials/vMaterials_2/Fabric/Cotton_Denim.mdl", + "size": 29969 + }, + { + "key": "Materials/vMaterials_2/Fabric/Cotton_French_Terry.mdl", + "size": 41497 + }, + { + "key": "Materials/vMaterials_2/Fabric/Cotton_Oxford.mdl", + "size": 43097 + }, + { + "key": "Materials/vMaterials_2/Fabric/Cotton_Roughly_Woven.mdl", + "size": 20838 + }, + { + "key": "Materials/vMaterials_2/Fabric/Cotton_Single_Jersey.mdl", + "size": 61577 + }, + { + "key": "Materials/vMaterials_2/Fabric/Cotton_Twill_Gabardine.mdl", + "size": 46998 + }, + { + "key": "Materials/vMaterials_2/Fabric/Fabric_Cotton_Fine_Woven.mdl", + "size": 23981 + }, + { + "key": "Materials/vMaterials_2/Fabric/Fabric_Cotton_Pique_Weave.mdl", + "size": 26957 + }, + { + "key": "Materials/vMaterials_2/Fabric/Felt_Plain.mdl", + "size": 49139 + }, + { + "key": "Materials/vMaterials_2/Fabric/Polyester_Charmeuse.mdl", + "size": 36639 + }, + { + "key": "Materials/vMaterials_2/Fabric/Polyester_Crepe_de_Chine.mdl", + "size": 36357 + }, + { + "key": "Materials/vMaterials_2/Fabric/Polyester_Herringbone.mdl", + "size": 30862 + }, + { + "key": "Materials/vMaterials_2/Fabric/Polyester_Twill.mdl", + "size": 23859 + }, + { + "key": "Materials/vMaterials_2/Fabric/Silk_Charmeuse.mdl", + "size": 37326 + }, + { + "key": "Materials/vMaterials_2/Fabric/Silk_Crepe_Back_Satin.mdl", + "size": 42464 + }, + { + "key": "Materials/vMaterials_2/Fabric/Silk_Crepe_de_Chine.mdl", + "size": 36110 + }, + { + "key": "Materials/vMaterials_2/Fabric/Silk_Georgette.mdl", + "size": 42745 + }, + { + "key": "Materials/vMaterials_2/Fabric/Silk_Plain_Chiffon.mdl", + "size": 32562 + }, + { + "key": "Materials/vMaterials_2/Fabric/Tweed_Herringbone.mdl", + "size": 22605 + }, + { + "key": "Materials/vMaterials_2/Fabric/Velvet.mdl", + "size": 33237 + }, + { + "key": "Materials/vMaterials_2/Fabric/Wool_Melton.mdl", + "size": 35800 + }, + { + "key": "Materials/vMaterials_2/Fabric/Wool_Sweater_Knit.mdl", + "size": 53621 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cashmere_wool_suiting_R_diff.jpg", + "size": 1060148 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cashmere_wool_suiting_R_rough_G_ao_B_height.jpg", + "size": 1918218 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cashmere_wool_suiting_norm.jpg", + "size": 1484447 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/charmeuse_weaving_02_R_id_G_offs.png", + "size": 3788 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/charmeuse_weaving_02_norm.png", + "size": 9473 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cot_ox_R_diff_G_mask.jpg", + "size": 3405958 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cot_ox_R_rough_G_ao_B_height.jpg", + "size": 3331239 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cot_ox_norm.jpg", + "size": 2778856 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cotton_french_terry_R_diff_G_rough_B_ao_A_height.png", + "size": 11295853 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cotton_french_terry_norm.jpg", + "size": 1051752 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cotton_roughly_woven_diff.jpg", + "size": 3181154 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cotton_roughly_woven_norm.jpg", + "size": 2530570 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/cotton_roughly_woven_rough.jpg", + "size": 3727699 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/crepe_de_chine_norm.jpg", + "size": 1774790 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/crepe_de_chine_var.jpg", + "size": 1882897 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/crepe_norm_2.jpg", + "size": 1800029 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/denim_R_diff_G_mask.jpg", + "size": 3298503 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/denim_R_rough_G_ao_B_height.jpg", + "size": 3660431 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/denim_norm.jpg", + "size": 2968586 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/denim_warp.jpg", + "size": 259956 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/denim_wear.jpg", + "size": 340101 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/fabric_noise_multi_R_noise1_G_noise_2.png", + "size": 2272722 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/fabric_warp.jpg", + "size": 141557 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/felt_fuzz_mask.jpg", + "size": 1229106 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/felt_white_diff.jpg", + "size": 1756812 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/fibers.jpg", + "size": 519681 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/fine_woven_cotton_diff.jpg", + "size": 4206716 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/fine_woven_cotton_multi_R_rough_G_ao.jpg", + "size": 3889854 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/fine_woven_cotton_norm.jpg", + "size": 5114440 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/french_terry_fabric_warp.png", + "size": 197484 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/pique_weave_diff.jpg", + "size": 3063013 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/pique_weave_multi_R_rough_G_ao_B_height.jpg", + "size": 4973850 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/pique_weave_norm.jpg", + "size": 2978593 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/polyester_herringbone_multi_R_diff_G_rough_B_dirt.jpg", + "size": 1182383 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/polyester_herringbone_norm.jpg", + "size": 2729749 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/polyester_twill_multi_R_diff_G_rough_B_dirt.jpg", + "size": 1587505 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/polyester_twill_norm.jpg", + "size": 1537828 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_crepe_satin_R_rough_G_diff_B_height.jpg", + "size": 1981810 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_crepe_satin_norm.jpg", + "size": 1458722 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_georgette_R_diff_G_opacity.jpg", + "size": 1149346 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_georgette_R_rough_G_ao_B_height.jpg", + "size": 1563462 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_georgette_norm.jpg", + "size": 1473365 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_georgette_roughvar.jpg", + "size": 677344 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_plain_chiffon_R_diff.jpg", + "size": 1030433 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_plain_chiffon_R_rough_G_ao_B_height.jpg", + "size": 4492174 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_plain_chiffon_norm.jpg", + "size": 2518832 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/silk_plain_chiffon_norm2.jpg", + "size": 159602 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/single_jersey_R_diff.jpg", + "size": 2314221 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/single_jersey_R_rough_G_ao_B_height.jpg", + "size": 3385623 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/single_jersey_norm.jpg", + "size": 2419779 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/sparkle_mask.jpg", + "size": 1057335 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/tweed_AO.jpg", + "size": 2103032 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/tweed_fibers_diff.jpg", + "size": 3247529 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/tweed_fuzz_diff.png", + "size": 16675007 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/tweed_mask.png", + "size": 618775 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/tweed_norm.jpg", + "size": 6395862 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/twill_gabardine_R_diff.jpg", + "size": 972802 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/twill_gabardine_R_rough_G_ao_B_height.jpg", + "size": 5117759 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/twill_gabardine_fabric_warp.png", + "size": 197484 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/twill_gabardine_norm.jpg", + "size": 1153115 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/velvet_diff.jpg", + "size": 2749962 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/velvet_imperfections.jpg", + "size": 1532720 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/velvet_norm.jpg", + "size": 2519779 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/wool_knit_R_diff.jpg", + "size": 916220 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/wool_knit_R_rough_G_ao_B_height.jpg", + "size": 1631277 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/wool_knit_norm.jpg", + "size": 1311807 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/wool_melton_R_diff_G_fuzz.jpg", + "size": 957100 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/wool_melton_R_rough_G_ao_B_height.jpg", + "size": 1880330 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/wool_melton_norm.jpg", + "size": 1155938 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/wuckerl_R_ao_G_mask.jpg", + "size": 1371864 + }, + { + "key": "Materials/vMaterials_2/Fabric/textures/wuckerl_norm.jpg", + "size": 1099801 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Alexandrite.mdl.png", + "size": 92134 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Alexandrite.mdl@Alexandrite.png", + "size": 92134 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Amethyst.mdl.png", + "size": 102350 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Amethyst.mdl@Amethyst.png", + "size": 102350 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Ametrine.mdl.png", + "size": 99742 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Ametrine.mdl@Ametrine.png", + "size": 99742 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Aquamarine.mdl.png", + "size": 95829 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Aquamarine.mdl@Aquamarine.png", + "size": 95829 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Citrine.mdl.png", + "size": 114025 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Citrine.mdl@Citrine.png", + "size": 114025 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Diamond.mdl.png", + "size": 120276 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Diamond.mdl@Diamond.png", + "size": 120276 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Emerald.mdl.png", + "size": 90400 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Emerald.mdl@Emerald.png", + "size": 90400 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Garnet.mdl.png", + "size": 93656 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Garnet.mdl@Garnet.png", + "size": 93656 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Iolite.mdl.png", + "size": 92834 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Iolite.mdl@Iolite.png", + "size": 92834 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Jade.mdl.png", + "size": 101342 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Jade.mdl@Jade.png", + "size": 101342 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Morganite.mdl.png", + "size": 98414 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Morganite.mdl@Morganite.png", + "size": 98414 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Onyx.mdl.png", + "size": 80292 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Onyx.mdl@Onyx.png", + "size": 80292 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Pearl.mdl.png", + "size": 73713 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Pearl.mdl@Pearl.png", + "size": 73713 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Peridot.mdl.png", + "size": 93391 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Peridot.mdl@Peridot.png", + "size": 93391 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Ruby.mdl.png", + "size": 106063 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Ruby.mdl@Ruby.png", + "size": 106063 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Sapphire.mdl.png", + "size": 107001 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Sapphire.mdl@Sapphire.png", + "size": 107001 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Tanzanite.mdl.png", + "size": 83943 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Tanzanite.mdl@Tanzanite.png", + "size": 83943 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Topaz.mdl.png", + "size": 105832 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Topaz.mdl@Topaz.png", + "size": 105832 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Tourmaline.mdl.png", + "size": 102714 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Tourmaline.mdl@Tourmaline.png", + "size": 102714 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Turquoise.mdl.png", + "size": 111004 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Turquoise.mdl@Turquoise.png", + "size": 111004 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Turquoise.mdl@Turquoise_Apple_Green.png", + "size": 113516 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Turquoise.mdl@Turquoise_Blueish_Green.png", + "size": 114931 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Turquoise.mdl@Turquoise_Mineral.png", + "size": 106011 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Zircon.mdl.png", + "size": 120970 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/256x256/Zircon.mdl@Zircon.png", + "size": 120970 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Alexandrite.Alexandrite.png", + "size": 117358 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Amethyst.Amethyst.png", + "size": 110697 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Ametrine.Ametrine.png", + "size": 117830 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Aquamarine.Aquamarine.png", + "size": 111572 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Citrine.Citrine.png", + "size": 130594 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Diamond.Diamond.png", + "size": 141903 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Emerald.Emerald.png", + "size": 102755 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Garnet.Garnet.png", + "size": 93487 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Iolite.Iolite.png", + "size": 106705 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Jade.Jade.png", + "size": 106873 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Morganite.Morganite.png", + "size": 114678 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Onyx.Onyx.png", + "size": 87113 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Pearl.Pearl.png", + "size": 87572 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Peridot.Peridot.png", + "size": 109228 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Ruby.Ruby.png", + "size": 114667 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Sapphire.Sapphire.png", + "size": 121224 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Tanzanite.Tanzanite.png", + "size": 94012 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Topaz.Topaz.png", + "size": 118916 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Tourmaline.Tourmaline.png", + "size": 113411 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Turquoise.Turquoise.png", + "size": 115732 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Turquoise.Turquoise_Apple_Green.png", + "size": 123734 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Turquoise.Turquoise_Blueish_Green.png", + "size": 122274 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Turquoise.Turquoise_Mineral.png", + "size": 113639 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/XZircon.Zircon.png", + "size": 139659 + }, + { + "key": "Materials/vMaterials_2/Gems/.thumbs/Zircon.Zircon.png", + "size": 141390 + }, + { + "key": "Materials/vMaterials_2/Gems/Alexandrite.mdl", + "size": 4994 + }, + { + "key": "Materials/vMaterials_2/Gems/Amethyst.mdl", + "size": 6006 + }, + { + "key": "Materials/vMaterials_2/Gems/Ametrine.mdl", + "size": 6828 + }, + { + "key": "Materials/vMaterials_2/Gems/Aquamarine.mdl", + "size": 4742 + }, + { + "key": "Materials/vMaterials_2/Gems/Citrine.mdl", + "size": 6011 + }, + { + "key": "Materials/vMaterials_2/Gems/Diamond.mdl", + "size": 9406 + }, + { + "key": "Materials/vMaterials_2/Gems/Emerald.mdl", + "size": 4732 + }, + { + "key": "Materials/vMaterials_2/Gems/Garnet.mdl", + "size": 6361 + }, + { + "key": "Materials/vMaterials_2/Gems/Iolite.mdl", + "size": 4689 + }, + { + "key": "Materials/vMaterials_2/Gems/Jade.mdl", + "size": 6419 + }, + { + "key": "Materials/vMaterials_2/Gems/Morganite.mdl", + "size": 4790 + }, + { + "key": "Materials/vMaterials_2/Gems/Onyx.mdl", + "size": 7504 + }, + { + "key": "Materials/vMaterials_2/Gems/Pearl.mdl", + "size": 5965 + }, + { + "key": "Materials/vMaterials_2/Gems/Peridot.mdl", + "size": 4688 + }, + { + "key": "Materials/vMaterials_2/Gems/Ruby.mdl", + "size": 6324 + }, + { + "key": "Materials/vMaterials_2/Gems/Sapphire.mdl", + "size": 6333 + }, + { + "key": "Materials/vMaterials_2/Gems/Tanzanite.mdl", + "size": 4764 + }, + { + "key": "Materials/vMaterials_2/Gems/Topaz.mdl", + "size": 6308 + }, + { + "key": "Materials/vMaterials_2/Gems/Tourmaline.mdl", + "size": 8607 + }, + { + "key": "Materials/vMaterials_2/Gems/Turquoise.mdl", + "size": 38919 + }, + { + "key": "Materials/vMaterials_2/Gems/Zircon.mdl", + "size": 6032 + }, + { + "key": "Materials/vMaterials_2/Gems/textures/turquoise_breakup_noise.png", + "size": 160299 + }, + { + "key": "Materials/vMaterials_2/Gems/textures/turquoise_crack_msk.png", + "size": 74724 + }, + { + "key": "Materials/vMaterials_2/Gems/textures/turquoise_cracks_norm2.jpg", + "size": 1167073 + }, + { + "key": "Materials/vMaterials_2/Gems/textures/turquoise_diffuse.jpg", + "size": 1556109 + }, + { + "key": "Materials/vMaterials_2/Gems/textures/turquoise_multi_rough.jpg", + "size": 5554124 + }, + { + "key": "Materials/vMaterials_2/Gems/textures/turquoise_veins.jpg", + "size": 762480 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl.png", + "size": 98165 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear.png", + "size": 98165 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear_Blueish.png", + "size": 98217 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Clear.mdl@Glass_Clear_Greenish.png", + "size": 98202 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl.png", + "size": 94760 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Blue.png", + "size": 92218 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Orange.png", + "size": 95905 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Purple.png", + "size": 96878 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Red.png", + "size": 92201 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Sea_Blue.png", + "size": 98103 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Clear_Saturated_Yellow.png", + "size": 98273 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Colored.mdl@Glass_Colored.png", + "size": 94760 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl.png", + "size": 112587 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Heavy_Dirt_Dust.png", + "size": 112376 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Heavy_Mixed_Dirt.png", + "size": 119943 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Drop_Stains.png", + "size": 104571 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Dusty_Dirt.png", + "size": 106186 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Clear_Light_Mixed_Dirt.png", + "size": 108121 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Dirty.mdl@Glass_Dirty.png", + "size": 112587 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl.png", + "size": 157909 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Clear_Large_Frit.png", + "size": 160726 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Clear_Medium_Frit.png", + "size": 165308 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Fritted.mdl@Glass_Fritted.png", + "size": 157909 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl.png", + "size": 74883 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel.png", + "size": 74883 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Bronze.png", + "size": 78079 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Cool_Gray.png", + "size": 73776 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Dark_Blue.png", + "size": 82043 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Dark_Gray.png", + "size": 76922 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_Evergreen.png", + "size": 78012 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Spandrel.mdl@Glass_Glazing_Spandrel_White.png", + "size": 73794 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl.png", + "size": 94967 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted.png", + "size": 94967 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Blue_Sky.png", + "size": 93314 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Bronze.png", + "size": 91849 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Cool_Gray.png", + "size": 92364 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Blue.png", + "size": 90216 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Bronze.png", + "size": 89398 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Dark_Gray.png", + "size": 88365 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Evergreen.png", + "size": 89885 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Green.png", + "size": 93216 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Light_Bronze.png", + "size": 95086 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Medium_Gray.png", + "size": 91231 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Petrol.png", + "size": 92120 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Smoked_Sky.png", + "size": 89619 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Soft_Green.png", + "size": 95591 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Glazing_Tinted.mdl@Glass_Glazing_Tinted_Teal.png", + "size": 92016 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl.png", + "size": 124012 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical.png", + "size": 124012 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BAF.png", + "size": 124885 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BAK.png", + "size": 124645 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BALF.png", + "size": 124987 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BASF.png", + "size": 124840 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_BK.png", + "size": 124233 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_F.png", + "size": 124971 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_FK.png", + "size": 123829 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_K.png", + "size": 124400 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_KF.png", + "size": 124565 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LAF.png", + "size": 123761 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LAK.png", + "size": 124536 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LASF.png", + "size": 122943 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LF.png", + "size": 125152 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_LLF.png", + "size": 124071 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_PK.png", + "size": 124258 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_PSK.png", + "size": 123970 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SF.png", + "size": 123885 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SK.png", + "size": 124615 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Optical.mdl@Glass_Optical_SSK.png", + "size": 125107 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl.png", + "size": 103124 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Clear_Heavy_Smudges.png", + "size": 113311 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Clear_Light_Smudges_Variation.png", + "size": 104515 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glass_Smudged.mdl@Glass_Smudged.png", + "size": 103124 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glazing_Clear.mdl.png", + "size": 97799 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glazing_Clear.mdl@Glazing_Clear.png", + "size": 97799 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glazing_Float.mdl.png", + "size": 93613 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Glazing_Float.mdl@Glazing_Float.png", + "size": 93613 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl.png", + "size": 74687 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror.png", + "size": 74687 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Cool_Tint.png", + "size": 74452 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Smoked_Dark.png", + "size": 68551 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Smoked_Light.png", + "size": 72581 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/256x256/Mirror.mdl@Mirror_Warm_Tint.png", + "size": 74802 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear.png", + "size": 122413 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear_Blueish.png", + "size": 118783 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Clear.Glass_Clear_Greenish.png", + "size": 121483 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Blue.png", + "size": 121655 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Orange.png", + "size": 125462 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Purple.png", + "size": 127943 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Red.png", + "size": 126269 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Sea_Blue.png", + "size": 126758 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Clear_Saturated_Yellow.png", + "size": 124335 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Colored.Glass_Colored.png", + "size": 126702 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Heavy_Dirt_Dust.png", + "size": 129469 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Heavy_Mixed_Dirt.png", + "size": 129393 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Drop_Stains.png", + "size": 127968 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Dusty_Dirt.png", + "size": 128217 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Clear_Light_Mixed_Dirt.png", + "size": 128305 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Dirty.Glass_Dirty.png", + "size": 129205 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Clear_Large_Frit.png", + "size": 131824 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Clear_Medium_Frit.png", + "size": 135698 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Fritted.Glass_Fritted.png", + "size": 134848 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel.png", + "size": 101744 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Bronze.png", + "size": 101514 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Cool_Gray.png", + "size": 99413 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Blue.png", + "size": 103363 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Dark_Gray.png", + "size": 98531 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_Evergreen.png", + "size": 103988 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Spandrel.Glass_Glazing_Spandrel_White.png", + "size": 99144 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted.png", + "size": 118617 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Blue_Sky.png", + "size": 121229 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Bronze.png", + "size": 118413 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Cool_Gray.png", + "size": 118059 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Blue.png", + "size": 119584 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Bronze.png", + "size": 115784 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Dark_Gray.png", + "size": 115844 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Evergreen.png", + "size": 118714 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Green.png", + "size": 122351 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Light_Bronze.png", + "size": 121050 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Medium_Gray.png", + "size": 115783 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Petrol.png", + "size": 119675 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Smoked_Sky.png", + "size": 117596 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Soft_Green.png", + "size": 124848 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Glazing_Tinted.Glass_Glazing_Tinted_Teal.png", + "size": 123348 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical.png", + "size": 147940 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BAF.png", + "size": 148368 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BAK.png", + "size": 148102 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BALF.png", + "size": 147732 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BASF.png", + "size": 148962 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_BK.png", + "size": 148149 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_F.png", + "size": 148397 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_FK.png", + "size": 147922 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_K.png", + "size": 148320 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_KF.png", + "size": 148016 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LAF.png", + "size": 149610 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LAK.png", + "size": 149056 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LASF.png", + "size": 150606 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LF.png", + "size": 148092 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_LLF.png", + "size": 147979 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_PK.png", + "size": 147935 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_PSK.png", + "size": 147209 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SF.png", + "size": 149790 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SK.png", + "size": 148243 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Optical.Glass_Optical_SSK.png", + "size": 148388 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Clear_Heavy_Smudges.png", + "size": 128267 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Clear_Light_Smudges_Variation.png", + "size": 128275 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glass_Smudged.Glass_Smudged.png", + "size": 128362 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glazing_Clear.Glazing_Clear.png", + "size": 122562 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Glazing_Float.Glazing_Float.png", + "size": 128259 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Mirror.Mirror.png", + "size": 109958 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Mirror.mirror_cool_tint.png", + "size": 115622 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Mirror.mirror_smoked_dark.png", + "size": 102114 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Mirror.mirror_smoked_light.png", + "size": 110287 + }, + { + "key": "Materials/vMaterials_2/Glass/.thumbs/Mirror.mirror_warm_tint.png", + "size": 115372 + }, + { + "key": "Materials/vMaterials_2/Glass/Glass_Clear.mdl", + "size": 40770 + }, + { + "key": "Materials/vMaterials_2/Glass/Glass_Colored.mdl", + "size": 47198 + }, + { + "key": "Materials/vMaterials_2/Glass/Glass_Dirty.mdl", + "size": 45308 + }, + { + "key": "Materials/vMaterials_2/Glass/Glass_Fritted.mdl", + "size": 40796 + }, + { + "key": "Materials/vMaterials_2/Glass/Glass_Glazing_Spandrel.mdl", + "size": 47275 + }, + { + "key": "Materials/vMaterials_2/Glass/Glass_Glazing_Tinted.mdl", + "size": 59778 + }, + { + "key": "Materials/vMaterials_2/Glass/Glass_Optical.mdl", + "size": 65975 + }, + { + "key": "Materials/vMaterials_2/Glass/Glass_Smudged.mdl", + "size": 40836 + }, + { + "key": "Materials/vMaterials_2/Glass/Glazing_Clear.mdl", + "size": 3519 + }, + { + "key": "Materials/vMaterials_2/Glass/Glazing_Float.mdl", + "size": 4343 + }, + { + "key": "Materials/vMaterials_2/Glass/Mirror.mdl", + "size": 9217 + }, + { + "key": "Materials/vMaterials_2/Glass/textures/glass_dirt_multi_mask.jpg", + "size": 5242750 + }, + { + "key": "Materials/vMaterials_2/Glass/textures/glass_frit_dist.png", + "size": 1571505 + }, + { + "key": "Materials/vMaterials_2/Glass/textures/glass_smudges_clouds_multi.jpg", + "size": 2406562 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl.png", + "size": 118585 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl@Asphalt_Fine.png", + "size": 118585 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl@Asphalt_Fine_Dry_With_Puddles.png", + "size": 114138 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl@Asphalt_Fine_Dry_With_Strong_Puddles.png", + "size": 108144 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl@Asphalt_Fine_Medium_Wet.png", + "size": 115298 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl@Asphalt_Fine_Moist.png", + "size": 114032 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl@Asphalt_Fine_Moist_With_Puddles.png", + "size": 115733 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl@Asphalt_Fine_Wet.png", + "size": 112688 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Asphalt_Fine.mdl@Asphalt_Wet_Puddles.png", + "size": 100337 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Cobblestone_Big_and_Loose.mdl.png", + "size": 118305 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Cobblestone_Big_and_Loose.mdl@Cobblestone_Big_and_Loose.png", + "size": 118305 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Cobblestone_Big_and_Loose.mdl@Cobblestone_Big_and_Loose_Shiny.png", + "size": 119553 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Cobblestone_Big_and_Loose.mdl@Cobblestone_Big_and_Loose_Wet.png", + "size": 115233 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Cobblestone_Big_and_Loose.mdl@Cobblestone_Big_and_Loose_Wet_Grout.png", + "size": 115969 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Cobblestone_Medieval.mdl.png", + "size": 111506 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Cobblestone_Medieval.mdl@Cobblestone_Medieval.png", + "size": 111506 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Cobblestone_Medieval.mdl@Cobblestone_Medieval_Dark_Dirt.png", + "size": 112508 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Gravel_Track_Ballast.mdl.png", + "size": 125803 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Gravel_Track_Ballast.mdl@Gravel_Track_Ballast.png", + "size": 125803 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Aggregate_Exposed.mdl.png", + "size": 130184 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Aggregate_Exposed.mdl@Ground_Aggregate_Charred_Moss.png", + "size": 117021 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Aggregate_Exposed.mdl@Ground_Aggregate_Exposed.png", + "size": 130184 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Aggregate_Exposed.mdl@Ground_Aggregate_Exposed_Matte.png", + "size": 112595 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Aggregate_Exposed.mdl@Ground_Aggregate_Heavy_Moss.png", + "size": 132020 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Aggregate_Exposed.mdl@Ground_Aggregate_Saturated_Moss_Patches.png", + "size": 129293 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Aggregate_Exposed.mdl@Ground_Aggregate_Slightly_Mossy.png", + "size": 131078 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Hard_Court.mdl.png", + "size": 110631 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Hard_Court.mdl@Ground_Hard_Court.png", + "size": 110631 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Hard_Court.mdl@Ground_Hard_Court_Blue.png", + "size": 113810 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Hard_Court.mdl@Ground_Hard_Court_Dark_Green.png", + "size": 112585 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Hard_Court.mdl@Ground_Hard_Court_Faded_Blue.png", + "size": 109152 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Hard_Court.mdl@Ground_Hard_Court_Light_Green.png", + "size": 115680 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Hard_Court.mdl@Ground_Hard_Court_Olive_Green.png", + "size": 109308 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Hard_Court.mdl@Ground_Hard_Court_Red_Desaturated.png", + "size": 108702 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves.mdl.png", + "size": 138554 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves.mdl@Ground_Leaves.png", + "size": 138554 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves.mdl@ground_leaves_blue.png", + "size": 140155 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves.mdl@ground_leaves_green.png", + "size": 142119 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves.mdl@ground_leaves_orange.png", + "size": 141725 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves.mdl@ground_leaves_red.png", + "size": 139348 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves.mdl@ground_leaves_yellow.png", + "size": 141468 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves_Oak.mdl.png", + "size": 123668 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves_Oak.mdl@Ground_Leaves_Oak.png", + "size": 123668 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Ground_Leaves_Oak.mdl@Ground_Leaves_Oak_Shiny.png", + "size": 125249 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Large_Granite_Paving.mdl.png", + "size": 100753 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Large_Granite_Paving.mdl@Large_Granite_Paving.png", + "size": 100753 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Large_Granite_Paving.mdl@large_granite_paving_shiny.png", + "size": 99356 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Mulch.mdl.png", + "size": 127708 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Mulch.mdl@Mulch.png", + "size": 127708 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Mulch.mdl@Mulch_Dry.png", + "size": 125557 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Mulch.mdl@Mulch_Dry_Contrast.png", + "size": 116081 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Mulch.mdl@Mulch_Mist_Damp.png", + "size": 114894 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Mulch.mdl@Mulch_Sun.png", + "size": 127801 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Mulch.mdl@Mulch_Wet.png", + "size": 116174 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Paving_Stones.mdl.png", + "size": 111894 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Paving_Stones.mdl@Bright_Shiny_Paving_Stones.png", + "size": 111565 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Paving_Stones.mdl@Paving_Stones.png", + "size": 111894 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Paving_Stones.mdl@Wet_Grouts_Paving_Stones.png", + "size": 111541 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Paving_Stones.mdl@Wet_Paving_Stones.png", + "size": 104605 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Paving_Stones.mdl@Wet_Spots_Paving_Stones.png", + "size": 111068 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Rough_Gravel.mdl.png", + "size": 110552 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Rough_Gravel.mdl@Rough_Gravel.png", + "size": 110552 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Small_Cobblestone.mdl.png", + "size": 124026 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Small_Cobblestone.mdl@Small_Cobblestone.png", + "size": 124026 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Small_Cobblestone.mdl@Small_Cobblestone_Bright.png", + "size": 127233 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Small_Cobblestone.mdl@Small_Cobblestone_Flooded_Grouts.png", + "size": 123591 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Small_Cobblestone.mdl@Small_Cobblestone_Water_Flooded.png", + "size": 118501 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/256x256/Small_Cobblestone.mdl@Small_Cobblestone_Wet_Grouts.png", + "size": 127960 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Asphalt_Fine.Asphalt_Fine.png", + "size": 96601 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Asphalt_Fine.Asphalt_Fine_Dry_With_Puddles.png", + "size": 96312 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Asphalt_Fine.Asphalt_Fine_Dry_With_Strong_Puddles.png", + "size": 95386 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Asphalt_Fine.Asphalt_Fine_Medium_Wet.png", + "size": 92617 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Asphalt_Fine.Asphalt_Fine_Moist.png", + "size": 92128 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Asphalt_Fine.Asphalt_Fine_Moist_With_Puddles.png", + "size": 94530 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Asphalt_Fine.Asphalt_Fine_Wet.png", + "size": 89319 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Asphalt_Fine.Asphalt_Wet_Puddles.png", + "size": 90264 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Cobblestone_Big_and_Loose.Cobblestone_Big_and_Loose.png", + "size": 107063 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Cobblestone_Big_and_Loose.Cobblestone_Big_and_Loose_Shiny.png", + "size": 109073 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Cobblestone_Big_and_Loose.Cobblestone_Big_and_Loose_Wet.png", + "size": 102180 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Cobblestone_Big_and_Loose.Cobblestone_Big_and_Loose_Wet_Grout.png", + "size": 104890 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Cobblestone_Medieval.Cobblestone_Medieval.png", + "size": 101725 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Cobblestone_Medieval.Cobblestone_Medieval_Dark_Dirt.png", + "size": 99664 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Gravel_Track_Ballast.Gravel_Track_Ballast.png", + "size": 117496 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Charred_Moss.png", + "size": 116441 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Exposed.png", + "size": 116939 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Exposed_Matte.png", + "size": 110164 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Heavy_Moss.png", + "size": 119317 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Saturated_Moss_Patches.png", + "size": 122853 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Aggregate_Exposed.Ground_Aggregate_Slightly_Mossy.png", + "size": 128825 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Hard_Court.Ground_Hard_Court.png", + "size": 86466 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Hard_Court.Ground_Hard_Court_Blue.png", + "size": 83172 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Hard_Court.Ground_Hard_Court_Dark_Green.png", + "size": 80404 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Hard_Court.Ground_Hard_Court_Faded_Blue.png", + "size": 86226 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Hard_Court.Ground_Hard_Court_Light_Green.png", + "size": 86124 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Hard_Court.Ground_Hard_Court_Olive_Green.png", + "size": 82320 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Hard_Court.Ground_Hard_Court_Red_Desaturated.png", + "size": 86361 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Leaves.Ground_Leaves.png", + "size": 119736 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Leaves.ground_leaves_blue.png", + "size": 121766 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Leaves.ground_leaves_green.png", + "size": 125146 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Leaves.ground_leaves_orange.png", + "size": 124639 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Leaves.ground_leaves_red.png", + "size": 118430 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Leaves.ground_leaves_yellow.png", + "size": 128527 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Leaves_Oak.Ground_Leaves_Oak.png", + "size": 109593 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Ground_Leaves_Oak.Ground_Leaves_Oak_Shiny.png", + "size": 109861 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Large_Granite_Paving.Large_Granite_Paving.png", + "size": 85951 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Large_Granite_Paving.large_granite_paving_shiny.png", + "size": 84271 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Mulch.Mulch.png", + "size": 107639 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Mulch.Mulch_Dry.png", + "size": 104872 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Mulch.Mulch_Dry_Contrast.png", + "size": 96512 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Mulch.Mulch_Mist_Damp.png", + "size": 94642 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Mulch.Mulch_Sun.png", + "size": 106247 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Mulch.Mulch_Wet.png", + "size": 93679 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Paving_Stones.Bright_Shiny_Paving_Stones.png", + "size": 102068 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Paving_Stones.Paving_Stones.png", + "size": 98729 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Paving_Stones.Wet_Grouts_Paving_Stones.png", + "size": 103833 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Paving_Stones.Wet_Paving_Stones.png", + "size": 95055 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Paving_Stones.Wet_Spots_Paving_Stones.png", + "size": 103242 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Rough_Gravel.Rough_Gravel.png", + "size": 92648 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Small_Cobblestone.Small_Cobblestone.png", + "size": 125781 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Small_Cobblestone.Small_Cobblestone_Bright.png", + "size": 129883 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Small_Cobblestone.Small_Cobblestone_Flooded_Grouts.png", + "size": 126296 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Small_Cobblestone.Small_Cobblestone_Water_Flooded.png", + "size": 119238 + }, + { + "key": "Materials/vMaterials_2/Ground/.thumbs/Small_Cobblestone.Small_Cobblestone_Wet_Grouts.png", + "size": 129630 + }, + { + "key": "Materials/vMaterials_2/Ground/Asphalt_Fine.mdl", + "size": 42533 + }, + { + "key": "Materials/vMaterials_2/Ground/Cobblestone_Big_and_Loose.mdl", + "size": 24497 + }, + { + "key": "Materials/vMaterials_2/Ground/Cobblestone_Medieval.mdl", + "size": 23537 + }, + { + "key": "Materials/vMaterials_2/Ground/Gravel_Track_Ballast.mdl", + "size": 19005 + }, + { + "key": "Materials/vMaterials_2/Ground/Ground_Aggregate_Exposed.mdl", + "size": 33593 + }, + { + "key": "Materials/vMaterials_2/Ground/Ground_Hard_Court.mdl", + "size": 30910 + }, + { + "key": "Materials/vMaterials_2/Ground/Ground_Leaves.mdl", + "size": 51809 + }, + { + "key": "Materials/vMaterials_2/Ground/Ground_Leaves_Oak.mdl", + "size": 19566 + }, + { + "key": "Materials/vMaterials_2/Ground/Large_Granite_Paving.mdl", + "size": 12832 + }, + { + "key": "Materials/vMaterials_2/Ground/Mulch.mdl", + "size": 25205 + }, + { + "key": "Materials/vMaterials_2/Ground/Paving_Stones.mdl", + "size": 26196 + }, + { + "key": "Materials/vMaterials_2/Ground/Rough_Gravel.mdl", + "size": 7360 + }, + { + "key": "Materials/vMaterials_2/Ground/Small_Cobblestone.mdl", + "size": 26355 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/HiLowNoise_D.jpg", + "size": 443391 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/Large_Granite_Paving_diff.jpg", + "size": 3185996 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/Large_Granite_Paving_mask.png", + "size": 1399183 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/Large_Granite_Paving_norm.jpg", + "size": 4747077 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/Large_Granite_Paving_rough.jpg", + "size": 3405224 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/aggregate_exposed_diff.jpg", + "size": 2312697 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/aggregate_exposed_height.jpg", + "size": 1393349 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/aggregate_exposed_norm.jpg", + "size": 3521224 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/aggregate_exposed_rough.jpg", + "size": 1477471 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/asphalt_fine_tarred_diff.jpg", + "size": 3789369 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/asphalt_fine_tarred_multi_R_rough_G_ao_B_height.jpg", + "size": 6266575 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/asphalt_fine_tarred_multi_puddles.jpg", + "size": 287552 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/asphalt_fine_tarred_norm.jpg", + "size": 2926888 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_big_and_loose_diff.jpg", + "size": 3161021 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_big_and_loose_mask.png", + "size": 410473 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_big_and_loose_multi_R_rough_G_ao_B_height.jpg", + "size": 3529843 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_big_and_loose_norm.jpg", + "size": 2630562 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_medieval_diff.jpg", + "size": 2367501 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_medieval_multi_R_rough_G_ao.jpg", + "size": 6052506 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_medieval_norm.jpg", + "size": 1976971 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_tiny_diff.jpg", + "size": 1568584 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_tiny_mask.jpg", + "size": 786891 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_tiny_multi.jpg", + "size": 1361132 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/cobblestone_tiny_norm.jpg", + "size": 1733896 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/gravel_track_ballast_diff.jpg", + "size": 1463849 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/gravel_track_ballast_multi_R_rough_G_ao.jpg", + "size": 1470569 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/gravel_track_ballast_norm.jpg", + "size": 1476528 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/ground_aggregate_exposed_curv.jpg", + "size": 1915251 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/ground_leaves_oak_diff.jpg", + "size": 3024614 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/ground_leaves_oak_norm.jpg", + "size": 2683965 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/ground_leaves_oak_r_rough_g_ao_b_height.jpg", + "size": 3440156 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/hard_court_mono_diff.jpg", + "size": 3699858 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/hard_court_multi_R_rough_G_ao_B_height.jpg", + "size": 6736406 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/hard_court_norm.jpg", + "size": 4485509 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/leaves_ao.png", + "size": 3247081 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/leaves_diff.jpg", + "size": 3713792 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/leaves_dis.png", + "size": 4724226 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/leaves_grayscale_diff.png", + "size": 7559756 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/leaves_norm.png", + "size": 18939033 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/leaves_ref.png", + "size": 3581205 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/leaves_rou.png", + "size": 6856919 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/moss_diff.jpg", + "size": 5366792 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/moss_multi_R_rough_G_ao_B_height.jpg", + "size": 7940814 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/moss_norm.jpg", + "size": 6984114 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/mulch_diff.jpg", + "size": 3253140 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/mulch_multi_R_rough_G_ao_B_height.jpg", + "size": 4312575 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/mulch_norm.jpg", + "size": 6352858 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/paving_stones_diff.jpg", + "size": 2554776 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/paving_stones_mask.jpg", + "size": 1077969 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/paving_stones_multi_R_rough_G_ao_B_height.jpg", + "size": 2561814 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/paving_stones_norm.jpg", + "size": 3976278 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/rough_gravel_diff.jpg", + "size": 4336851 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/rough_gravel_norm.jpg", + "size": 3926355 + }, + { + "key": "Materials/vMaterials_2/Ground/textures/rough_gravel_rough.jpg", + "size": 6694401 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl.png", + "size": 85778 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather.png", + "size": 85778 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Brown.png", + "size": 110709 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Brown_Punched.png", + "size": 113737 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Deep_Green.png", + "size": 104349 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Deep_Green_Punched.png", + "size": 115711 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Deep_Ocean.png", + "size": 106086 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Deep_Ocean_Punched.png", + "size": 117555 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Deep_Violet.png", + "size": 106543 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Deep_Violet_Punched.png", + "size": 120190 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Grey.png", + "size": 99993 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Grey_Punched.png", + "size": 106943 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Moss.png", + "size": 105388 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Moss_Punched.png", + "size": 112431 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Peach.png", + "size": 118632 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Peach_Punched.png", + "size": 126163 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Pop_Lime.png", + "size": 114083 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Pop_Lime_Punched.png", + "size": 133896 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Pop_Pink.png", + "size": 117562 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Pop_Pink_Punched.png", + "size": 133920 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Pop_Turquoise.png", + "size": 115548 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Pop_Turquoise_Punched.png", + "size": 131118 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Punched.png", + "size": 87274 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Sky.png", + "size": 114146 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Sky_Punched.png", + "size": 121392 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Vintage_Rose.png", + "size": 110107 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Hard_Leather.mdl@ABS_Hard_Leather_Vintage_Rose_Punched.png", + "size": 117013 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl.png", + "size": 101827 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather.png", + "size": 101827 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Black.png", + "size": 88540 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Brown.png", + "size": 85706 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Dark_Blue.png", + "size": 93026 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Dark_Purple.png", + "size": 87886 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Dark_Turquoise.png", + "size": 91176 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Moss.png", + "size": 90603 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Purple.png", + "size": 88757 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Radish.png", + "size": 91580 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Quilted_Leather.mdl@ABS_Quilted_Leather_Red.png", + "size": 101187 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl.png", + "size": 81648 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather.png", + "size": 81648 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Ash.png", + "size": 88905 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Ash_Punched.png", + "size": 96905 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Beige.png", + "size": 95698 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Beige_Punched.png", + "size": 104518 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Bone.png", + "size": 101550 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Bone_Punched.png", + "size": 110943 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Brown.png", + "size": 97937 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Brown_Punched.png", + "size": 100710 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Cognac.png", + "size": 96705 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Cognac_Punched.png", + "size": 105834 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Deep_Blue.png", + "size": 109933 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Deep_Blue_Punched.png", + "size": 120810 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Deep_Mint.png", + "size": 109364 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Deep_Mint_Punched.png", + "size": 120151 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Deep_Radish.png", + "size": 113950 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Deep_Radish_Punched.png", + "size": 125059 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Pop_Grapefruit.png", + "size": 113340 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Pop_Grapefruit_Punched.png", + "size": 124518 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Pop_Orange.png", + "size": 114354 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Pop_Orange_Punched.png", + "size": 122845 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Pop_Purple.png", + "size": 113906 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Pop_Purple_Punched.png", + "size": 127999 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Punched.png", + "size": 85522 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Salmon.png", + "size": 101853 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Soft_Leather.mdl@ABS_Soft_Leather_Salmon_Punched.png", + "size": 111691 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl.png", + "size": 81076 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Puffy_Woven_Leather_Ash.png", + "size": 101841 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Puffy_Woven_Leather_Brown.png", + "size": 106584 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Puffy_Woven_Leather_Dark.png", + "size": 97248 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Soft_Woven_Leather_Ash.png", + "size": 91556 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Soft_Woven_Leather_Baby_Blue.png", + "size": 100898 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Soft_Woven_Leather_Brown.png", + "size": 92318 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Soft_Woven_Leather_Dark.png", + "size": 82648 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Soft_Woven_Leather_Lavender.png", + "size": 103279 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Soft_Woven_Leather_Mint.png", + "size": 103643 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Soft_Woven_Leather_Salmon.png", + "size": 102463 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Soft_Woven_Leather_Sand.png", + "size": 99866 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Spotty_Woven_Leather_Ash.png", + "size": 95671 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Spotty_Woven_Leather_Brown.png", + "size": 97900 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Spotty_Woven_Leather_Dark.png", + "size": 82047 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Velvety_Woven_Leather_Brown.png", + "size": 92644 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/ABS_Woven_Leather.mdl@ABS_Woven_Leather.png", + "size": 81076 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl.png", + "size": 97521 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather.png", + "size": 97521 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Black.png", + "size": 90273 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Black_Punched.png", + "size": 96677 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Cognac_Red.png", + "size": 94981 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Cognac_Red_Punched.png", + "size": 104906 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Dark_Brown.png", + "size": 90831 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Dark_Brown_Punched.png", + "size": 100845 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Grunge.png", + "size": 95216 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Grunge_Punched.png", + "size": 104911 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Punched.png", + "size": 107012 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Shiny_Brown.png", + "size": 97544 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Shiny_Brown_Punched.png", + "size": 109494 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Soft_Light_Brown.png", + "size": 95781 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Soft_Light_Brown_Punched.png", + "size": 109430 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Spotted_Yellow.png", + "size": 105044 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Aniline_Leather.mdl@Aniline_Leather_Spotted_Yellow_Punched.png", + "size": 115633 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl.png", + "size": 91587 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather.png", + "size": 91587 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Beige.png", + "size": 90543 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Beige_Punched.png", + "size": 104831 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Black.png", + "size": 83294 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Black_Punched.png", + "size": 93394 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Blue.png", + "size": 95054 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Blue_Punched.png", + "size": 108120 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Brown.png", + "size": 85186 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Brown_Punched.png", + "size": 96098 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Dark_Green.png", + "size": 83720 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Dark_Green_Punched.png", + "size": 94803 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Light_Blue.png", + "size": 89317 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Light_Blue_Punched.png", + "size": 103440 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Light_Salmon.png", + "size": 99967 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Light_Salmon_Punched.png", + "size": 114250 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Punched.png", + "size": 102044 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Purple.png", + "size": 87469 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Purple_Punched.png", + "size": 100289 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Red.png", + "size": 92202 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/PU_Split_Leather.mdl@PU_Split_Leather_Red_Punched.png", + "size": 104868 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl.png", + "size": 81892 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather.png", + "size": 81892 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Ash_Brown.png", + "size": 76565 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Ash_Brown_Punched.png", + "size": 90573 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Black.png", + "size": 74869 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Black_Punched.png", + "size": 85654 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Dark_Grey.png", + "size": 77235 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Dark_Grey_Punched.png", + "size": 94034 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Gray.png", + "size": 81724 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Gray_Punched.png", + "size": 98042 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Green.png", + "size": 81734 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Green_Punched.png", + "size": 97049 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Light_Blue.png", + "size": 84877 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Light_Blue_Punched.png", + "size": 104006 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Punched.png", + "size": 99644 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Red_Yellow.png", + "size": 88886 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Red_Yellow_Punched.png", + "size": 106847 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Turquoise.png", + "size": 80336 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pigmented_Smooth_Leather.mdl@Pigmented_Smooth_Leather_Turquoise_Punched.png", + "size": 96949 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl.png", + "size": 83915 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather.png", + "size": 83915 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Black.png", + "size": 79530 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Black_Punched.png", + "size": 91512 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Blue.png", + "size": 84190 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Blue_Punched.png", + "size": 96975 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Cognac.png", + "size": 87593 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Cognac_Punched.png", + "size": 100855 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Dark_Brown.png", + "size": 83883 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Dark_Brown_Punched.png", + "size": 96171 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Light_Brown.png", + "size": 94146 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Light_Brown_Punched.png", + "size": 108273 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Punched.png", + "size": 92001 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Red_Oak.png", + "size": 95516 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Red_Oak_Punched.png", + "size": 107473 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Red_Wine.png", + "size": 89977 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Red_Wine_Punched.png", + "size": 101804 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Violet.png", + "size": 83244 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Violet_Punched.png", + "size": 96516 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Yellow.png", + "size": 90076 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Pull_Up_Leather.mdl@Pull_Up_Leather_Yellow_Punched.png", + "size": 105443 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl.png", + "size": 100131 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Black.png", + "size": 90768 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Black_Punched.png", + "size": 96362 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Leather.png", + "size": 100131 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Leather_Punched.png", + "size": 105607 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Lemon.png", + "size": 109738 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Lemon_Punched.png", + "size": 116607 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Mint.png", + "size": 100808 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Mint_Punched.png", + "size": 109379 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Orange.png", + "size": 110383 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Orange_Punched.png", + "size": 116815 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Peach.png", + "size": 103116 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Peach_Punched.png", + "size": 110762 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Red.png", + "size": 99886 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Red_Punched.png", + "size": 106498 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Salmon.png", + "size": 103851 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Semi_Aniline_Leather.mdl@Semi_Aniline_Salmon_Punched.png", + "size": 111797 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl.png", + "size": 90620 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather.png", + "size": 90620 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Beige.png", + "size": 97953 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Beige_Punched.png", + "size": 112566 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Black.png", + "size": 74401 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Black_Punched.png", + "size": 83339 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Blue.png", + "size": 98367 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Blue_Punched.png", + "size": 110065 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Chocolate_Brown.png", + "size": 85923 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Chocolate_Brown_Punched.png", + "size": 97218 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Light_Blue.png", + "size": 101193 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Light_Blue_Punched.png", + "size": 115192 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Medium_Brown.png", + "size": 94895 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Medium_Brown_Punched.png", + "size": 106299 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Punched.png", + "size": 98796 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Turquoise.png", + "size": 97715 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/256x256/Suede_Leather.mdl@Suede_Leather_Turquoise_Punched.png", + "size": 108987 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather.png", + "size": 87419 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Brown.png", + "size": 106038 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Brown_Punched.png", + "size": 106705 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Green.png", + "size": 97810 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Green_Punched.png", + "size": 107765 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Ocean.png", + "size": 98053 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Ocean_Punched.png", + "size": 108639 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Violet.png", + "size": 101331 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Violet_Punched.png", + "size": 112396 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Grey.png", + "size": 98642 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Grey_Punched.png", + "size": 103076 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Moss.png", + "size": 100454 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Moss_Punched.png", + "size": 105065 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Peach.png", + "size": 116155 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Peach_Punched.png", + "size": 120385 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Lime.png", + "size": 113182 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Lime_Punched.png", + "size": 126633 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Pink.png", + "size": 114918 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Pink_Punched.png", + "size": 128321 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Turquoise.png", + "size": 113020 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Turquoise_Punched.png", + "size": 126972 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Punched.png", + "size": 88521 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Sky.png", + "size": 110500 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Sky_Punched.png", + "size": 115072 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Vintage_Rose.png", + "size": 106111 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Vintage_Rose_Punched.png", + "size": 110934 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather.png", + "size": 99527 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Black.png", + "size": 85997 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Brown.png", + "size": 84957 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Dark_Blue.png", + "size": 88470 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Dark_Purple.png", + "size": 85011 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Dark_Turquoise.png", + "size": 87160 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Moss.png", + "size": 87572 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Purple.png", + "size": 86334 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Radish.png", + "size": 87612 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Quilted_Leather.ABS_Quilted_Leather_Red.png", + "size": 98179 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather.png", + "size": 83987 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Ash.png", + "size": 92312 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Ash_Punched.png", + "size": 97976 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Beige.png", + "size": 97262 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Beige_Punched.png", + "size": 103013 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Bone.png", + "size": 107603 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Bone_Punched.png", + "size": 114420 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Brown.png", + "size": 97388 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Brown_Punched.png", + "size": 98383 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Cognac.png", + "size": 98565 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Cognac_Punched.png", + "size": 104454 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Blue.png", + "size": 102796 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Blue_Punched.png", + "size": 110724 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Mint.png", + "size": 103688 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Mint_Punched.png", + "size": 110713 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Radish.png", + "size": 108758 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Radish_Punched.png", + "size": 114989 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Grapefruit.png", + "size": 112790 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Grapefruit_Punched.png", + "size": 120620 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Orange.png", + "size": 114807 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Orange_Punched.png", + "size": 120019 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Purple.png", + "size": 109402 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Purple_Punched.png", + "size": 121412 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Punched.png", + "size": 87143 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Salmon.png", + "size": 109064 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Salmon_Punched.png", + "size": 115763 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Puffy_Woven_Leather_Ash.png", + "size": 96915 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Puffy_Woven_Leather_Brown.png", + "size": 98791 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Puffy_Woven_Leather_Dark.png", + "size": 91880 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Ash.png", + "size": 92398 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Baby_Blue.png", + "size": 98023 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Brown.png", + "size": 90233 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Dark.png", + "size": 83468 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Lavender.png", + "size": 99223 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Mint.png", + "size": 102078 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Salmon.png", + "size": 101795 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Soft_Woven_Leather_Sand.png", + "size": 99940 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Spotty_Woven_Leather_Ash.png", + "size": 93909 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Spotty_Woven_Leather_Brown.png", + "size": 92034 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Spotty_Woven_Leather_Dark.png", + "size": 82554 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Velvety_Woven_Leather_Brown.png", + "size": 90338 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/ABS_Woven_Leather.ABS_Woven_Leather.png", + "size": 82612 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather.png", + "size": 96695 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Black.png", + "size": 87664 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Black_Punched.png", + "size": 93031 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Cognac_Red.png", + "size": 92153 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Cognac_Red_Punched.png", + "size": 98626 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Dark_Brown.png", + "size": 89025 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Dark_Brown_Punched.png", + "size": 95423 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Grunge.png", + "size": 93214 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Grunge_Punched.png", + "size": 100116 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Punched.png", + "size": 101986 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Shiny_Brown.png", + "size": 99468 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Shiny_Brown_Punched.png", + "size": 107059 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Soft_Light_Brown.png", + "size": 106398 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Soft_Light_Brown_Punched.png", + "size": 115365 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Spotted_Yellow.png", + "size": 105613 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Aniline_Leather.Aniline_Leather_Spotted_Yellow_Punched.png", + "size": 112396 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather.png", + "size": 91364 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Beige.png", + "size": 95430 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Beige_Punched.png", + "size": 103558 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Black.png", + "size": 84469 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Black_Punched.png", + "size": 91070 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Blue.png", + "size": 93865 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Blue_Punched.png", + "size": 101692 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Brown.png", + "size": 86553 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Brown_Punched.png", + "size": 93505 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Dark_Green.png", + "size": 85365 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Dark_Green_Punched.png", + "size": 92052 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Light_Blue.png", + "size": 91438 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Light_Blue_Punched.png", + "size": 99630 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Light_Salmon.png", + "size": 106296 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Light_Salmon_Punched.png", + "size": 115188 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Punched.png", + "size": 96945 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Purple.png", + "size": 88228 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Purple_Punched.png", + "size": 95650 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Red.png", + "size": 93344 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/PU_Split_Leather.PU_Split_Leather_Red_Punched.png", + "size": 100958 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather.png", + "size": 87071 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Ash_Brown.png", + "size": 82526 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Ash_Brown_Punched.png", + "size": 90596 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Black.png", + "size": 79745 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Black_Punched.png", + "size": 86793 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Dark_Grey.png", + "size": 84935 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Dark_Grey_Punched.png", + "size": 94243 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Gray.png", + "size": 89366 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Gray_Punched.png", + "size": 98186 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Green.png", + "size": 87343 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Green_Punched.png", + "size": 95629 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Light_Blue.png", + "size": 91227 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Light_Blue_Punched.png", + "size": 100911 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Punched.png", + "size": 95222 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Red_Yellow.png", + "size": 94438 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Red_Yellow_Punched.png", + "size": 103729 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Turquoise.png", + "size": 86955 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pigmented_Smooth_Leather.Pigmented_Smooth_Leather_Turquoise_Punched.png", + "size": 96230 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather.png", + "size": 85306 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Black.png", + "size": 82989 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Black_Punched.png", + "size": 90566 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Blue.png", + "size": 85380 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Blue_Punched.png", + "size": 93985 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Cognac.png", + "size": 88963 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Cognac_Punched.png", + "size": 97108 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Dark_Brown.png", + "size": 85631 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Dark_Brown_Punched.png", + "size": 93302 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Light_Brown.png", + "size": 97132 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Light_Brown_Punched.png", + "size": 105625 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Punched.png", + "size": 89930 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Oak.png", + "size": 94230 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Oak_Punched.png", + "size": 101771 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Wine.png", + "size": 89788 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Wine_Punched.png", + "size": 97148 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Violet.png", + "size": 85464 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Violet_Punched.png", + "size": 93823 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Yellow.png", + "size": 100638 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Pull_Up_Leather.Pull_Up_Leather_Yellow_Punched.png", + "size": 110127 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Black.png", + "size": 89395 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Black_Punched.png", + "size": 93035 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Leather.png", + "size": 100089 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Leather_Punched.png", + "size": 103358 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Lemon.png", + "size": 109530 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Lemon_Punched.png", + "size": 114833 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Mint.png", + "size": 103476 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Mint_Punched.png", + "size": 109810 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Orange.png", + "size": 108585 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Orange_Punched.png", + "size": 113201 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Peach.png", + "size": 104613 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Peach_Punched.png", + "size": 109776 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Red.png", + "size": 98258 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Red_Punched.png", + "size": 102316 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Salmon.png", + "size": 106417 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Semi_Aniline_Leather.Semi_Aniline_Salmon_Punched.png", + "size": 112076 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather.png", + "size": 89592 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Beige.png", + "size": 103244 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Beige_Punched.png", + "size": 111940 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Black.png", + "size": 79478 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Black_Punched.png", + "size": 85606 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Blue.png", + "size": 97979 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Blue_Punched.png", + "size": 105619 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Chocolate_Brown.png", + "size": 86377 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Chocolate_Brown_Punched.png", + "size": 93512 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Light_Blue.png", + "size": 102370 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Light_Blue_Punched.png", + "size": 111788 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Medium_Brown.png", + "size": 94167 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Medium_Brown_Punched.png", + "size": 101341 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Punched.png", + "size": 95160 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Turquoise.png", + "size": 101435 + }, + { + "key": "Materials/vMaterials_2/Leather/.thumbs/Suede_Leather.Suede_Leather_Turquoise_Punched.png", + "size": 109074 + }, + { + "key": "Materials/vMaterials_2/Leather/ABS_Hard_Leather.mdl", + "size": 61471 + }, + { + "key": "Materials/vMaterials_2/Leather/ABS_Quilted_Leather.mdl", + "size": 27777 + }, + { + "key": "Materials/vMaterials_2/Leather/ABS_Soft_Leather.mdl", + "size": 61999 + }, + { + "key": "Materials/vMaterials_2/Leather/ABS_Woven_Leather.mdl", + "size": 31922 + }, + { + "key": "Materials/vMaterials_2/Leather/Aniline_Leather.mdl", + "size": 81510 + }, + { + "key": "Materials/vMaterials_2/Leather/PU_Split_Leather.mdl", + "size": 86509 + }, + { + "key": "Materials/vMaterials_2/Leather/Pigmented_Smooth_Leather.mdl", + "size": 84581 + }, + { + "key": "Materials/vMaterials_2/Leather/Pull_Up_Leather.mdl", + "size": 86534 + }, + { + "key": "Materials/vMaterials_2/Leather/Semi_Aniline_Leather.mdl", + "size": 79772 + }, + { + "key": "Materials/vMaterials_2/Leather/Suede_Leather.mdl", + "size": 81268 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/PU_split_leather_back_diff.jpg", + "size": 1166262 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/PU_split_leather_back_multi_rough_ao_height.jpg", + "size": 2794189 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/PU_split_leather_back_norm.jpg", + "size": 1012661 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/PU_split_leather_front_diff.jpg", + "size": 1717563 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/PU_split_leather_front_multi_rough_dirt_height.jpg", + "size": 2942742 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/PU_split_leather_front_norm.jpg", + "size": 2133063 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/abs_hard_leather_multi_R_rough_G_height_B_ao.jpg", + "size": 6137000 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/abs_hard_leather_norm.jpg", + "size": 5230267 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/abs_quilted_leather_multi_R_rough_G_ao_B_seam.jpg", + "size": 1859882 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/abs_quilted_leather_norm.jpg", + "size": 1306538 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/abs_soft_leather_multi_R_rough_G_height_B_ao.jpg", + "size": 2024674 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/abs_soft_leather_norm.jpg", + "size": 2301506 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/abs_woven_leather_multi_R_rough_G_grunge_B_ao.jpg", + "size": 6169406 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/abs_woven_leather_norm.jpg", + "size": 4598265 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/aniline_back_albedo.jpg", + "size": 2042376 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/aniline_back_multi_rough_ao_height.jpg", + "size": 2045157 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/aniline_back_normal.jpg", + "size": 963050 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/aniline_front_albedo.jpg", + "size": 1369958 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/aniline_front_multi_rough_ao_height.jpg", + "size": 2080945 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/aniline_front_normal.jpg", + "size": 2478492 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/leather_punch_atlas_01.png", + "size": 2050660 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/multi_R_dust_G_grunge_B_leather.jpg", + "size": 1773032 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pigmented_smooth_leather_back_diff.jpg", + "size": 1762431 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pigmented_smooth_leather_back_multi_rough_ao_height.jpg", + "size": 1747955 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pigmented_smooth_leather_back_norm.jpg", + "size": 1454363 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pigmented_smooth_leather_front_diff.jpg", + "size": 1669500 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pigmented_smooth_leather_front_multi_rough_dirt_height.jpg", + "size": 2450995 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pigmented_smooth_leather_front_norm.jpg", + "size": 1871764 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pullUp_leather_Front_multi_rough_dirt_height.jpg", + "size": 3322651 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pullUp_leather_back_diff.jpg", + "size": 1740418 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pullUp_leather_back_multi_rough_pullUp_height.jpg", + "size": 2270843 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pullUp_leather_back_norm.jpg", + "size": 1565757 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pullUp_leather_front_diff.jpg", + "size": 2315489 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/pullUp_leather_front_norm.jpg", + "size": 2116647 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/semi_aniline_back_diff.jpg", + "size": 1456560 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/semi_aniline_back_multi_rough_ao_height.jpg", + "size": 2764178 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/semi_aniline_back_norm.jpg", + "size": 1048220 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/semi_aniline_front_diff.jpg", + "size": 1138627 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/semi_aniline_front_multi_rough_ao_height.jpg", + "size": 1756119 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/semi_aniline_front_norm.jpg", + "size": 1196011 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/suede_leather_back_diff.jpg", + "size": 1479088 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/suede_leather_back_multi_rough_ao_height.jpg", + "size": 3627602 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/suede_leather_back_norm.jpg", + "size": 2876761 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/suede_leather_front_diff.jpg", + "size": 3406696 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/suede_leather_front_multi_rough_dirt_height.jpg", + "size": 3574836 + }, + { + "key": "Materials/vMaterials_2/Leather/textures/suede_leather_front_norm.jpg", + "size": 3507549 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Blue_Ocean_Perlinwaves.mdl.png", + "size": 129615 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Blue_Ocean_Perlinwaves.mdl@Water_Blue_Ocean_Perlinwaves.png", + "size": 129615 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Blue_Ocean_Perlinwaves.mdl@Water_Ocean_Blue_Reef.png", + "size": 123979 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Blue_Ocean_Perlinwaves.mdl@Water_Ocean_Green_Reef.png", + "size": 123424 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Blue_Ocean_Perlinwaves.mdl@Water_Ocean_Light_Blue.png", + "size": 138204 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Blue_Ocean_Perlinwaves.mdl@Water_Pool_Clear_Blue.png", + "size": 104407 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Blue_Ocean_Perlinwaves.mdl@Water_Pool_Clear_Green.png", + "size": 103552 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl.png", + "size": 122127 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlin_Green_Lake_Med.png", + "size": 116396 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlin_Green_Lake_Min.png", + "size": 131983 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlinwaves.png", + "size": 122127 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlinwaves_Clear_Broth.png", + "size": 130298 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlinwaves_Dirty_Broth.png", + "size": 108800 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlinwaves_Dirty_Broth_Dense.png", + "size": 104443 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlinwaves_Green_Lake_Heavy_Scattering.png", + "size": 106663 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlinwaves_Green_Pond.png", + "size": 128150 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlinwaves_Green_Swamp.png", + "size": 116173 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/256x256/Water_Murky_Perlinwaves.mdl@Water_Murky_Perlinwaves_Rusty_Lake.png", + "size": 108391 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Blue_Ocean_Perlinwaves.Water_Blue_Ocean_Perlinwaves.png", + "size": 133685 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Blue_Ocean_Perlinwaves.Water_Ocean_Blue_Reef.png", + "size": 132554 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Blue_Ocean_Perlinwaves.Water_Ocean_Green_Reef.png", + "size": 133210 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Blue_Ocean_Perlinwaves.Water_Ocean_Light_Blue.png", + "size": 132852 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Blue_Ocean_Perlinwaves.Water_Pool_Clear_Blue.png", + "size": 132987 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Blue_Ocean_Perlinwaves.Water_Pool_Clear_Green.png", + "size": 134282 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlin_Green_Lake_Med.png", + "size": 127579 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlin_Green_Lake_Min.png", + "size": 130120 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlinwaves.png", + "size": 130183 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlinwaves_Clear_Broth.png", + "size": 132068 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlinwaves_Dirty_Broth.png", + "size": 125245 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlinwaves_Dirty_Broth_Dense.png", + "size": 122964 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlinwaves_Green_Lake_Heavy_Scattering.png", + "size": 124755 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlinwaves_Green_Pond.png", + "size": 132393 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlinwaves_Green_Swamp.png", + "size": 130803 + }, + { + "key": "Materials/vMaterials_2/Liquids/.thumbs/Water_Murky_Perlinwaves.Water_Murky_Perlinwaves_Rusty_Lake.png", + "size": 127086 + }, + { + "key": "Materials/vMaterials_2/Liquids/Water_Blue_Ocean_Perlinwaves.mdl", + "size": 15212 + }, + { + "key": "Materials/vMaterials_2/Liquids/Water_Murky_Perlinwaves.mdl", + "size": 19224 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Grey.mdl.png", + "size": 94264 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Grey.mdl@Facade_Brick_Bright.png", + "size": 95922 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Grey.mdl@Facade_Brick_Glaced.png", + "size": 97625 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Grey.mdl@Facade_Brick_Grey.png", + "size": 94264 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl.png", + "size": 100525 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker.png", + "size": 100525 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Dirty_Paint.png", + "size": 87395 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Mossy_Leaking.png", + "size": 104903 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Painted_Aqua_Blue.png", + "size": 80388 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Painted_Cool_Green.png", + "size": 76848 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Painted_Terracotta.png", + "size": 77084 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Painted_White.png", + "size": 79783 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Painted_Yellow.png", + "size": 78790 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Slightly_Painted.png", + "size": 103634 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Facade_Brick_Red_Clinker.mdl@Facade_Brick_Red_Clinker_Sloppy_Paint_Job.png", + "size": 87887 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Sandstone_Brick_Vintage.mdl.png", + "size": 104894 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Sandstone_Brick_Vintage.mdl@Sandstone_Brick_Vintage.png", + "size": 104894 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Sandstone_Brick_Vintage.mdl@Sandstone_Brick_Vintage_Black_Deposit.png", + "size": 108152 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/256x256/Sandstone_Brick_Vintage.mdl@Sandstone_Brick_Vintage_Red_Deposit.png", + "size": 107085 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Grey.Facade_Brick_Bright.png", + "size": 95694 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Grey.Facade_Brick_Glaced.png", + "size": 104812 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Grey.Facade_Brick_Grey.png", + "size": 92966 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker.png", + "size": 95117 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Dirty_Paint.png", + "size": 87725 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Mossy_Leaking.png", + "size": 97140 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_Aqua_Blue.png", + "size": 84482 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_Cool_Green.png", + "size": 79736 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_Terracotta.png", + "size": 81400 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_White.png", + "size": 86753 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Painted_Yellow.png", + "size": 86246 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Slightly_Painted.png", + "size": 104697 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Facade_Brick_Red_Clinker.Facade_Brick_Red_Clinker_Sloppy_Paint_Job.png", + "size": 92418 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Sandstone_Brick_Vintage.Sandstone_Brick_Vintage.png", + "size": 97972 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Sandstone_Brick_Vintage.Sandstone_Brick_Vintage_Black_Deposit.png", + "size": 99729 + }, + { + "key": "Materials/vMaterials_2/Masonry/.thumbs/Sandstone_Brick_Vintage.Sandstone_Brick_Vintage_Red_Deposit.png", + "size": 99352 + }, + { + "key": "Materials/vMaterials_2/Masonry/Facade_Brick_Grey.mdl", + "size": 12796 + }, + { + "key": "Materials/vMaterials_2/Masonry/Facade_Brick_Red_Clinker.mdl", + "size": 30855 + }, + { + "key": "Materials/vMaterials_2/Masonry/Sandstone_Brick_Vintage.mdl", + "size": 17049 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/bricks_grey_diff.jpg", + "size": 2117516 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/bricks_grey_multi_R_rough_G_ao_B_height.jpg", + "size": 4690765 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/bricks_grey_norm.jpg", + "size": 2905442 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/clinker_diff.jpg", + "size": 2881052 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/clinker_mask_multi_R_rnd_color_G_grout_B_leaks.jpg", + "size": 790768 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/clinker_multi_R_rough_G_ao_B_height.jpg", + "size": 4129909 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/clinker_norm.jpg", + "size": 3245751 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/clinker_paint_stroke_bump.jpg", + "size": 314726 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/clinker_rough.jpg", + "size": 2684853 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/painted_wall_rough.jpg", + "size": 2640475 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/sandstone_brick_R_ao_G_rough_B_wear.jpg", + "size": 1440813 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/sandstone_brick_diff.jpg", + "size": 714829 + }, + { + "key": "Materials/vMaterials_2/Masonry/textures/sandstone_brick_norm.jpg", + "size": 873151 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl.png", + "size": 99519 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper.png", + "size": 99519 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_10_of_12.png", + "size": 117281 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_11_of_12.png", + "size": 112105 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_12_of_12.png", + "size": 101278 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_2_of_12.png", + "size": 115001 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_3_of_12.png", + "size": 95669 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_4_of_12.png", + "size": 97937 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_5_of_12.png", + "size": 89170 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_6_of_12.png", + "size": 83100 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_7_of_12.png", + "size": 105195 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_8_of_12.png", + "size": 104498 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_9_of_12.png", + "size": 121447 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl.png", + "size": 77536 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum.png", + "size": 77536 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Glossy_Fingerprints.png", + "size": 82228 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Polished.png", + "size": 75176 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl.png", + "size": 97599 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized.png", + "size": 97599 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Coated.png", + "size": 102170 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Dirty.png", + "size": 100091 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Scratched.png", + "size": 99275 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Shiny.png", + "size": 88538 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Smudges.png", + "size": 99949 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Gold.png", + "size": 90604 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Grass_Green.png", + "size": 88113 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Lavender.png", + "size": 93691 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Light_Gold.png", + "size": 92927 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Lime_Green.png", + "size": 90420 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Orange.png", + "size": 90039 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Pink.png", + "size": 95191 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Purple.png", + "size": 93354 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Red.png", + "size": 88813 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Rose.png", + "size": 93194 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Royal_Blue.png", + "size": 92245 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Silver.png", + "size": 91093 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Sky_Blue.png", + "size": 95287 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Turquoise.png", + "size": 93649 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Yellow.png", + "size": 90667 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Brushed.mdl.png", + "size": 85939 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Brushed.mdl@Aluminum_Brushed.png", + "size": 85939 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Brushed.mdl@Aluminum_Brushed_Light_Brushing.png", + "size": 83387 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Brushed.mdl@Aluminum_Brushed_Medium_Brushing.png", + "size": 88237 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Brushed.mdl@Aluminum_Brushed_Medium_Light_Brushing.png", + "size": 87118 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Brushed.mdl@Aluminum_Brushed_Very_Strong_Brushing.png", + "size": 92424 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Foil.mdl.png", + "size": 81645 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Foil.mdl@Aluminum_Foil.png", + "size": 81645 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Foil.mdl@Aluminum_Foil_Heavy_Glossy_Wrinkles.png", + "size": 116225 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Foil.mdl@Aluminum_Foil_Heavy_Matte_Wrinkled.png", + "size": 103262 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Foil.mdl@Aluminum_Foil_Matte_Wrinkled.png", + "size": 89278 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Foil.mdl@Aluminum_Foil_Shiny_Wrinkled.png", + "size": 94394 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Foil.mdl@Aluminum_Foil_Smudged_Foil.png", + "size": 81509 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Hammered.mdl.png", + "size": 105193 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Hammered.mdl@Aluminum_Hammered.png", + "size": 105193 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Hammered.mdl@Aluminum_Hammered_Dull.png", + "size": 100746 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Hammered.mdl@Aluminum_Hammered_Shiny.png", + "size": 97503 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Knurling.mdl.png", + "size": 114033 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Knurling.mdl@Aluminum_Knurling.png", + "size": 114033 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Knurling.mdl@Aluminum_Knurling_Worn.png", + "size": 109755 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Scratched.mdl.png", + "size": 102870 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Scratched.mdl@Aluminum_Scratched.png", + "size": 102870 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Scratched.mdl@Aluminum_Scratched_Dark_Matte.png", + "size": 99693 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Scratched.mdl@Aluminum_Scratched_Dark_Shiny.png", + "size": 101049 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Scratched.mdl@Aluminum_Scratched_Dirty_Rough.png", + "size": 102238 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Scratched.mdl@Aluminum_Scratched_Light_Bumpy.png", + "size": 104800 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Scratched.mdl@Aluminum_Scratched_Scuffs_and_Grime.png", + "size": 105532 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl.png", + "size": 77313 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet.png", + "size": 77313 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Glossy_Imperfections.png", + "size": 74123 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Glossy_Streaks.png", + "size": 83167 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Matte_Imperfections.png", + "size": 75310 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched.png", + "size": 168898 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Cross.png", + "size": 132840 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Hexagonal.png", + "size": 169640 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Hexagonal_Small.png", + "size": 136435 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Line.png", + "size": 110981 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Rhombus.png", + "size": 145298 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Small_Circular.png", + "size": 112999 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Square.png", + "size": 119838 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Star.png", + "size": 120632 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Punched_Triangle.png", + "size": 121186 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Soft_Splotches.png", + "size": 76795 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Sheet.mdl@Aluminum_Sheet_Splotchy_Streaks.png", + "size": 76051 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Blued_Steel_Cold.mdl.png", + "size": 65644 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Blued_Steel_Cold.mdl@Blued_Steel_Cold.png", + "size": 65644 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Blued_Steel_Cold.mdl@Blued_Steel_Cold_Matte.png", + "size": 64768 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Blued_Steel_Cold.mdl@Blued_Steel_Cold_Matte_Smudged.png", + "size": 72762 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Blued_Steel_Cold.mdl@Blued_Steel_Cold_Worn.png", + "size": 86894 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl.png", + "size": 80015 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass.png", + "size": 80015 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Gold_New.png", + "size": 79505 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Gold_New_Stained.png", + "size": 90189 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Gold_Rough_Worn.png", + "size": 92940 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Gold_Shiny_Handled.png", + "size": 91590 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Gold_Worn.png", + "size": 94144 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Red_New.png", + "size": 81731 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Red_New_Stained.png", + "size": 90460 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Red_Rough_Worn.png", + "size": 93208 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Red_Shiny_Handled.png", + "size": 92140 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Red_Worn.png", + "size": 94956 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Yellow_New_Stained.png", + "size": 90416 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Yellow_Rough_Worn.png", + "size": 92891 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Yellow_Shiny_Handled.png", + "size": 91818 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass.mdl@Brass_Yellow_Worn.png", + "size": 94344 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Antique.mdl.png", + "size": 106338 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Antique.mdl@Brass_Antique.png", + "size": 106338 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Antique.mdl@Brass_Antique_Matte_Dirty.png", + "size": 105566 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Antique.mdl@Brass_Antique_Shiny_Stained.png", + "size": 105965 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl.png", + "size": 88705 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed.png", + "size": 88705 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Gold_Dirty_Medium.png", + "size": 95202 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Gold_Fine.png", + "size": 88392 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Gold_Medium.png", + "size": 95185 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Gold_Smooth_Subtle.png", + "size": 87777 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Gold_Strong.png", + "size": 90754 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Red_Dirty_Medium.png", + "size": 96768 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Red_Fine.png", + "size": 90098 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Red_Medium.png", + "size": 96772 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Red_Smooth_Subtle.png", + "size": 89233 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Red_Strong.png", + "size": 92050 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Yellow_Dirty_Medium.png", + "size": 96573 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Yellow_Fine.png", + "size": 89842 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Yellow_Medium.png", + "size": 96569 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Brushed.mdl@Brass_Brushed_Yellow_Strong.png", + "size": 91847 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl.png", + "size": 86104 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil.png", + "size": 86104 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Gold_Flat_Smudged.png", + "size": 116436 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Gold_Heavy_Wrinkles.png", + "size": 85055 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Gold_Matte_Wrinkled.png", + "size": 104574 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Gold_Shiny_Wrinkled.png", + "size": 96805 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Gold_Slightly_Wrinkled.png", + "size": 85764 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Red_Flat_Smudged.png", + "size": 116433 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Red_Heavy_Wrinkles.png", + "size": 85060 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Red_Matte_Wrinkled.png", + "size": 104583 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Red_Shiny_Wrinkled.png", + "size": 96804 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Red_Slightly_Wrinkled.png", + "size": 85764 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Yellow_Heavy_Wrinkles.png", + "size": 118073 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Yellow_Matte_Wrinkled.png", + "size": 105516 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Yellow_Shiny_Wrinkled.png", + "size": 98389 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Foil.mdl@Brass_Foil_Yellow_Slightly_Wrinkled.png", + "size": 86981 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl.png", + "size": 114047 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered.png", + "size": 114047 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered_Gold_Hammered_Darkened.png", + "size": 112373 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered_Gold_Matte_Hammering.png", + "size": 111252 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered_Gold_Shiny_Soft_Hammering.png", + "size": 98620 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered_Red_Hammered_Darkened.png", + "size": 112371 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered_Red_Matte_Hammering.png", + "size": 111255 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered_Red_Shiny_Soft_Hammering.png", + "size": 98616 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered_Yellow_Matte_Hammering.png", + "size": 112223 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Hammered.mdl@Brass_Hammered_Yellow_Shiny_Soft_Hammering.png", + "size": 100261 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Knurling.mdl.png", + "size": 114946 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Knurling.mdl@Brass_Knurling.png", + "size": 114946 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Knurling.mdl@Brass_Knurling_Gold.png", + "size": 113764 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Knurling.mdl@Brass_Knurling_Gold_Rough_Dirty.png", + "size": 104236 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Knurling.mdl@Brass_Knurling_Red.png", + "size": 115368 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Knurling.mdl@Brass_Knurling_Red_Rough_Dirty.png", + "size": 106016 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Knurling.mdl@Brass_Knurling_Yellow_Rough_Dirty.png", + "size": 105533 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl.png", + "size": 87284 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished.png", + "size": 87284 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Gold_Cloudy_Polish.png", + "size": 90036 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Gold_Matte_Polish.png", + "size": 87098 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Gold_Shiny_Polish.png", + "size": 94864 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Gold_Shiny_Worn.png", + "size": 94867 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Red_Cloudy_Polish.png", + "size": 90040 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Red_Matte_Polish.png", + "size": 87100 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Red_Shiny_Polish.png", + "size": 94861 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Red_Shiny_Worn.png", + "size": 94863 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Yellow_Cloudy_Polish.png", + "size": 90039 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Yellow_Matte_Polish.png", + "size": 87097 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Polished.mdl@Brass_Polished_Yellow_Shiny_Worn.png", + "size": 94864 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl.png", + "size": 94669 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched.png", + "size": 94669 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Gold_Heavy_Worn_Scratches.png", + "size": 113118 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Gold_Medium_Glossy_Deep_Scratches.png", + "size": 116938 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Gold_Medium_Glossy_Scratches.png", + "size": 111077 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Gold_Polished_Subtle_Dark_Scratches.png", + "size": 113127 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Gold_Subtle_Worn_Scratches.png", + "size": 97258 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Red_Heavy_Worn_Scratches.png", + "size": 115758 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Red_Medium_Glossy_Deep_Scratches.png", + "size": 119471 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Red_Medium_Glossy_Scratches.png", + "size": 113604 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Red_Polished_Subtle_Dark_Scratches.png", + "size": 115761 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Red_Subtle_Worn_Scratches.png", + "size": 98905 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Yellow_Heavy_Worn_Scratches.png", + "size": 116188 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Yellow_Medium_Glossy_Deep_Scratches.png", + "size": 120032 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Yellow_Medium_Glossy_Scratches.png", + "size": 114614 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Scratched.mdl@Brass_Scratched_Yellow_Subtle_Worn_Scratches.png", + "size": 98401 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl.png", + "size": 75606 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet.png", + "size": 75606 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Gold_Glossy_Imperfections.png", + "size": 75019 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Gold_Matte_Imperfections.png", + "size": 77164 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Gold_New_Clean.png", + "size": 75002 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Gold_Soft_Splotches.png", + "size": 76189 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Gold_Splotchy_Streaks.png", + "size": 77576 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Red_Glossy_Imperfections.png", + "size": 75429 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Red_Matte_Imperfections.png", + "size": 77462 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Red_New_Clean.png", + "size": 75569 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Red_Soft_Splotches.png", + "size": 76821 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Red_Splotchy_Streaks.png", + "size": 78122 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Yellow_Glossy_Imperfections.png", + "size": 75471 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Yellow_Matte_Imperfections.png", + "size": 77198 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Yellow_Soft_Splotches.png", + "size": 76716 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Brass_Sheet.mdl@Brass_Sheet_Yellow_Splotchy_Streaks.png", + "size": 78045 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl.png", + "size": 83853 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze.png", + "size": 83853 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_New.png", + "size": 79993 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_New_Stained.png", + "size": 90667 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Red_New.png", + "size": 96874 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Red_New_Stained.png", + "size": 97964 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Red_Rough_Worn.png", + "size": 99228 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Red_Shiny_Handled.png", + "size": 100577 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Red_Worn.png", + "size": 100394 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Rough_Worn.png", + "size": 93598 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Shiny_Handled.png", + "size": 92080 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Worn.png", + "size": 95067 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Yellow_New_Stained.png", + "size": 91521 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Yellow_Rough_Worn.png", + "size": 95169 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Yellow_Shiny_Handled.png", + "size": 93014 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze.mdl@Bronze_Yellow_Worn.png", + "size": 96613 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Antique.mdl.png", + "size": 105857 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Antique.mdl@Bronze_Antique.png", + "size": 105857 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Antique.mdl@Bronze_Antique_Matte_Dirty.png", + "size": 103636 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Antique.mdl@Bronze_Antique_Shiny_Stained.png", + "size": 107752 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Brushed.mdl.png", + "size": 88373 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Brushed.mdl@Bronze_Brushed.png", + "size": 88373 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Brushed.mdl@Bronze_Brushed_Yellow_Dirty_Medium.png", + "size": 95331 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Brushed.mdl@Bronze_Brushed_Yellow_Fine.png", + "size": 88191 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Brushed.mdl@Bronze_Brushed_Yellow_Medium.png", + "size": 95326 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Brushed.mdl@Bronze_Brushed_Yellow_Strong.png", + "size": 91521 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Foil.mdl.png", + "size": 88758 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Foil.mdl@Bronze_Foil.png", + "size": 88758 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Foil.mdl@Bronze_Foil_Heavy_Wrinkles.png", + "size": 111534 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Foil.mdl@Bronze_Foil_Matte_Wrinkled.png", + "size": 106594 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Foil.mdl@Bronze_Foil_Shiny_Wrinkled.png", + "size": 99705 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Foil.mdl@Bronze_Foil_Slightly_Wrinkled.png", + "size": 89431 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Hammered.mdl.png", + "size": 113855 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Hammered.mdl@Bronze_Hammered.png", + "size": 113855 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Hammered.mdl@Bronze_Hammered_Matte_Hammering.png", + "size": 112833 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Hammered.mdl@Bronze_Hammered_Shiny_Soft_Hammering.png", + "size": 100055 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Knurling.mdl.png", + "size": 127356 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Knurling.mdl@Bronze_Knurling.png", + "size": 127356 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Knurling.mdl@Bronze_Knurling_Rough_Dirty.png", + "size": 115244 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Polished.mdl.png", + "size": 84373 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Polished.mdl@Bronze_Polished.png", + "size": 84373 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Polished.mdl@Bronze_Polished_Cloudy_Polish.png", + "size": 88981 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Polished.mdl@Bronze_Polished_Matte_Polish.png", + "size": 84100 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Polished.mdl@Bronze_Polished_Shiny_Worn.png", + "size": 93592 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Scratched.mdl.png", + "size": 94097 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Scratched.mdl@Bronze_Scratched.png", + "size": 94097 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Scratched.mdl@Bronze_Scratched_Yellow_Heavy_Worn_Scratches.png", + "size": 112604 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Scratched.mdl@Bronze_Scratched_Yellow_Medium_Glossy_Deep_Scratches.png", + "size": 115740 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Scratched.mdl@Bronze_Scratched_Yellow_Medium_Glossy_Scratches.png", + "size": 109690 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Scratched.mdl@Bronze_Scratched_Yellow_Subtle_Worn_Scratches.png", + "size": 97739 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet.mdl.png", + "size": 86264 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet.mdl@Bronze_Sheet.png", + "size": 86264 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet.mdl@Bronze_Sheet_Glossy_Imperfections.png", + "size": 75284 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet.mdl@Bronze_Sheet_Matte_Imperfections.png", + "size": 77239 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet.mdl@Bronze_Sheet_Soft_Splotches.png", + "size": 76714 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet.mdl@Bronze_Sheet_Splotchy_Streaks.png", + "size": 77946 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl.png", + "size": 77339 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched.png", + "size": 77339 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_.png", + "size": 167886 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Cross.png", + "size": 133643 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Hexagonal.png", + "size": 168091 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Hexagonal_Small.png", + "size": 139412 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Line.png", + "size": 113573 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Rhombus.png", + "size": 146571 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Small_Circular.png", + "size": 115488 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Square.png", + "size": 121233 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Star.png", + "size": 123985 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Bronze_Sheet_Punched.mdl@Bronze_Sheet_Punched_Triangle.png", + "size": 123582 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chrome_Hammered.mdl.png", + "size": 96187 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chrome_Hammered.mdl@Chrome_Hammered.png", + "size": 96187 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium.mdl.png", + "size": 76842 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium.mdl@Chromium.png", + "size": 76842 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium.mdl@Chromium_Glossy_Fingerprints.png", + "size": 82218 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium.mdl@Chromium_Polished.png", + "size": 73611 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Brushed.mdl.png", + "size": 86599 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Brushed.mdl@Chromium_Brushed.png", + "size": 86599 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Brushed.mdl@Chromium_Brushed_Light_Brushing.png", + "size": 83531 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Brushed.mdl@Chromium_Brushed_Medium_Brushing.png", + "size": 88226 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Brushed.mdl@Chromium_Brushed_Medium_Light_Brushing.png", + "size": 86907 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Brushed.mdl@Chromium_Brushed_Very_Strong_Brushing.png", + "size": 91649 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Foil.mdl.png", + "size": 81778 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Foil.mdl@Chromium_Foil.png", + "size": 81778 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Foil.mdl@Chromium_Foil_Heavy_Glossy_Wrinkles.png", + "size": 115628 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Foil.mdl@Chromium_Foil_Heavy_Matte_Wrinkled.png", + "size": 104209 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Foil.mdl@Chromium_Foil_Matte_Wrinkled.png", + "size": 91352 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Foil.mdl@Chromium_Foil_Shiny_Wrinkled.png", + "size": 95233 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Foil.mdl@Chromium_Foil_Smudged_Foil.png", + "size": 81627 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Knurling.mdl.png", + "size": 110189 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Knurling.mdl@Chromium_Knurling.png", + "size": 110189 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Knurling.mdl@Chromium_Knurling_Worn.png", + "size": 105176 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Scratched.mdl.png", + "size": 101233 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Scratched.mdl@Chromium_Scratched.png", + "size": 101233 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Scratched.mdl@Chromium_Scratched_Dark_Matte.png", + "size": 96567 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Scratched.mdl@Chromium_Scratched_Dark_Shiny.png", + "size": 97411 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Scratched.mdl@Chromium_Scratched_Dirty_Rough.png", + "size": 102347 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Scratched.mdl@Chromium_Scratched_Light_Bumpy.png", + "size": 104351 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Scratched.mdl@Chromium_Scratched_Scuffs_and_Grime.png", + "size": 101303 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl.png", + "size": 76240 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet.png", + "size": 76240 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Glossy_Imperfections.png", + "size": 74349 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Glossy_Streaks.png", + "size": 83062 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Matte_Imperfections.png", + "size": 76691 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched.png", + "size": 167419 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Circular_Small.png", + "size": 127038 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Cross.png", + "size": 133874 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Hexagonal.png", + "size": 165518 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Hexagonal_Small.png", + "size": 138942 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Line.png", + "size": 114828 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Rhombus.png", + "size": 146315 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Square.png", + "size": 122076 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Star.png", + "size": 124855 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Punched_Triangle.png", + "size": 123844 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Soft_Splotches.png", + "size": 76494 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Chromium_Sheet.mdl@Chromium_Sheet_Splotchy_Streaks.png", + "size": 77005 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper.mdl.png", + "size": 78421 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper.mdl@Copper.png", + "size": 78421 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper.mdl@Copper_Glossy_Fingerprints.png", + "size": 83935 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper.mdl@Copper_Polished.png", + "size": 75319 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed.mdl.png", + "size": 102972 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed.mdl@Copper_Antique_Brushed.png", + "size": 102972 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed.mdl@Copper_Antique_Brushed_Decayed_Matte.png", + "size": 105034 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed.mdl@Copper_Antique_Brushed_Shiny.png", + "size": 95925 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed.mdl@Copper_Antique_Brushed_Shiny_Matte_Smudged.png", + "size": 101529 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed.mdl@Copper_Antique_Brushed_Shiny_Smudged.png", + "size": 104450 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed.mdl@Copper_Antique_Brushed_Worn_Matte.png", + "size": 108005 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl.png", + "size": 117744 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Crusted_Patina.png", + "size": 103493 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Medium_Patina.png", + "size": 117630 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Minimal_Patina.png", + "size": 105097 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Patinated.png", + "size": 117744 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Pure_Patina.png", + "size": 101731 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Slight_Patina.png", + "size": 115278 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Slight_Patina_Spots.png", + "size": 124201 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Strong_Patina.png", + "size": 110680 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Antique_Brushed_Patinated.mdl@Copper_Antique_Brushed_Very_Strong_Patina.png", + "size": 107263 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Brushed.mdl.png", + "size": 88136 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Brushed.mdl@Copper_Brushed.png", + "size": 88136 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Brushed.mdl@Copper_Brushed_Light_Brushing.png", + "size": 84312 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Brushed.mdl@Copper_Brushed_Medium_Brushing.png", + "size": 89906 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Brushed.mdl@Copper_Brushed_Medium_Light_Brushing.png", + "size": 88204 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Brushed.mdl@Copper_Brushed_Very_Strong_Brushing.png", + "size": 94010 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Foil.mdl.png", + "size": 83542 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Foil.mdl@Copper_Foil.png", + "size": 83542 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Foil.mdl@Copper_Foil_Heavy_Glossy_Wrinkles.png", + "size": 120549 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Foil.mdl@Copper_Foil_Heavy_Matte_Wrinkled.png", + "size": 106629 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Foil.mdl@Copper_Foil_Matte_Wrinkled.png", + "size": 92924 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Foil.mdl@Copper_Foil_Shiny_Wrinkled.png", + "size": 97199 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Foil.mdl@Copper_Foil_Smudged_Foil.png", + "size": 83477 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Hammered.mdl.png", + "size": 110277 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Hammered.mdl@Copper_Hammered.png", + "size": 110277 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Hammered.mdl@Copper_Hammered_Dull.png", + "size": 104686 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Hammered.mdl@Copper_Hammered_Shiny.png", + "size": 100913 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Knurling.mdl.png", + "size": 114128 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Knurling.mdl@Copper_Knurling.png", + "size": 114128 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Knurling.mdl@Copper_Knurling_Worn.png", + "size": 111100 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Scratched.mdl.png", + "size": 103831 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Scratched.mdl@Copper_Scratched.png", + "size": 103831 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Scratched.mdl@Copper_Scratched_Dark_Matte.png", + "size": 99104 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Scratched.mdl@Copper_Scratched_Dark_Shiny.png", + "size": 100980 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Scratched.mdl@Copper_Scratched_Dirty_Rough.png", + "size": 104488 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Scratched.mdl@Copper_Scratched_Light_Bumpy.png", + "size": 107108 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Scratched.mdl@Copper_Scratched_Scuffs_and_Grime.png", + "size": 104087 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl.png", + "size": 77119 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet.png", + "size": 77119 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Glossy_Imperfections.png", + "size": 75210 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Glossy_Streaks.png", + "size": 83610 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Matte_Imperfections.png", + "size": 77641 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched.png", + "size": 170938 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Circular_Small.png", + "size": 129855 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Cross.png", + "size": 136184 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Hexagonal.png", + "size": 170329 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Hexagonal_Small.png", + "size": 142846 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Line.png", + "size": 115658 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Rhombus.png", + "size": 149054 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Square.png", + "size": 123637 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Star.png", + "size": 126639 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Punched_Triangle.png", + "size": 126034 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Soft_Splotches.png", + "size": 77145 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Copper_Sheet.mdl@Copper_Sheet_Splotchy_Streaks.png", + "size": 77648 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Double_Tear.mdl.png", + "size": 109971 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Double_Tear.mdl@Diamond_Plate_Double_Tear.png", + "size": 109971 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Double_Tear.mdl@Diamond_Plate_Double_Tear_Dirty_Worn.png", + "size": 116174 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Double_Tear.mdl@Diamond_Plate_Double_Tear_Glossy.png", + "size": 107103 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Double_Tear.mdl@Diamond_Plate_Double_Tear_Matte_Aged.png", + "size": 100757 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Double_Tear.mdl@Diamond_Plate_Double_Tear_Shiny_Tops.png", + "size": 112393 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quadruple_Tear.mdl.png", + "size": 114494 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quadruple_Tear.mdl@Diamond_Plate_Quadruple_Tear.png", + "size": 114494 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quadruple_Tear.mdl@Diamond_Plate_Quadruple_Tear_Dirty_Worn.png", + "size": 119139 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quadruple_Tear.mdl@Diamond_Plate_Quadruple_Tear_Glossy.png", + "size": 110985 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quadruple_Tear.mdl@Diamond_Plate_Quadruple_Tear_Matte_Aged.png", + "size": 104062 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quadruple_Tear.mdl@Diamond_Plate_Quadruple_Tear_Shiny_Tops.png", + "size": 116552 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quintuple_Tear.mdl.png", + "size": 121754 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quintuple_Tear.mdl@Diamond_Plate_Quintuple_Tear.png", + "size": 121754 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quintuple_Tear.mdl@Diamond_Plate_Quintuple_Tear_Dirty_Worn.png", + "size": 122079 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quintuple_Tear.mdl@Diamond_Plate_Quintuple_Tear_Glossy.png", + "size": 115752 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quintuple_Tear.mdl@Diamond_Plate_Quintuple_Tear_Matte_Aged.png", + "size": 107396 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Quintuple_Tear.mdl@Diamond_Plate_Quintuple_Tear_Shiny_Tops.png", + "size": 120278 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Single_Tear.mdl.png", + "size": 91912 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Single_Tear.mdl@Diamond_Plate_Single_Tear.png", + "size": 91912 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Single_Tear.mdl@Diamond_Plate_Single_Tear_Dirty_Worn.png", + "size": 110073 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Single_Tear.mdl@Diamond_Plate_Single_Tear_Glossy.png", + "size": 95040 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Single_Tear.mdl@Diamond_Plate_Single_Tear_Matte_Aged.png", + "size": 91710 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Single_Tear.mdl@Diamond_Plate_Single_Tear_Shiny_Tops.png", + "size": 98663 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Spike.mdl.png", + "size": 95460 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Spike.mdl@Diamond_Plate_Spike.png", + "size": 95460 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Spike.mdl@Diamond_Plate_Spike_Dirty_Worn.png", + "size": 110724 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Spike.mdl@Diamond_Plate_Spike_Glossy.png", + "size": 97111 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Spike.mdl@Diamond_Plate_Spike_Matte_Aged.png", + "size": 93062 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Spike.mdl@Diamond_Plate_Spike_Shiny_Tops.png", + "size": 100627 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Triple_Tear.mdl.png", + "size": 111611 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Triple_Tear.mdl@Diamond_Plate_Triple_Tear.png", + "size": 111611 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Triple_Tear.mdl@Diamond_Plate_Triple_Tear_Dirty_Worn.png", + "size": 118983 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Triple_Tear.mdl@Diamond_Plate_Triple_Tear_Glossy.png", + "size": 108112 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Triple_Tear.mdl@Diamond_Plate_Triple_Tear_Matte_Aged.png", + "size": 100926 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Diamond_Plate_Triple_Tear.mdl@Diamond_Plate_Triple_Tear_Shiny_Tops.png", + "size": 113382 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold.mdl.png", + "size": 78826 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold.mdl@Gold.png", + "size": 78826 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold.mdl@Gold_Glossy_Fingerprints.png", + "size": 84610 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold.mdl@Gold_Polished.png", + "size": 75827 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Brushed.mdl.png", + "size": 89257 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Brushed.mdl@Gold_Brushed.png", + "size": 89257 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Brushed.mdl@Gold_Brushed_Light_Brushing.png", + "size": 85869 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Brushed.mdl@Gold_Brushed_Medium_Brushing.png", + "size": 90713 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Brushed.mdl@Gold_Brushed_Medium_Light_Brushing.png", + "size": 89432 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Brushed.mdl@Gold_Brushed_Very_Strong_Brushing.png", + "size": 94880 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Foil.mdl.png", + "size": 84582 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Foil.mdl@Gold_Foil.png", + "size": 84582 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Foil.mdl@Gold_Foil_Heavy_Glossy_Wrinkles.png", + "size": 123123 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Foil.mdl@Gold_Foil_Heavy_Matte_Wrinkled.png", + "size": 107692 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Foil.mdl@Gold_Foil_Matte_Wrinkled.png", + "size": 94798 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Foil.mdl@Gold_Foil_Shiny_Wrinkled.png", + "size": 99248 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Foil.mdl@Gold_Foil_Smudged_Foil.png", + "size": 84521 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Hammered.mdl.png", + "size": 115804 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Hammered.mdl@Gold_Hammered.png", + "size": 115804 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Hammered.mdl@Gold_Hammered_Dull.png", + "size": 109252 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Hammered.mdl@Gold_Hammered_Shiny.png", + "size": 104534 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Knurling.mdl.png", + "size": 115429 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Knurling.mdl@Gold_Knurling.png", + "size": 115429 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Knurling.mdl@Gold_Knurling_Worn.png", + "size": 112351 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Scratched.mdl.png", + "size": 104406 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Scratched.mdl@Gold_Scratched.png", + "size": 104406 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Scratched.mdl@Gold_Scratched_Dark_Matte.png", + "size": 99244 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Scratched.mdl@Gold_Scratched_Dark_Shiny.png", + "size": 101939 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Scratched.mdl@Gold_Scratched_Dirty_Rough.png", + "size": 104381 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Scratched.mdl@Gold_Scratched_Light_Bumpy.png", + "size": 107484 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Scratched.mdl@Gold_Scratched_Scuffs_and_Grime.png", + "size": 104211 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl.png", + "size": 78313 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet.png", + "size": 78313 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Glossy_Imperfections.png", + "size": 76117 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Glossy_Streaks.png", + "size": 84942 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Matte_Imperfections.png", + "size": 78307 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched.png", + "size": 171724 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Circular_Small.png", + "size": 134958 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Cross.png", + "size": 139556 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Hexagonal.png", + "size": 172573 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Hexagonal_Small.png", + "size": 146159 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Line.png", + "size": 119203 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Rhombus.png", + "size": 151904 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Square.png", + "size": 127441 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Star.png", + "size": 130571 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Punched_Triangle.png", + "size": 129769 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Soft_Splotches.png", + "size": 78575 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Gold_Sheet.mdl@Gold_Sheet_Splotchy_Streaks.png", + "size": 78554 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron.mdl.png", + "size": 76345 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron.mdl@Iron.png", + "size": 76345 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron.mdl@Iron_Glossy_Fingerprints.png", + "size": 82206 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron.mdl@Iron_Polished.png", + "size": 73777 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Brushed.mdl.png", + "size": 86422 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Brushed.mdl@Iron_Brushed.png", + "size": 86422 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Brushed.mdl@Iron_Brushed_Light_Brushing.png", + "size": 83358 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Brushed.mdl@Iron_Brushed_Medium_Brushing.png", + "size": 87844 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Brushed.mdl@Iron_Brushed_Medium_Light_Brushing.png", + "size": 86400 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Brushed.mdl@Iron_Brushed_Very_Strong_Brushing.png", + "size": 91377 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Foil.mdl.png", + "size": 81269 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Foil.mdl@Iron_Foil.png", + "size": 81269 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Foil.mdl@Iron_Foil_Heavy_Glossy_Wrinkles.png", + "size": 115413 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Foil.mdl@Iron_Foil_Heavy_Matte_Wrinkled.png", + "size": 103278 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Foil.mdl@Iron_Foil_Matte_Wrinkled.png", + "size": 90612 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Foil.mdl@Iron_Foil_Shiny_Wrinkled.png", + "size": 95019 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Foil.mdl@Iron_Foil_Smudged_Foil.png", + "size": 81147 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Hammered.mdl.png", + "size": 102095 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Hammered.mdl@Iron_Hammered.png", + "size": 102095 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Hammered.mdl@Iron_Hammered_Dull.png", + "size": 98423 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Hammered.mdl@Iron_Hammered_Shiny.png", + "size": 95041 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Knurling.mdl.png", + "size": 109722 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Knurling.mdl@Iron_Knurling.png", + "size": 109722 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Knurling.mdl@Iron_Knurling_Worn.png", + "size": 105380 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Pitted_Steel.mdl.png", + "size": 95656 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Pitted_Steel.mdl@Iron_Pitted_Steel.png", + "size": 95656 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Pitted_Steel.mdl@light_pitted_steel.png", + "size": 95654 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Pitted_Steel.mdl@medium_pitted_steel.png", + "size": 103236 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Pitted_Steel.mdl@strong_pitted_steel.png", + "size": 108238 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Scratched.mdl.png", + "size": 100853 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Scratched.mdl@Iron_Scratched.png", + "size": 100853 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Scratched.mdl@Iron_Scratched_Dark_Matte.png", + "size": 95982 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Scratched.mdl@Iron_Scratched_Dark_Shiny.png", + "size": 97133 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Scratched.mdl@Iron_Scratched_Dirty_Rough.png", + "size": 101673 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Scratched.mdl@Iron_Scratched_Light_Bumpy.png", + "size": 104023 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Scratched.mdl@Iron_Scratched_Scuffs_and_Grime.png", + "size": 100575 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl.png", + "size": 76240 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet.png", + "size": 76240 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Glossy_Imperfections.png", + "size": 73966 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Glossy_Streaks.png", + "size": 82610 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Matte_Imperfections.png", + "size": 76191 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched.png", + "size": 167951 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Cross.png", + "size": 130677 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Hexagonal.png", + "size": 166084 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Hexagonal_Small.png", + "size": 135399 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Line.png", + "size": 111065 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Rhombus.png", + "size": 142819 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Small_Circular.png", + "size": 112530 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Square.png", + "size": 118192 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Star.png", + "size": 120128 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Punched_Triangle.png", + "size": 120426 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Soft_Splotches.png", + "size": 76281 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Iron_Sheet.mdl@Iron_Sheet_Splotchy_Streaks.png", + "size": 76699 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Mercury.mdl.png", + "size": 74708 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Mercury.mdl@Mercury.png", + "size": 74708 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl.png", + "size": 86355 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Aluminum_Cast_Rough.png", + "size": 90618 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Aluminum_Cast_Shiny.png", + "size": 99946 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Iron_Cast.png", + "size": 90698 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Iron_Cast_Black_Matte.png", + "size": 85612 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Metal_Cast.png", + "size": 86355 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Metal_Cast_Painted.png", + "size": 94715 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Metal_Cast_Painted_Antique_White.png", + "size": 87541 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Metal_Cast_Painted_Gray.png", + "size": 88043 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Metal_Cast_Painted_Petrol.png", + "size": 89444 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Metal_Cast_Painted_Red.png", + "size": 96741 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Metal_Cast_Painted_White.png", + "size": 86767 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Stainless_Steel_Cast_Rough.png", + "size": 93403 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Metal_Cast.mdl@Stainless_Steel_Cast_Shiny.png", + "size": 103723 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel.mdl.png", + "size": 77399 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel.mdl@Nickel.png", + "size": 77399 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel.mdl@Nickel_Glossy_Fingerprints.png", + "size": 82653 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel.mdl@Nickel_Polished.png", + "size": 74396 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Brushed.mdl.png", + "size": 86812 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Brushed.mdl@Nickel_Brushed.png", + "size": 86812 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Brushed.mdl@Nickel_Brushed_Light_Brushing.png", + "size": 83313 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Brushed.mdl@Nickel_Brushed_Medium_Brushing.png", + "size": 88614 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Brushed.mdl@Nickel_Brushed_Medium_Light_Brushing.png", + "size": 87067 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Brushed.mdl@Nickel_Brushed_Very_Strong_Brushing.png", + "size": 92537 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Foil.mdl.png", + "size": 82128 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Foil.mdl@Nickel_Foil.png", + "size": 82128 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Foil.mdl@Nickel_Foil_Heavy_Glossy_Wrinkles.png", + "size": 116654 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Foil.mdl@Nickel_Foil_Heavy_Matte_Wrinkled.png", + "size": 104539 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Foil.mdl@Nickel_Foil_Matte_Wrinkled.png", + "size": 91253 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Foil.mdl@Nickel_Foil_Shiny_Wrinkled.png", + "size": 95312 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Foil.mdl@Nickel_Foil_Smudged_Foil.png", + "size": 81975 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Hammered.mdl.png", + "size": 105934 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Hammered.mdl@Nickel_Hammered.png", + "size": 105934 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Hammered.mdl@Nickel_Hammered_Dull.png", + "size": 101196 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Hammered.mdl@Nickel_Hammered_Shiny.png", + "size": 97864 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Knurling.mdl.png", + "size": 111403 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Knurling.mdl@Nickel_Knurling.png", + "size": 111403 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Knurling.mdl@Nickel_Knurling_Worn.png", + "size": 107759 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Scratched.mdl.png", + "size": 102182 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Scratched.mdl@Nickel_Scratched.png", + "size": 102182 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Scratched.mdl@Nickel_Scratched_Dark_Matte.png", + "size": 97764 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Scratched.mdl@Nickel_Scratched_Dark_Shiny.png", + "size": 99075 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Scratched.mdl@Nickel_Scratched_Dirty_Rough.png", + "size": 103389 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Scratched.mdl@Nickel_Scratched_Light_Bumpy.png", + "size": 105029 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Scratched.mdl@Nickel_Scratched_Scuffs_and_Grime.png", + "size": 102453 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl.png", + "size": 76278 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet.png", + "size": 76278 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Glossy_Imperfections.png", + "size": 74294 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Glossy_Streaks.png", + "size": 82843 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Matte_Imperfections.png", + "size": 76562 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched.png", + "size": 170723 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Cross.png", + "size": 133943 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Hexagonal.png", + "size": 168573 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Hexagonal_Small.png", + "size": 138968 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Line.png", + "size": 113117 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Rhombus.png", + "size": 147036 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Small_Circular.png", + "size": 115251 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Square.png", + "size": 120855 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Star.png", + "size": 123657 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Punched_Triangle.png", + "size": 123436 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Soft_Splotches.png", + "size": 76624 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Nickel_Sheet.mdl@Nickel_Sheet_Splotchy_Streaks.png", + "size": 76929 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Copper.mdl.png", + "size": 123895 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Copper.mdl@PCB_Copper.png", + "size": 123895 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Copper.mdl@PCB_Copper_Beige.png", + "size": 104207 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Copper.mdl@PCB_Copper_Smooth.png", + "size": 115766 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Copper.mdl@PCB_Coppery.png", + "size": 108926 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Copper.mdl@PCB_Coppery_Soft.png", + "size": 97951 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Goldfinger.mdl.png", + "size": 98663 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Goldfinger.mdl@PCB_Goldfinger.png", + "size": 98663 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Goldfinger.mdl@PCB_Goldfinger_Smooth.png", + "size": 98407 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/PCB_Goldfinger.mdl@PCB_Goldfinger_Soft.png", + "size": 107523 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum.mdl.png", + "size": 77627 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum.mdl@Platinum.png", + "size": 77627 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum.mdl@Platinum_Glossy_Fingerprints.png", + "size": 82555 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum.mdl@Platinum_Polished.png", + "size": 74421 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Brushed.mdl.png", + "size": 86598 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Brushed.mdl@Platinum_Brushed.png", + "size": 86598 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Brushed.mdl@Platinum_Brushed_Light_Brushing.png", + "size": 83183 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Brushed.mdl@Platinum_Brushed_Medium_Brushing.png", + "size": 88459 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Brushed.mdl@Platinum_Brushed_Medium_Light_Brushing.png", + "size": 86937 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Brushed.mdl@Platinum_Brushed_Very_Strong_Brushing.png", + "size": 92099 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Foil.mdl.png", + "size": 81972 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Foil.mdl@Platinum_Foil.png", + "size": 81972 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Foil.mdl@Platinum_Foil_Heavy_Glossy_Wrinkles.png", + "size": 116320 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Foil.mdl@Platinum_Foil_Heavy_Matte_Wrinkled.png", + "size": 104224 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Foil.mdl@Platinum_Foil_Matte_Wrinkled.png", + "size": 91157 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Foil.mdl@Platinum_Foil_Shiny_Wrinkled.png", + "size": 95418 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Foil.mdl@Platinum_Foil_Smudged_Foil.png", + "size": 81785 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Hammered.mdl.png", + "size": 105992 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Hammered.mdl@Platinum_Hammered.png", + "size": 105992 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Hammered.mdl@Platinum_Hammered_Dull.png", + "size": 101133 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Hammered.mdl@Platinum_Hammered_Shiny.png", + "size": 98049 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Knurling.mdl.png", + "size": 111305 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Knurling.mdl@Platinum_Knurling.png", + "size": 111305 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Knurling.mdl@Platinum_Knurling_Worn.png", + "size": 107717 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Scratched.mdl.png", + "size": 101970 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Scratched.mdl@Platinum_Scratched.png", + "size": 101970 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Scratched.mdl@Platinum_Scratched_Dark_Matte.png", + "size": 97661 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Scratched.mdl@Platinum_Scratched_Dark_Shiny.png", + "size": 98933 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Scratched.mdl@Platinum_Scratched_Dirty_Rough.png", + "size": 103099 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Scratched.mdl@Platinum_Scratched_Light_Bumpy.png", + "size": 104831 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Scratched.mdl@Platinum_Scratched_Scuffs_and_Grime.png", + "size": 102431 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl.png", + "size": 76213 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet.png", + "size": 76213 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Glossy_Imperfections.png", + "size": 74209 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Glossy_Streaks.png", + "size": 82499 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Matte_Imperfections.png", + "size": 76550 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched.png", + "size": 166051 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Cross.png", + "size": 133364 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Hexagonal.png", + "size": 168065 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Hexagonal_Small.png", + "size": 138545 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Line.png", + "size": 112058 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Rhombus.png", + "size": 146679 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Small_Circular.png", + "size": 114395 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Square.png", + "size": 120292 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Star.png", + "size": 123054 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Punched_Triangle.png", + "size": 122612 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Soft_Splotches.png", + "size": 76421 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Platinum_Sheet.mdl@Platinum_Sheet_Splotchy_Streaks.png", + "size": 76852 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Punched_Circular_Plate.mdl.png", + "size": 120270 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Punched_Circular_Plate.mdl@Punched_Circular_Plate.png", + "size": 120270 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Punched_Circular_Plate.mdl@Punched_Circular_Plate_Dirty_Worn.png", + "size": 123813 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Punched_Circular_Plate.mdl@Punched_Circular_Plate_Glossy.png", + "size": 116655 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Punched_Circular_Plate.mdl@Punched_Circular_Plate_Matte_Aged.png", + "size": 111235 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver.mdl.png", + "size": 77691 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver.mdl@Silver.png", + "size": 77691 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver.mdl@Silver_Glossy_Fingerprints.png", + "size": 82125 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver.mdl@Silver_Polished.png", + "size": 75262 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Brushed.mdl.png", + "size": 85173 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Brushed.mdl@Silver_Brushed.png", + "size": 85173 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Brushed.mdl@Silver_Brushed_Light_Brushing.png", + "size": 83298 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Brushed.mdl@Silver_Brushed_Medium_Brushing.png", + "size": 87783 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Brushed.mdl@Silver_Brushed_Medium_Light_Brushing.png", + "size": 86904 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Brushed.mdl@Silver_Brushed_Very_Strong_Brushing.png", + "size": 92265 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Foil.mdl.png", + "size": 81769 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Foil.mdl@Silver_Foil.png", + "size": 81769 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Foil.mdl@Silver_Foil_Heavy_Glossy_Wrinkles.png", + "size": 116264 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Foil.mdl@Silver_Foil_Heavy_Matte_Wrinkled.png", + "size": 102225 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Foil.mdl@Silver_Foil_Matte_Wrinkled.png", + "size": 88808 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Foil.mdl@Silver_Foil_Shiny_Wrinkled.png", + "size": 94286 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Foil.mdl@Silver_Foil_Smudged_Foil.png", + "size": 81756 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Hammered.mdl.png", + "size": 105881 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Hammered.mdl@Silver_Hammered.png", + "size": 105881 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Hammered.mdl@Silver_Hammered_Dull.png", + "size": 100270 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Hammered.mdl@Silver_Hammered_Shiny.png", + "size": 96718 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Knurling.mdl.png", + "size": 113895 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Knurling.mdl@Silver_Knurling.png", + "size": 113895 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Knurling.mdl@Silver_Knurling_Worn.png", + "size": 110518 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Scratched.mdl.png", + "size": 102365 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Scratched.mdl@Silver_Scratched.png", + "size": 102365 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Scratched.mdl@Silver_Scratched_Dark_Matte.png", + "size": 100106 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Scratched.mdl@Silver_Scratched_Dark_Shiny.png", + "size": 100586 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Scratched.mdl@Silver_Scratched_Dirty_Rough.png", + "size": 105831 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Scratched.mdl@Silver_Scratched_Light_Bumpy.png", + "size": 104308 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Scratched.mdl@Silver_Scratched_Scuffs_and_Grime.png", + "size": 105694 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl.png", + "size": 76984 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet.png", + "size": 76984 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Glossy_Imperfections.png", + "size": 74007 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Glossy_Streaks.png", + "size": 82796 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Matte_Imperfections.png", + "size": 75065 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched.png", + "size": 168885 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Cross.png", + "size": 133576 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Hexagonal.png", + "size": 169391 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Hexagonal_Small.png", + "size": 137664 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Line.png", + "size": 111733 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Rhombus.png", + "size": 146201 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Small_Circular.png", + "size": 114529 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Square.png", + "size": 120533 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Star.png", + "size": 122293 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Punched_Triangle.png", + "size": 122374 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Soft_Splotches.png", + "size": 76745 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Silver_Sheet.mdl@Silver_Sheet_Splotchy_Streaks.png", + "size": 75655 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Solder_Paste.mdl.png", + "size": 95378 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Solder_Paste.mdl@Solder_Paste.png", + "size": 95378 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Solder_Paste.mdl@Solder_Paste_Bumpy.png", + "size": 111487 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Solder_Paste.mdl@Solder_Paste_Dull.png", + "size": 80849 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Solder_Paste.mdl@Solder_Paste_Fresh.png", + "size": 98196 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel.mdl.png", + "size": 74175 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel.mdl@Stainless_Steel.png", + "size": 74175 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel.mdl@Stainless_Steel_Glossy.png", + "size": 74868 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel.mdl@Stainless_Steel_Matte.png", + "size": 73265 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel.mdl@Stainless_Steel_Shiny_Smudged.png", + "size": 79359 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel.mdl@Stainless_Steel_Shiny_Worn.png", + "size": 86751 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl.png", + "size": 80069 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed.png", + "size": 80069 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched.png", + "size": 168705 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Cross.png", + "size": 131939 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Cross_Special.png", + "size": 136922 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Hexagonal.png", + "size": 164995 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Hexagonal_Small.png", + "size": 137029 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Line.png", + "size": 111796 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Rhombus.png", + "size": 143519 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Small_Circular.png", + "size": 114806 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Square.png", + "size": 119919 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Star.png", + "size": 122479 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Stainless_Steel_Brushed_Punched_Triangle.png", + "size": 121719 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Steel_Brushed_Clean_Polished.png", + "size": 76464 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Steel_Brushed_Matte_Brushing.png", + "size": 79018 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Steel_Brushed_Medium_Brushing.png", + "size": 79019 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed.mdl@Steel_Brushed_Worn.png", + "size": 86892 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl.png", + "size": 80071 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched.png", + "size": 80071 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_.png", + "size": 164368 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Cross.png", + "size": 150805 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Cross_Special.png", + "size": 152181 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Hexagonal.png", + "size": 164994 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Hexagonal_Small.png", + "size": 137031 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Line.png", + "size": 121611 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Rhombus.png", + "size": 154957 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Small_Circular.png", + "size": 124285 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Square.png", + "size": 119918 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Star.png", + "size": 133138 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Brushed_Punched.mdl@Stainless_Steel_Brushed_Punched_Triangle.png", + "size": 133213 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Milled.mdl.png", + "size": 91197 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Milled.mdl@Stainless_Steel_Milled.png", + "size": 91197 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Milled.mdl@Stainless_Steel_Milled_Worn.png", + "size": 95082 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl.png", + "size": 74171 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched.png", + "size": 74171 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_.png", + "size": 170101 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Cross.png", + "size": 153963 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Hexagonal.png", + "size": 166899 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Hexagonal_Small.png", + "size": 139036 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Line.png", + "size": 122655 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Rhombus.png", + "size": 158137 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Small_Circular.png", + "size": 126305 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Square.png", + "size": 120259 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Star.png", + "size": 135827 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Stainless_Steel_Punched.mdl@Stainless_Steel_Punched_Triangle.png", + "size": 134268 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl.png", + "size": 79272 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon.png", + "size": 79272 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_High_Glossy.png", + "size": 78785 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_High_Matte.png", + "size": 78458 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_High_Shiny.png", + "size": 80657 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Low_Bright_Rust.png", + "size": 108188 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Low_Directional_Imperfections.png", + "size": 83946 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Low_Directional_Rust.png", + "size": 103876 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Low_Heavy_Rust.png", + "size": 115585 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Low_Matte.png", + "size": 85841 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Low_Medium_Rust.png", + "size": 104960 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Medium_Glossy.png", + "size": 78756 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Medium_Matte.png", + "size": 85222 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Carbon.mdl@Steel_Carbon_Medium_Shiny.png", + "size": 80265 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Galvanized.mdl.png", + "size": 90445 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Galvanized.mdl@Steel_Galvanized.png", + "size": 90445 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Galvanized.mdl@Steel_Galvanized_Oxidized.png", + "size": 85226 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Galvanized.mdl@Steel_Galvanized_Rough_Crystals.png", + "size": 89806 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl.png", + "size": 78622 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted.png", + "size": 78622 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Arcadia_Green.png", + "size": 73513 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Army_Green.png", + "size": 72555 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Black.png", + "size": 67696 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Dark_Blue.png", + "size": 73800 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Dark_Brown.png", + "size": 71669 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Dark_Gray.png", + "size": 72112 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Gray.png", + "size": 73261 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Heavy_Dirt.png", + "size": 96356 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Khaki.png", + "size": 73899 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Light_Blue_Weathered.png", + "size": 88991 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Orange.png", + "size": 78055 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Russet_Matte.png", + "size": 77765 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_White.png", + "size": 73936 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Yellow_Damaged.png", + "size": 90380 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Yellow_Dirty.png", + "size": 96422 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Yellow_Overpainted.png", + "size": 86125 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Yellow_Paint_Strokes.png", + "size": 87722 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted.mdl@Steel_Painted_Yellow_Slightly_Weathered.png", + "size": 91712 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl.png", + "size": 101724 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl@Steel_Painted_Army_Green_Cracked_Dirty.png", + "size": 106427 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl@Steel_Painted_Cracked.png", + "size": 101724 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl@Steel_Painted_Light_Blue_Cracked_Matte.png", + "size": 120054 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl@Steel_Painted_Orange_Cracked_Worn.png", + "size": 112077 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl@Steel_Painted_Red_Cracked_Matte.png", + "size": 111239 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl@Steel_Painted_Russet_Cracked_Dirty.png", + "size": 111733 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl@Steel_Painted_Turquise_Cracked_Shiny.png", + "size": 120207 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Steel_Painted_Cracked.mdl@Steel_Painted_Yellow_Cracked_Bleached.png", + "size": 112266 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium.mdl.png", + "size": 77016 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium.mdl@Titanium.png", + "size": 77016 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium.mdl@Titanium_Glossy_Fingerprints.png", + "size": 82561 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium.mdl@Titanium_Polished.png", + "size": 74165 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Brushed.mdl.png", + "size": 86685 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Brushed.mdl@Titanium_Brushed.png", + "size": 86685 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Brushed.mdl@Titanium_Brushed_Light_Brushing.png", + "size": 83177 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Brushed.mdl@Titanium_Brushed_Medium_Brushing.png", + "size": 88017 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Brushed.mdl@Titanium_Brushed_Medium_Light_Brushing.png", + "size": 86800 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Brushed.mdl@Titanium_Brushed_Very_Strong_Brushing.png", + "size": 91836 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Foil.mdl.png", + "size": 81600 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Foil.mdl@Titanium_Foil.png", + "size": 81600 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Foil.mdl@Titanium_Foil_Heavy_Glossy_Wrinkles.png", + "size": 116036 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Foil.mdl@Titanium_Foil_Heavy_Matte_Wrinkled.png", + "size": 104277 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Foil.mdl@Titanium_Foil_Matte_Wrinkled.png", + "size": 91229 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Foil.mdl@Titanium_Foil_Shiny_Wrinkled.png", + "size": 95281 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Foil.mdl@Titanium_Foil_Smudged_Foil.png", + "size": 81873 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Hammered.mdl.png", + "size": 105792 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Hammered.mdl@Titanium_Hammered.png", + "size": 105792 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Hammered.mdl@Titanium_Hammered_Dull.png", + "size": 101049 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Hammered.mdl@Titanium_Hammered_Shiny.png", + "size": 97801 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Knurling.mdl.png", + "size": 110755 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Knurling.mdl@Titanium_Knurling.png", + "size": 110755 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Knurling.mdl@Titanium_Knurling_Worn.png", + "size": 106900 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Scratched.mdl.png", + "size": 101703 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Scratched.mdl@Titanium_Scratched.png", + "size": 101703 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Scratched.mdl@Titanium_Scratched_Dark_Matte.png", + "size": 96961 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Scratched.mdl@Titanium_Scratched_Dark_Shiny.png", + "size": 98355 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Scratched.mdl@Titanium_Scratched_Dirty_Rough.png", + "size": 102574 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Scratched.mdl@Titanium_Scratched_Light_Bumpy.png", + "size": 104613 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Scratched.mdl@Titanium_Scratched_Scuffs_and_Grime.png", + "size": 101459 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl.png", + "size": 75807 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet.png", + "size": 75807 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Glossy_Imperfections.png", + "size": 74343 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Glossy_Streaks.png", + "size": 82474 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Matte_Imperfections.png", + "size": 76669 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched.png", + "size": 165447 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Cross.png", + "size": 133023 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Hexagonal.png", + "size": 167276 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Hexagonal_Small.png", + "size": 138353 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Line.png", + "size": 111835 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Rhombus.png", + "size": 146121 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Small_Circular.png", + "size": 114120 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Square.png", + "size": 119952 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Star.png", + "size": 122847 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Punched_Triangle.png", + "size": 122244 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Soft_Splotches.png", + "size": 76387 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Titanium_Sheet.mdl@Titanium_Sheet_Splotchy_Streaks.png", + "size": 76913 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten.mdl.png", + "size": 78007 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten.mdl@Tungsten.png", + "size": 78007 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten.mdl@Tungsten_Glossy_Fingerprints.png", + "size": 83177 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten.mdl@Tungsten_Polished.png", + "size": 75452 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Brushed.mdl.png", + "size": 86357 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Brushed.mdl@Tungsten_Brushed.png", + "size": 86357 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Brushed.mdl@Tungsten_Brushed_Light_Brushing.png", + "size": 83944 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Brushed.mdl@Tungsten_Brushed_Medium_Brushing.png", + "size": 88606 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Brushed.mdl@Tungsten_Brushed_Medium_Light_Brushing.png", + "size": 87105 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Brushed.mdl@Tungsten_Brushed_Very_Strong_Brushing.png", + "size": 92652 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Foil.mdl.png", + "size": 82587 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Foil.mdl@Tungsten_Foil.png", + "size": 82587 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Foil.mdl@Tungsten_Foil_Heavy_Glossy_Wrinkles.png", + "size": 118253 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Foil.mdl@Tungsten_Foil_Heavy_Matte_Wrinkled.png", + "size": 104327 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Foil.mdl@Tungsten_Foil_Matte_Wrinkled.png", + "size": 90044 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Foil.mdl@Tungsten_Foil_Shiny_Wrinkled.png", + "size": 96010 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Foil.mdl@Tungsten_Foil_Smudged_Foil.png", + "size": 82701 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Hammered.mdl.png", + "size": 110022 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Hammered.mdl@Tungsten_Hammered.png", + "size": 110022 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Hammered.mdl@Tungsten_Hammered_Dull.png", + "size": 103679 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Hammered.mdl@Tungsten_Hammered_Shiny.png", + "size": 98743 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Knurling.mdl.png", + "size": 113719 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Knurling.mdl@Tungsten_Knurling.png", + "size": 113719 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Knurling.mdl@Tungsten_Knurling_Worn.png", + "size": 110368 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Scratched.mdl.png", + "size": 103270 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Scratched.mdl@Tungsten_Scratched.png", + "size": 103270 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Scratched.mdl@Tungsten_Scratched_Dark_Matte.png", + "size": 99699 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Scratched.mdl@Tungsten_Scratched_Dark_Shiny.png", + "size": 100856 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Scratched.mdl@Tungsten_Scratched_Dirty_Rough.png", + "size": 105249 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Scratched.mdl@Tungsten_Scratched_Light_Bumpy.png", + "size": 105746 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Scratched.mdl@Tungsten_Scratched_Scuffs_and_Grime.png", + "size": 104963 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl.png", + "size": 77158 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet.png", + "size": 77158 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Glossy_Imperfections.png", + "size": 74878 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Glossy_Streaks.png", + "size": 82928 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Matte_Imperfections.png", + "size": 75862 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched.png", + "size": 170153 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Cross.png", + "size": 136488 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Hexagonal.png", + "size": 171530 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Hexagonal_Small.png", + "size": 143678 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Line.png", + "size": 115283 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Rhombus.png", + "size": 149784 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Small_Circular.png", + "size": 119430 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Square.png", + "size": 123981 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Star.png", + "size": 127886 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Punched_Triangle.png", + "size": 126591 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Soft_Splotches.png", + "size": 76866 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Tungsten_Sheet.mdl@Tungsten_Sheet_Splotchy_Streaks.png", + "size": 76269 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc.mdl.png", + "size": 77476 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc.mdl@Zinc.png", + "size": 77476 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc.mdl@Zinc_Glossy_Fingerprints.png", + "size": 82148 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc.mdl@Zinc_Polished.png", + "size": 74954 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Brushed.mdl.png", + "size": 85827 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Brushed.mdl@Zinc_Brushed.png", + "size": 85827 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Brushed.mdl@Zinc_Brushed_Light_Brushing.png", + "size": 83471 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Brushed.mdl@Zinc_Brushed_Medium_Brushing.png", + "size": 88221 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Brushed.mdl@Zinc_Brushed_Medium_Light_Brushing.png", + "size": 86904 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Brushed.mdl@Zinc_Brushed_Very_Strong_Brushing.png", + "size": 92428 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Foil.mdl.png", + "size": 81865 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Foil.mdl@Zinc_Foil.png", + "size": 81865 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Foil.mdl@Zinc_Foil_Heavy_Glossy_Wrinkles.png", + "size": 116393 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Foil.mdl@Zinc_Foil_Heavy_Matte_Wrinkled.png", + "size": 103320 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Foil.mdl@Zinc_Foil_Matte_Wrinkled.png", + "size": 89451 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Foil.mdl@Zinc_Foil_Shiny_Wrinkled.png", + "size": 94272 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Foil.mdl@Zinc_Foil_Smudged_Foil.png", + "size": 81615 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Galvanizing.mdl.png", + "size": 93147 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Galvanizing.mdl@Zinc_Dirty_Rough_Oxidized.png", + "size": 103520 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Galvanizing.mdl@Zinc_Galvanizing.png", + "size": 93147 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Galvanizing.mdl@Zinc_Rough_Crystals.png", + "size": 92490 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Galvanizing.mdl@Zinc_Rough_Heavy_Shiny_Oxidized.png", + "size": 98684 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Galvanizing.mdl@Zinc_Rough_Medium_Oxidized.png", + "size": 92489 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Hammered.mdl.png", + "size": 105780 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Hammered.mdl@Zinc_Hammered.png", + "size": 105780 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Hammered.mdl@Zinc_Hammered_Dull.png", + "size": 100602 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Hammered.mdl@Zinc_Hammered_Shiny.png", + "size": 96972 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Knurling.mdl.png", + "size": 113348 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Knurling.mdl@Zinc_Knurling.png", + "size": 113348 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Knurling.mdl@Zinc_Knurling_Worn.png", + "size": 109921 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Scratched.mdl.png", + "size": 102482 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Scratched.mdl@Zinc_Scratched.png", + "size": 102482 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Scratched.mdl@Zinc_Scratched_Dark_Matte.png", + "size": 99792 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Scratched.mdl@Zinc_Scratched_Dark_Shiny.png", + "size": 100291 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Scratched.mdl@Zinc_Scratched_Dirty_Rough.png", + "size": 105517 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Scratched.mdl@Zinc_Scratched_Light_Bumpy.png", + "size": 104931 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Scratched.mdl@Zinc_Scratched_Scuffs_and_Grime.png", + "size": 104937 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl.png", + "size": 76768 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet.png", + "size": 76768 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Glossy_Imperfections.png", + "size": 74291 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Glossy_Streaks.png", + "size": 82956 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Matte_Imperfections.png", + "size": 75702 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched.png", + "size": 168525 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Cross.png", + "size": 134205 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Hexagonal.png", + "size": 169330 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Hexagonal_Small.png", + "size": 136289 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Line.png", + "size": 114192 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Rhombus.png", + "size": 145931 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Small_Circular.png", + "size": 115151 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Square.png", + "size": 121663 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Star.png", + "size": 121866 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Punched_Triangle.png", + "size": 123025 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Soft_Splotches.png", + "size": 76718 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/256x256/Zinc_Sheet.mdl@Zinc_Sheet_Splotchy_Streaks.png", + "size": 76090 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper.png", + "size": 101812 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_10_of_12.png", + "size": 111588 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_11_of_12.png", + "size": 107529 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_12_of_12.png", + "size": 98352 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_2_of_12.png", + "size": 106845 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_3_of_12.png", + "size": 89141 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_4_of_12.png", + "size": 88098 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_5_of_12.png", + "size": 78583 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_6_of_12.png", + "size": 73860 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_7_of_12.png", + "size": 91035 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_8_of_12.png", + "size": 91942 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aging_Copper.Aging_Copper_State_9_of_12.png", + "size": 110844 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum.Aluminum.png", + "size": 98068 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum.Aluminum_Glossy_Fingerprints.png", + "size": 95514 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum.Aluminum_Polished.png", + "size": 100122 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized.png", + "size": 97853 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Coated.png", + "size": 108966 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Dirty.png", + "size": 110573 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Scratched.png", + "size": 108970 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Shiny.png", + "size": 98029 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Smudges.png", + "size": 110540 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Gold.png", + "size": 96179 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Grass_Green.png", + "size": 91878 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Lavender.png", + "size": 100822 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Light_Gold.png", + "size": 101483 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Lime_Green.png", + "size": 96731 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Orange.png", + "size": 97143 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Pink.png", + "size": 100574 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Purple.png", + "size": 97242 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Red.png", + "size": 93168 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Rose.png", + "size": 102497 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Royal_Blue.png", + "size": 92781 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Silver.png", + "size": 98455 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Sky_Blue.png", + "size": 98248 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Turquoise.png", + "size": 97004 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Anodized.Aluminum_Anodized_Yellow.png", + "size": 98059 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Brushed.Aluminum_Brushed.png", + "size": 95904 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Brushed.Aluminum_Brushed_Light_Brushing.png", + "size": 97642 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Brushed.Aluminum_Brushed_Medium_Brushing.png", + "size": 96226 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Brushed.Aluminum_Brushed_Medium_Light_Brushing.png", + "size": 97035 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Brushed.Aluminum_Brushed_Very_Strong_Brushing.png", + "size": 96863 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Foil.Aluminum_Foil.png", + "size": 97262 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Foil.Aluminum_Foil_Heavy_Glossy_Wrinkles.png", + "size": 127924 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Foil.Aluminum_Foil_Heavy_Matte_Wrinkled.png", + "size": 111526 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Foil.Aluminum_Foil_Matte_Wrinkled.png", + "size": 97154 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Foil.Aluminum_Foil_Shiny_Wrinkled.png", + "size": 103475 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Foil.Aluminum_Foil_Smudged_Foil.png", + "size": 95657 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Hammered.Aluminum_Hammered.png", + "size": 109552 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Hammered.Aluminum_Hammered_Dull.png", + "size": 102515 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Hammered.Aluminum_Hammered_Shiny.png", + "size": 102065 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Knurling.Aluminum_Knurling.png", + "size": 117814 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Knurling.Aluminum_Knurling_Worn.png", + "size": 113669 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Scratched.Aluminum_Scratched.png", + "size": 108219 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Scratched.Aluminum_Scratched_Dark_Matte.png", + "size": 97234 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Scratched.Aluminum_Scratched_Dark_Shiny.png", + "size": 104821 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Scratched.Aluminum_Scratched_Dirty_Rough.png", + "size": 98598 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Scratched.Aluminum_Scratched_Light_Bumpy.png", + "size": 109168 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Scratched.Aluminum_Scratched_Scuffs_and_Grime.png", + "size": 102298 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet.png", + "size": 97499 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Glossy_Imperfections.png", + "size": 94749 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Glossy_Streaks.png", + "size": 97625 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Matte_Imperfections.png", + "size": 92649 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched.png", + "size": 130665 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Cross.png", + "size": 132777 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Hexagonal.png", + "size": 140144 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Hexagonal_Small.png", + "size": 131949 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Line.png", + "size": 123612 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Rhombus.png", + "size": 135644 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Small_Circular.png", + "size": 125499 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Square.png", + "size": 129052 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Star.png", + "size": 127047 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Triangle.png", + "size": 129895 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Soft_Splotches.png", + "size": 95095 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Aluminum_Sheet.Aluminum_Sheet_Splotchy_Streaks.png", + "size": 92949 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Blued_Steel_Cold.Blued_Steel_Cold.png", + "size": 80449 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Blued_Steel_Cold.Blued_Steel_Cold_Matte.png", + "size": 75450 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Blued_Steel_Cold.Blued_Steel_Cold_Matte_Smudged.png", + "size": 77862 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Blued_Steel_Cold.Blued_Steel_Cold_Worn.png", + "size": 85291 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass.png", + "size": 96137 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Gold_New.png", + "size": 96843 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Gold_New_Stained.png", + "size": 92971 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Gold_Rough_Worn.png", + "size": 86892 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Gold_Shiny_Handled.png", + "size": 93369 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Gold_Worn.png", + "size": 90094 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Red_New.png", + "size": 97782 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Red_New_Stained.png", + "size": 93840 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Red_Rough_Worn.png", + "size": 87660 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Red_Shiny_Handled.png", + "size": 94250 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Red_Worn.png", + "size": 90990 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Yellow_New_Stained.png", + "size": 92312 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Yellow_Rough_Worn.png", + "size": 86623 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Yellow_Shiny_Handled.png", + "size": 92667 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass.Brass_Yellow_Worn.png", + "size": 89523 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Antique.Brass_Antique.png", + "size": 97022 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Antique.Brass_Antique_Matte_Dirty.png", + "size": 94674 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Antique.Brass_Antique_Shiny_Stained.png", + "size": 95868 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed.png", + "size": 99504 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Gold_Dirty_Medium.png", + "size": 105593 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Gold_Fine.png", + "size": 104815 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Gold_Medium.png", + "size": 105602 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Gold_Smooth_Subtle.png", + "size": 99279 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Gold_Strong.png", + "size": 100763 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Red_Dirty_Medium.png", + "size": 107842 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Red_Fine.png", + "size": 107120 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Red_Medium.png", + "size": 107834 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Red_Smooth_Subtle.png", + "size": 101060 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Red_Strong.png", + "size": 102735 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Yellow_Dirty_Medium.png", + "size": 106057 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Yellow_Fine.png", + "size": 105337 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Yellow_Medium.png", + "size": 106060 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Brushed.Brass_Brushed_Yellow_Strong.png", + "size": 101310 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil.png", + "size": 94781 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Gold_Flat_Smudged.png", + "size": 120278 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Gold_Heavy_Wrinkles.png", + "size": 95471 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Gold_Matte_Wrinkled.png", + "size": 105329 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Gold_Shiny_Wrinkled.png", + "size": 102794 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Gold_Slightly_Wrinkled.png", + "size": 96392 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Red_Flat_Smudged.png", + "size": 120284 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Red_Heavy_Wrinkles.png", + "size": 95466 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Red_Matte_Wrinkled.png", + "size": 105329 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Red_Shiny_Wrinkled.png", + "size": 102781 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Red_Slightly_Wrinkled.png", + "size": 96392 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Yellow_Heavy_Wrinkles.png", + "size": 118997 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Yellow_Matte_Wrinkled.png", + "size": 104262 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Yellow_Shiny_Wrinkled.png", + "size": 101899 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Foil.Brass_Foil_Yellow_Slightly_Wrinkled.png", + "size": 95737 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered.png", + "size": 112517 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered_Gold_Hammered_Darkened.png", + "size": 113616 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered_Gold_Matte_Hammering.png", + "size": 112370 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered_Gold_Shiny_Soft_Hammering.png", + "size": 103254 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered_Red_Hammered_Darkened.png", + "size": 113619 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered_Red_Matte_Hammering.png", + "size": 112374 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered_Red_Shiny_Soft_Hammering.png", + "size": 103257 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered_Yellow_Matte_Hammering.png", + "size": 111253 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Hammered.Brass_Hammered_Yellow_Shiny_Soft_Hammering.png", + "size": 102488 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Knurling.Brass_Knurling.png", + "size": 104109 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Knurling.Brass_Knurling_Gold.png", + "size": 103136 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Knurling.Brass_Knurling_Gold_Rough_Dirty.png", + "size": 95364 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Knurling.Brass_Knurling_Red.png", + "size": 105338 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Knurling.Brass_Knurling_Red_Rough_Dirty.png", + "size": 97453 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Knurling.Brass_Knurling_Yellow_Rough_Dirty.png", + "size": 96327 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished.png", + "size": 99617 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Gold_Cloudy_Polish.png", + "size": 98337 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Gold_Matte_Polish.png", + "size": 99554 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Gold_Shiny_Polish.png", + "size": 96371 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Gold_Shiny_Worn.png", + "size": 96372 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Red_Cloudy_Polish.png", + "size": 98340 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Red_Matte_Polish.png", + "size": 99550 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Red_Shiny_Polish.png", + "size": 96369 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Red_Shiny_Worn.png", + "size": 96372 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Yellow_Cloudy_Polish.png", + "size": 98325 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Yellow_Matte_Polish.png", + "size": 99554 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Polished.Brass_Polished_Yellow_Shiny_Worn.png", + "size": 96372 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched.png", + "size": 99641 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Gold_Heavy_Worn_Scratches.png", + "size": 103591 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Gold_Medium_Glossy_Deep_Scratches.png", + "size": 108305 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Gold_Medium_Glossy_Scratches.png", + "size": 106056 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Gold_Polished_Subtle_Dark_Scratches.png", + "size": 103594 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Gold_Subtle_Worn_Scratches.png", + "size": 97635 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Red_Heavy_Worn_Scratches.png", + "size": 104798 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Red_Medium_Glossy_Deep_Scratches.png", + "size": 109256 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Red_Medium_Glossy_Scratches.png", + "size": 106998 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Red_Polished_Subtle_Dark_Scratches.png", + "size": 104799 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Red_Subtle_Worn_Scratches.png", + "size": 98874 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Yellow_Heavy_Worn_Scratches.png", + "size": 104116 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Yellow_Medium_Glossy_Deep_Scratches.png", + "size": 108731 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Yellow_Medium_Glossy_Scratches.png", + "size": 106572 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Scratched.Brass_Scratched_Yellow_Subtle_Worn_Scratches.png", + "size": 97032 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet.png", + "size": 98782 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Gold_Glossy_Imperfections.png", + "size": 97360 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Gold_Matte_Imperfections.png", + "size": 95284 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Gold_New_Clean.png", + "size": 98480 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Gold_Soft_Splotches.png", + "size": 95274 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Gold_Splotchy_Streaks.png", + "size": 96511 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Red_Glossy_Imperfections.png", + "size": 98607 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Red_Matte_Imperfections.png", + "size": 96544 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Red_New_Clean.png", + "size": 99637 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Red_Soft_Splotches.png", + "size": 96471 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Red_Splotchy_Streaks.png", + "size": 97861 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Yellow_Glossy_Imperfections.png", + "size": 97312 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Yellow_Matte_Imperfections.png", + "size": 94980 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Yellow_Soft_Splotches.png", + "size": 95347 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Brass_Sheet.Brass_Sheet_Yellow_Splotchy_Streaks.png", + "size": 96447 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze.png", + "size": 100924 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_New.png", + "size": 98582 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_New_Stained.png", + "size": 95280 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Red_New.png", + "size": 101953 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Red_New_Stained.png", + "size": 95228 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Red_Rough_Worn.png", + "size": 89004 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Red_Shiny_Handled.png", + "size": 96077 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Red_Worn.png", + "size": 91483 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Rough_Worn.png", + "size": 88863 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Shiny_Handled.png", + "size": 95572 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Worn.png", + "size": 92669 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Yellow_New_Stained.png", + "size": 97844 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Yellow_Rough_Worn.png", + "size": 91262 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Yellow_Shiny_Handled.png", + "size": 98238 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze.Bronze_Yellow_Worn.png", + "size": 95566 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Antique.Bronze_Antique.png", + "size": 108932 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Antique.Bronze_Antique_Matte_Dirty.png", + "size": 103326 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Antique.Bronze_Antique_Shiny_Stained.png", + "size": 109685 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Brushed.Bronze_Brushed.png", + "size": 95478 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Brushed.Bronze_Brushed_Yellow_Dirty_Medium.png", + "size": 102944 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Brushed.Bronze_Brushed_Yellow_Fine.png", + "size": 101614 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Brushed.Bronze_Brushed_Yellow_Medium.png", + "size": 102947 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Brushed.Bronze_Brushed_Yellow_Strong.png", + "size": 99286 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Foil.Bronze_Foil.png", + "size": 97945 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Foil.Bronze_Foil_Heavy_Wrinkles.png", + "size": 112724 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Foil.Bronze_Foil_Matte_Wrinkled.png", + "size": 107496 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Foil.Bronze_Foil_Shiny_Wrinkled.png", + "size": 104844 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Foil.Bronze_Foil_Slightly_Wrinkled.png", + "size": 98701 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Hammered.Bronze_Hammered.png", + "size": 116067 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Hammered.Bronze_Hammered_Matte_Hammering.png", + "size": 114841 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Hammered.Bronze_Hammered_Shiny_Soft_Hammering.png", + "size": 105055 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Knurling.Bronze_Knurling.png", + "size": 129265 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Knurling.Bronze_Knurling_Rough_Dirty.png", + "size": 114742 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Polished.Bronze_Polished.png", + "size": 100813 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Polished.Bronze_Polished_Cloudy_Polish.png", + "size": 99810 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Polished.Bronze_Polished_Matte_Polish.png", + "size": 100571 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Polished.Bronze_Polished_Shiny_Worn.png", + "size": 98738 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Scratched.Bronze_Scratched.png", + "size": 102181 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Scratched.Bronze_Scratched_Yellow_Heavy_Worn_Scratches.png", + "size": 104523 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Scratched.Bronze_Scratched_Yellow_Medium_Glossy_Deep_Scratches.png", + "size": 109210 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Scratched.Bronze_Scratched_Yellow_Medium_Glossy_Scratches.png", + "size": 106568 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Scratched.Bronze_Scratched_Yellow_Subtle_Worn_Scratches.png", + "size": 99959 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet.Bronze_Sheet.png", + "size": 95736 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet.Bronze_Sheet_Glossy_Imperfections.png", + "size": 93759 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet.Bronze_Sheet_Matte_Imperfections.png", + "size": 92562 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet.Bronze_Sheet_Soft_Splotches.png", + "size": 91939 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet.Bronze_Sheet_Splotchy_Streaks.png", + "size": 93618 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched.png", + "size": 98767 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_.png", + "size": 135962 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Cross.png", + "size": 135146 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Hexagonal.png", + "size": 149117 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Hexagonal_Small.png", + "size": 132838 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Line.png", + "size": 122880 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Rhombus.png", + "size": 139807 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Small_Circular.png", + "size": 124246 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Square.png", + "size": 129142 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Star.png", + "size": 126543 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Triangle.png", + "size": 129817 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chrome_Hammered.Chrome_Hammered.png", + "size": 104206 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium.Chromium.png", + "size": 98345 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium.Chromium_Glossy_Fingerprints.png", + "size": 96213 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium.Chromium_Polished.png", + "size": 100583 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Brushed.Chromium_Brushed.png", + "size": 93749 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Brushed.Chromium_Brushed_Light_Brushing.png", + "size": 96183 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Brushed.Chromium_Brushed_Medium_Brushing.png", + "size": 93594 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Brushed.Chromium_Brushed_Medium_Light_Brushing.png", + "size": 94917 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Brushed.Chromium_Brushed_Very_Strong_Brushing.png", + "size": 92437 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Foil.Chromium_Foil.png", + "size": 98296 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Foil.Chromium_Foil_Heavy_Glossy_Wrinkles.png", + "size": 126834 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Foil.Chromium_Foil_Heavy_Matte_Wrinkled.png", + "size": 110558 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Foil.Chromium_Foil_Matte_Wrinkled.png", + "size": 98674 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Foil.Chromium_Foil_Shiny_Wrinkled.png", + "size": 105297 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Foil.Chromium_Foil_Smudged_Foil.png", + "size": 96538 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Knurling.Chromium_Knurling.png", + "size": 109972 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Knurling.Chromium_Knurling_Worn.png", + "size": 104507 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Scratched.Chromium_Scratched.png", + "size": 102211 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Scratched.Chromium_Scratched_Dark_Matte.png", + "size": 89988 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Scratched.Chromium_Scratched_Dark_Shiny.png", + "size": 99139 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Scratched.Chromium_Scratched_Dirty_Rough.png", + "size": 96151 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Scratched.Chromium_Scratched_Light_Bumpy.png", + "size": 104422 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Scratched.Chromium_Scratched_Scuffs_and_Grime.png", + "size": 94195 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet.png", + "size": 95442 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Glossy_Imperfections.png", + "size": 94400 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Glossy_Streaks.png", + "size": 95813 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Matte_Imperfections.png", + "size": 92352 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched.png", + "size": 129460 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Circular_Small.png", + "size": 120884 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Cross.png", + "size": 130642 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Hexagonal.png", + "size": 140077 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Hexagonal_Small.png", + "size": 128475 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Line.png", + "size": 121062 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Rhombus.png", + "size": 133731 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Square.png", + "size": 126218 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Star.png", + "size": 124292 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Triangle.png", + "size": 127105 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Soft_Splotches.png", + "size": 93001 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Chromium_Sheet.Chromium_Sheet_Splotchy_Streaks.png", + "size": 93035 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper.Copper.png", + "size": 100929 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper.Copper_Glossy_Fingerprints.png", + "size": 98624 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper.Copper_Polished.png", + "size": 102958 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Brushed_Antique_Copper.png", + "size": 98917 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Brushed_Antique_Copper_Decayed_Matte.png", + "size": 99737 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Brushed_Antique_Copper_Shiny.png", + "size": 99525 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Brushed_Antique_Copper_Shiny_Matte_Smudged.png", + "size": 93904 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Brushed_Antique_Copper_Shiny_Smudged.png", + "size": 101710 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Brushed_Antique_Copper_Worn_Matte.png", + "size": 100546 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed.png", + "size": 98927 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Decayed_Matte.png", + "size": 99741 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Shiny.png", + "size": 99547 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Shiny_Matte_Smudged.png", + "size": 93909 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Shiny_Smudged.png", + "size": 101711 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Worn_Matte.png", + "size": 100546 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Crusted_Patina.png", + "size": 91018 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Medium_Patina.png", + "size": 102141 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Minimal_Patina.png", + "size": 99451 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Patinated.png", + "size": 98732 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Pure_Patina.png", + "size": 89832 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Slight_Patina.png", + "size": 103191 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Slight_Patina_Spots.png", + "size": 107132 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Strong_Patina.png", + "size": 97176 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Very_Strong_Patina.png", + "size": 91276 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Brushed.Copper_Brushed.png", + "size": 97254 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Brushed.Copper_Brushed_Light_Brushing.png", + "size": 99039 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Brushed.Copper_Brushed_Medium_Brushing.png", + "size": 96854 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Brushed.Copper_Brushed_Medium_Light_Brushing.png", + "size": 97945 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Brushed.Copper_Brushed_Very_Strong_Brushing.png", + "size": 96242 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Foil.Copper_Foil.png", + "size": 100798 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Foil.Copper_Foil_Heavy_Glossy_Wrinkles.png", + "size": 128856 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Foil.Copper_Foil_Heavy_Matte_Wrinkled.png", + "size": 113103 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Foil.Copper_Foil_Matte_Wrinkled.png", + "size": 101213 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Foil.Copper_Foil_Shiny_Wrinkled.png", + "size": 107242 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Foil.Copper_Foil_Smudged_Foil.png", + "size": 98937 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Hammered.Copper_Hammered.png", + "size": 109579 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Hammered.Copper_Hammered_Dull.png", + "size": 102510 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Hammered.Copper_Hammered_Shiny.png", + "size": 102079 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Knurling.Copper_Knurling.png", + "size": 114465 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Knurling.Copper_Knurling_Worn.png", + "size": 110272 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Scratched.Copper_Scratched.png", + "size": 106213 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Scratched.Copper_Scratched_Dark_Matte.png", + "size": 94352 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Scratched.Copper_Scratched_Dark_Shiny.png", + "size": 102781 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Scratched.Copper_Scratched_Dirty_Rough.png", + "size": 100420 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Scratched.Copper_Scratched_Light_Bumpy.png", + "size": 108250 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Scratched.Copper_Scratched_Scuffs_and_Grime.png", + "size": 98805 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet.png", + "size": 98431 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Glossy_Imperfections.png", + "size": 97055 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Glossy_Streaks.png", + "size": 98708 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Matte_Imperfections.png", + "size": 95265 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched.png", + "size": 137773 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Circular_Small.png", + "size": 127448 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Cross.png", + "size": 138886 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Hexagonal.png", + "size": 150480 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Hexagonal_Small.png", + "size": 137353 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Line.png", + "size": 127127 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Rhombus.png", + "size": 142858 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Square.png", + "size": 133430 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Star.png", + "size": 131452 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Punched_Triangle.png", + "size": 134361 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Soft_Splotches.png", + "size": 96022 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Copper_Sheet.Copper_Sheet_Splotchy_Streaks.png", + "size": 95652 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear.png", + "size": 118025 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear_Dirty_Worn.png", + "size": 120190 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear_Glossy.png", + "size": 112779 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear_Matte_Aged.png", + "size": 104687 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear_Shiny_Tops.png", + "size": 116942 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Doubletear.Diamond_Plate_Double_Tear.png", + "size": 118024 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Doubletear.Diamond_Plate_Double_Tear_Dirty_Worn.png", + "size": 120019 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Doubletear.Diamond_Plate_Double_Tear_Glossy.png", + "size": 112357 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Doubletear.Diamond_Plate_Double_Tear_Matte_Aged.png", + "size": 104774 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Doubletear.Diamond_Plate_Double_Tear_Shiny_Tops.png", + "size": 116655 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear.png", + "size": 119098 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear_Dirty_Worn.png", + "size": 121090 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear_Glossy.png", + "size": 113755 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear_Matte_Aged.png", + "size": 106177 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear_Shiny_Tops.png", + "size": 117850 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear.png", + "size": 123191 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Dirty_Worn.png", + "size": 122141 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Glossy.png", + "size": 116799 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Matte_Aged.png", + "size": 108248 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Shiny_Tops.png", + "size": 119726 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear.png", + "size": 106475 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear_Dirty_Worn.png", + "size": 114493 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear_Glossy.png", + "size": 103850 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear_Matte_Aged.png", + "size": 99273 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear_Shiny_Tops.png", + "size": 106647 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Singletear.Diamond_Plate_Singletear.png", + "size": 106351 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Singletear.Diamond_Plate_Singletear_Dirty_Worn.png", + "size": 114542 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Singletear.Diamond_Plate_Singletear_Glossy.png", + "size": 104236 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Singletear.Diamond_Plate_Singletear_Matte_Aged.png", + "size": 99173 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Singletear.Diamond_Plate_Singletear_Shiny_Tops.png", + "size": 106402 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike.png", + "size": 107933 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike_Dirty_Worn.png", + "size": 114788 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike_Glossy.png", + "size": 104796 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike_Matte_Aged.png", + "size": 100080 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike_Shiny_Tops.png", + "size": 107232 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear.png", + "size": 118183 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear_Dirty_Worn.png", + "size": 121297 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear_Glossy.png", + "size": 111980 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear_Matte_Aged.png", + "size": 104254 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear_Shiny_Tops.png", + "size": 115848 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold.Gold.png", + "size": 100947 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold.Gold_Glossy_Fingerprints.png", + "size": 98670 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold.Gold_Polished.png", + "size": 102980 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Brushed.Gold_Brushed.png", + "size": 96942 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Brushed.Gold_Brushed_Light_Brushing.png", + "size": 98700 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Brushed.Gold_Brushed_Medium_Brushing.png", + "size": 96386 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Brushed.Gold_Brushed_Medium_Light_Brushing.png", + "size": 97500 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Brushed.Gold_Brushed_Very_Strong_Brushing.png", + "size": 95807 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Foil.Gold_Foil.png", + "size": 101011 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Foil.Gold_Foil_Heavy_Glossy_Wrinkles.png", + "size": 128425 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Foil.Gold_Foil_Heavy_Matte_Wrinkled.png", + "size": 112485 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Foil.Gold_Foil_Matte_Wrinkled.png", + "size": 101002 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Foil.Gold_Foil_Shiny_Wrinkled.png", + "size": 107341 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Foil.Gold_Foil_Smudged_Foil.png", + "size": 99345 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Hammered.Gold_Hammered.png", + "size": 112508 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Hammered.Gold_Hammered_Dull.png", + "size": 105959 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Hammered.Gold_Hammered_Shiny.png", + "size": 105769 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Knurling.Gold_Knurling.png", + "size": 114033 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Knurling.Gold_Knurling_Worn.png", + "size": 110148 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Scratched.Gold_Scratched.png", + "size": 105530 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Scratched.Gold_Scratched_Dark_Matte.png", + "size": 94038 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Scratched.Gold_Scratched_Dark_Shiny.png", + "size": 102218 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Scratched.Gold_Scratched_Dirty_Rough.png", + "size": 100001 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Scratched.Gold_Scratched_Light_Bumpy.png", + "size": 107701 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Scratched.Gold_Scratched_Scuffs_and_Grime.png", + "size": 98010 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet.png", + "size": 98165 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Glossy_Imperfections.png", + "size": 96851 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Glossy_Streaks.png", + "size": 98288 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Matte_Imperfections.png", + "size": 94744 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched.png", + "size": 142040 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Circular_Small.png", + "size": 134642 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Cross.png", + "size": 144201 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Hexagonal.png", + "size": 154656 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Hexagonal_Small.png", + "size": 144654 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Line.png", + "size": 132683 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Rhombus.png", + "size": 148639 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Square.png", + "size": 139007 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Star.png", + "size": 137441 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Punched_Triangle.png", + "size": 140413 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Soft_Splotches.png", + "size": 95714 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Gold_Sheet.Gold_Sheet_Splotchy_Streaks.png", + "size": 95326 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron.Iron.png", + "size": 98343 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron.Iron_Glossy_Fingerprints.png", + "size": 96161 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron.Iron_Polished.png", + "size": 100341 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Brushed.Iron_Brushed.png", + "size": 93407 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Brushed.Iron_Brushed_Light_Brushing.png", + "size": 95749 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Brushed.Iron_Brushed_Medium_Brushing.png", + "size": 93258 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Brushed.Iron_Brushed_Medium_Light_Brushing.png", + "size": 94448 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Brushed.Iron_Brushed_Very_Strong_Brushing.png", + "size": 91609 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Foil.Iron_Foil.png", + "size": 98353 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Foil.Iron_Foil_Heavy_Glossy_Wrinkles.png", + "size": 126174 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Foil.Iron_Foil_Heavy_Matte_Wrinkled.png", + "size": 109918 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Foil.Iron_Foil_Matte_Wrinkled.png", + "size": 98648 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Foil.Iron_Foil_Shiny_Wrinkled.png", + "size": 105240 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Foil.Iron_Foil_Smudged_Foil.png", + "size": 96406 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Hammered.Iron_Hammered.png", + "size": 104201 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Hammered.Iron_Hammered_Dull.png", + "size": 97972 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Hammered.Iron_Hammered_Shiny.png", + "size": 98604 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Knurling.Iron_Knurling.png", + "size": 108616 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Knurling.Iron_Knurling_Worn.png", + "size": 103430 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Pitted_Steel.Iron_Pitted_Steel.png", + "size": 103279 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Pitted_Steel.light_pitted_steel.png", + "size": 103292 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Pitted_Steel.medium_pitted_steel.png", + "size": 108849 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Pitted_Steel.strong_pitted_steel.png", + "size": 113294 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Scratched.Iron_Scratched.png", + "size": 101285 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Scratched.Iron_Scratched_Dark_Matte.png", + "size": 88938 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Scratched.Iron_Scratched_Dark_Shiny.png", + "size": 98046 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Scratched.Iron_Scratched_Dirty_Rough.png", + "size": 95063 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Scratched.Iron_Scratched_Light_Bumpy.png", + "size": 103607 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Scratched.Iron_Scratched_Scuffs_and_Grime.png", + "size": 93047 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet.png", + "size": 95001 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Glossy_Imperfections.png", + "size": 94379 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Glossy_Streaks.png", + "size": 95340 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Matte_Imperfections.png", + "size": 92022 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched.png", + "size": 141355 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Cross.png", + "size": 128551 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Hexagonal.png", + "size": 139324 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Hexagonal_Small.png", + "size": 125805 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Line.png", + "size": 118608 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Rhombus.png", + "size": 132028 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Small_Circular.png", + "size": 119691 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Square.png", + "size": 123768 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Star.png", + "size": 121541 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Punched_Triangle.png", + "size": 124231 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Soft_Splotches.png", + "size": 92634 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Iron_Sheet.Iron_Sheet_Splotchy_Streaks.png", + "size": 92891 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Mercury.Mercury.png", + "size": 97240 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Aluminum_Cast_Rough.png", + "size": 94777 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Aluminum_Cast_Shiny.png", + "size": 103314 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Iron_Cast.png", + "size": 87866 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Iron_Cast_Black_Matte.png", + "size": 82535 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Metal_Cast.png", + "size": 93292 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Metal_Cast_Painted.png", + "size": 96426 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Metal_Cast_Painted_Antique_White.png", + "size": 93699 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Metal_Cast_Painted_Gray.png", + "size": 89834 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Metal_Cast_Painted_Petrol.png", + "size": 89521 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Metal_Cast_Painted_Red.png", + "size": 100575 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Metal_Cast_Painted_White.png", + "size": 91719 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Stainless_Steel_Cast_Rough.png", + "size": 98825 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Metal_Cast.Stainless_Steel_Cast_Shiny.png", + "size": 108378 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel.Nickel.png", + "size": 99356 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel.Nickel_Glossy_Fingerprints.png", + "size": 97245 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel.Nickel_Polished.png", + "size": 101495 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Brushed.Nickel_Brushed.png", + "size": 95505 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Brushed.Nickel_Brushed_Light_Brushing.png", + "size": 97354 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Brushed.Nickel_Brushed_Medium_Brushing.png", + "size": 95104 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Brushed.Nickel_Brushed_Medium_Light_Brushing.png", + "size": 96293 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Brushed.Nickel_Brushed_Very_Strong_Brushing.png", + "size": 94333 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Foil.Nickel_Foil.png", + "size": 99179 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Foil.Nickel_Foil_Heavy_Glossy_Wrinkles.png", + "size": 127904 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Foil.Nickel_Foil_Heavy_Matte_Wrinkled.png", + "size": 112009 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Foil.Nickel_Foil_Matte_Wrinkled.png", + "size": 99800 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Foil.Nickel_Foil_Shiny_Wrinkled.png", + "size": 106028 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Foil.Nickel_Foil_Smudged_Foil.png", + "size": 97478 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Hammered.Nickel_Hammered.png", + "size": 110808 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Hammered.Nickel_Hammered_Dull.png", + "size": 103920 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Hammered.Nickel_Hammered_Shiny.png", + "size": 103229 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Knurling.Nickel_Knurling.png", + "size": 112266 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Knurling.Nickel_Knurling_Worn.png", + "size": 107182 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Scratched.Nickel_Scratched.png", + "size": 104270 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Scratched.Nickel_Scratched_Dark_Matte.png", + "size": 92167 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Scratched.Nickel_Scratched_Dark_Shiny.png", + "size": 100924 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Scratched.Nickel_Scratched_Dirty_Rough.png", + "size": 98322 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Scratched.Nickel_Scratched_Light_Bumpy.png", + "size": 106552 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Scratched.Nickel_Scratched_Scuffs_and_Grime.png", + "size": 96642 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet.png", + "size": 96732 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Glossy_Imperfections.png", + "size": 95413 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Glossy_Streaks.png", + "size": 97085 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Matte_Imperfections.png", + "size": 93574 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched.png", + "size": 144637 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Cross.png", + "size": 135243 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Hexagonal.png", + "size": 144506 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Hexagonal_Small.png", + "size": 133158 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Line.png", + "size": 124355 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Rhombus.png", + "size": 138582 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Small_Circular.png", + "size": 126787 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Square.png", + "size": 130253 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Star.png", + "size": 128274 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Triangle.png", + "size": 131192 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Soft_Splotches.png", + "size": 94543 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Nickel_Sheet.Nickel_Sheet_Splotchy_Streaks.png", + "size": 94126 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/PCB_Copper.PCB_Copper.png", + "size": 115695 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/PCB_Copper.PCB_Copper_Beige.png", + "size": 104318 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/PCB_Copper.PCB_Copper_Smooth.png", + "size": 112388 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/PCB_Copper.PCB_Coppery.png", + "size": 116123 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/PCB_Copper.PCB_Coppery_Soft.png", + "size": 105429 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/PCB_Goldfinger.PCB_Goldfinger.png", + "size": 107308 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/PCB_Goldfinger.PCB_Goldfinger_Smooth.png", + "size": 102149 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/PCB_Goldfinger.PCB_Goldfinger_Soft.png", + "size": 108603 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum.Platinum.png", + "size": 99196 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum.Platinum_Glossy_Fingerprints.png", + "size": 97076 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum.Platinum_Polished.png", + "size": 101305 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Brushed.Platinum_Brushed.png", + "size": 95208 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Brushed.Platinum_Brushed_Light_Brushing.png", + "size": 97225 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Brushed.Platinum_Brushed_Medium_Brushing.png", + "size": 95093 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Brushed.Platinum_Brushed_Medium_Light_Brushing.png", + "size": 96178 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Brushed.Platinum_Brushed_Very_Strong_Brushing.png", + "size": 94153 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Foil.Platinum_Foil.png", + "size": 99024 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Foil.Platinum_Foil_Heavy_Glossy_Wrinkles.png", + "size": 127877 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Foil.Platinum_Foil_Heavy_Matte_Wrinkled.png", + "size": 111984 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Foil.Platinum_Foil_Matte_Wrinkled.png", + "size": 99413 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Foil.Platinum_Foil_Shiny_Wrinkled.png", + "size": 105917 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Foil.Platinum_Foil_Smudged_Foil.png", + "size": 97281 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Hammered.Platinum_Hammered.png", + "size": 111761 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Hammered.Platinum_Hammered_Dull.png", + "size": 104649 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Hammered.Platinum_Hammered_Shiny.png", + "size": 103695 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Knurling.Platinum_Knurling.png", + "size": 112202 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Knurling.Platinum_Knurling_Worn.png", + "size": 107377 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Scratched.Platinum_Scratched.png", + "size": 104147 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Scratched.Platinum_Scratched_Dark_Matte.png", + "size": 92236 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Scratched.Platinum_Scratched_Dark_Shiny.png", + "size": 100896 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Scratched.Platinum_Scratched_Dirty_Rough.png", + "size": 98153 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Scratched.Platinum_Scratched_Light_Bumpy.png", + "size": 106356 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Scratched.Platinum_Scratched_Scuffs_and_Grime.png", + "size": 96499 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet.png", + "size": 96731 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Glossy_Imperfections.png", + "size": 95379 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Glossy_Streaks.png", + "size": 96836 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Matte_Imperfections.png", + "size": 93530 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched.png", + "size": 130671 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Cross.png", + "size": 134134 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Hexagonal.png", + "size": 143484 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Hexagonal_Small.png", + "size": 132777 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Line.png", + "size": 124226 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Rhombus.png", + "size": 137554 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Small_Circular.png", + "size": 126352 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Square.png", + "size": 129844 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Star.png", + "size": 127846 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Triangle.png", + "size": 130812 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Soft_Splotches.png", + "size": 94408 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Platinum_Sheet.Platinum_Sheet_Splotchy_Streaks.png", + "size": 94006 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Punched_Circular_Plate.Punched_Circular_Plate.png", + "size": 126590 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Punched_Circular_Plate.Punched_Circular_Plate_Dirty_Worn.png", + "size": 122548 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Punched_Circular_Plate.Punched_Circular_Plate_Glossy.png", + "size": 120817 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Punched_Circular_Plate.Punched_Circular_Plate_Matte_Aged.png", + "size": 115170 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver.Silver.png", + "size": 97979 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver.Silver_Glossy_Fingerprints.png", + "size": 95412 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver.Silver_Polished.png", + "size": 99982 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Brushed.Silver_Brushed.png", + "size": 96104 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Brushed.Silver_Brushed_Light_Brushing.png", + "size": 97766 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Brushed.Silver_Brushed_Medium_Brushing.png", + "size": 96428 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Brushed.Silver_Brushed_Medium_Light_Brushing.png", + "size": 97213 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Brushed.Silver_Brushed_Very_Strong_Brushing.png", + "size": 97199 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Foil.Silver_Foil.png", + "size": 97248 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Foil.Silver_Foil_Heavy_Glossy_Wrinkles.png", + "size": 128003 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Foil.Silver_Foil_Heavy_Matte_Wrinkled.png", + "size": 111542 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Foil.Silver_Foil_Matte_Wrinkled.png", + "size": 97057 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Foil.Silver_Foil_Shiny_Wrinkled.png", + "size": 103178 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Foil.Silver_Foil_Smudged_Foil.png", + "size": 95685 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Hammered.Silver_Hammered.png", + "size": 112768 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Hammered.Silver_Hammered_Dull.png", + "size": 105097 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Hammered.Silver_Hammered_Shiny.png", + "size": 103382 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Knurling.Silver_Knurling.png", + "size": 118151 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Knurling.Silver_Knurling_Worn.png", + "size": 114386 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Scratched.Silver_Scratched.png", + "size": 108461 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Scratched.Silver_Scratched_Dark_Matte.png", + "size": 97675 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Scratched.Silver_Scratched_Dark_Shiny.png", + "size": 105523 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Scratched.Silver_Scratched_Dirty_Rough.png", + "size": 103769 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Scratched.Silver_Scratched_Light_Bumpy.png", + "size": 109445 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Scratched.Silver_Scratched_Scuffs_and_Grime.png", + "size": 102836 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet.png", + "size": 97832 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Glossy_Imperfections.png", + "size": 94760 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Glossy_Streaks.png", + "size": 97801 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Matte_Imperfections.png", + "size": 92625 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched.png", + "size": 131733 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Cross.png", + "size": 135589 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Hexagonal.png", + "size": 142718 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Hexagonal_Small.png", + "size": 135256 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Line.png", + "size": 125988 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Rhombus.png", + "size": 138540 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Small_Circular.png", + "size": 128330 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Square.png", + "size": 131802 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Star.png", + "size": 130247 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Punched_Triangle.png", + "size": 132876 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Soft_Splotches.png", + "size": 95396 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Silver_Sheet.Silver_Sheet_Splotchy_Streaks.png", + "size": 93079 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Solder_Paste.Solder_Paste.png", + "size": 103857 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Solder_Paste.Solder_Paste_Bumpy.png", + "size": 116502 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Solder_Paste.Solder_Paste_Dull.png", + "size": 91562 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Solder_Paste.Solder_Paste_Fresh.png", + "size": 105046 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel.Stainless_Steel.png", + "size": 104988 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel.Stainless_Steel_Glossy.png", + "size": 99706 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel.Stainless_Steel_Matte.png", + "size": 97838 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel.Stainless_Steel_Shiny_Smudged.png", + "size": 102703 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel.Stainless_Steel_Shiny_Worn.png", + "size": 105272 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed.png", + "size": 96313 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched.png", + "size": 138474 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Cross.png", + "size": 127090 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Cross_Special.png", + "size": 128536 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Hexagonal.png", + "size": 138330 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Hexagonal_Small.png", + "size": 125084 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Line.png", + "size": 116980 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Rhombus.png", + "size": 130692 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Small_Circular.png", + "size": 118753 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Square.png", + "size": 122407 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Star.png", + "size": 120429 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed_Punched_Triangle.png", + "size": 123270 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Steel_Brushed.png", + "size": 96249 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Steel_Brushed_Clean_Polished.png", + "size": 99724 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Steel_Brushed_Matte_Brushing.png", + "size": 94420 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Steel_Brushed_Medium_Brushing.png", + "size": 94422 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed.Steel_Brushed_Worn.png", + "size": 93597 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched.png", + "size": 95437 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_.png", + "size": 125473 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Cross.png", + "size": 126213 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Cross_Special.png", + "size": 129586 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Hexagonal.png", + "size": 138324 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Hexagonal_Small.png", + "size": 125085 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Line.png", + "size": 118662 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Rhombus.png", + "size": 131283 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Small_Circular.png", + "size": 117206 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Square.png", + "size": 122416 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Star.png", + "size": 121328 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Triangle.png", + "size": 123555 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Milled.Stainless_Steel_Milled.png", + "size": 96811 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Milled.Stainless_Steel_Milled_Worn.png", + "size": 98768 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched.png", + "size": 105069 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_.png", + "size": 129915 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Cross.png", + "size": 130775 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Hexagonal.png", + "size": 140308 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Hexagonal_Small.png", + "size": 130628 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Line.png", + "size": 124546 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Rhombus.png", + "size": 135429 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Small_Circular.png", + "size": 122648 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Square.png", + "size": 128233 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Star.png", + "size": 126816 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Triangle.png", + "size": 128556 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon.png", + "size": 106707 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_High_Glossy.png", + "size": 97414 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_High_Matte.png", + "size": 92091 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_High_Shiny.png", + "size": 105828 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Low_Bright_Rust.png", + "size": 105248 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Low_Directional_Imperfections.png", + "size": 102084 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Low_Directional_Rust.png", + "size": 105160 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Low_Heavy_Rust.png", + "size": 111992 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Low_Matte.png", + "size": 95513 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Low_Medium_Rust.png", + "size": 104868 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Medium_Glossy.png", + "size": 98156 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Medium_Matte.png", + "size": 96135 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Carbon.Steel_Carbon_Medium_Shiny.png", + "size": 106384 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Galvanized.Steel_Galvanized.png", + "size": 98033 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Galvanized.Steel_Galvanized_Oxidized.png", + "size": 93332 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Galvanized.Steel_Galvanized_Rough_Crystals.png", + "size": 96494 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted.png", + "size": 99421 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Arcadia_Green.png", + "size": 91844 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Army_Green.png", + "size": 86367 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Black.png", + "size": 82686 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Dark_Blue.png", + "size": 90626 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Dark_Brown.png", + "size": 88815 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Dark_Gray.png", + "size": 84645 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Gray.png", + "size": 87737 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Heavy_Dirt.png", + "size": 99774 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Khaki.png", + "size": 93449 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Light_Blue_Weathered.png", + "size": 97151 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Orange.png", + "size": 99332 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Russet_Matte.png", + "size": 93293 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_White.png", + "size": 93801 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Yellow_Damaged.png", + "size": 102300 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Yellow_Dirty.png", + "size": 102178 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Yellow_Overpainted.png", + "size": 100437 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Yellow_Paint_Strokes.png", + "size": 101269 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted.Steel_Painted_Yellow_Slightly_Weathered.png", + "size": 100024 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted_Cracked.Steel_Painted_Army_Green_Cracked_Dirty.png", + "size": 99280 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted_Cracked.Steel_Painted_Cracked.png", + "size": 108526 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted_Cracked.Steel_Painted_Light_Blue_Cracked_Matte.png", + "size": 118988 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted_Cracked.Steel_Painted_Orange_Cracked_Worn.png", + "size": 109112 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted_Cracked.Steel_Painted_Red_Cracked_Matte.png", + "size": 106833 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted_Cracked.Steel_Painted_Russet_Cracked_Dirty.png", + "size": 107217 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted_Cracked.Steel_Painted_Turquise_Cracked_Shiny.png", + "size": 118906 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Steel_Painted_Cracked.Steel_Painted_Yellow_Cracked_Bleached.png", + "size": 113131 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium.Titanium.png", + "size": 98881 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium.Titanium_Glossy_Fingerprints.png", + "size": 96735 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium.Titanium_Polished.png", + "size": 100979 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Brushed.Titanium_Brushed.png", + "size": 94603 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Brushed.Titanium_Brushed_Light_Brushing.png", + "size": 96725 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Brushed.Titanium_Brushed_Medium_Brushing.png", + "size": 94381 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Brushed.Titanium_Brushed_Medium_Light_Brushing.png", + "size": 95471 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Brushed.Titanium_Brushed_Very_Strong_Brushing.png", + "size": 93301 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Foil.Titanium_Foil.png", + "size": 98782 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Foil.Titanium_Foil_Heavy_Glossy_Wrinkles.png", + "size": 127291 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Foil.Titanium_Foil_Heavy_Matte_Wrinkled.png", + "size": 111358 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Foil.Titanium_Foil_Matte_Wrinkled.png", + "size": 99375 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Foil.Titanium_Foil_Shiny_Wrinkled.png", + "size": 105717 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Foil.Titanium_Foil_Smudged_Foil.png", + "size": 96990 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Hammered.Titanium_Hammered.png", + "size": 111144 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Hammered.Titanium_Hammered_Dull.png", + "size": 103977 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Hammered.Titanium_Hammered_Shiny.png", + "size": 103285 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Knurling.Titanium_Knurling.png", + "size": 110787 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Knurling.Titanium_Knurling_Worn.png", + "size": 105876 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Scratched.Titanium_Scratched.png", + "size": 103022 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Scratched.Titanium_Scratched_Dark_Matte.png", + "size": 90967 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Scratched.Titanium_Scratched_Dark_Shiny.png", + "size": 99787 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Scratched.Titanium_Scratched_Dirty_Rough.png", + "size": 96833 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Scratched.Titanium_Scratched_Light_Bumpy.png", + "size": 105320 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Scratched.Titanium_Scratched_Scuffs_and_Grime.png", + "size": 94958 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet.png", + "size": 96014 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Glossy_Imperfections.png", + "size": 94996 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Glossy_Streaks.png", + "size": 96311 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Matte_Imperfections.png", + "size": 93221 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched.png", + "size": 129849 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Cross.png", + "size": 133144 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Hexagonal.png", + "size": 142890 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Hexagonal_Small.png", + "size": 131675 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Line.png", + "size": 123134 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Rhombus.png", + "size": 136672 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Small_Circular.png", + "size": 125308 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Square.png", + "size": 128688 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Star.png", + "size": 126797 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Triangle.png", + "size": 129672 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Soft_Splotches.png", + "size": 93771 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Titanium_Sheet.Titanium_Sheet_Splotchy_Streaks.png", + "size": 93738 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten.Tungsten.png", + "size": 99410 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten.Tungsten_Glossy_Fingerprints.png", + "size": 97132 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten.Tungsten_Polished.png", + "size": 101434 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Brushed.Tungsten_Brushed.png", + "size": 97013 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Brushed.Tungsten_Brushed_Light_Brushing.png", + "size": 98570 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Brushed.Tungsten_Brushed_Medium_Brushing.png", + "size": 97074 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Brushed.Tungsten_Brushed_Medium_Light_Brushing.png", + "size": 97667 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Brushed.Tungsten_Brushed_Very_Strong_Brushing.png", + "size": 97064 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Foil.Tungsten_Foil.png", + "size": 99144 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Foil.Tungsten_Foil_Heavy_Glossy_Wrinkles.png", + "size": 128777 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Foil.Tungsten_Foil_Heavy_Matte_Wrinkled.png", + "size": 113155 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Foil.Tungsten_Foil_Matte_Wrinkled.png", + "size": 99538 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Foil.Tungsten_Foil_Shiny_Wrinkled.png", + "size": 105655 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Foil.Tungsten_Foil_Smudged_Foil.png", + "size": 97467 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Hammered.Tungsten_Hammered.png", + "size": 113521 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Hammered.Tungsten_Hammered_Dull.png", + "size": 106246 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Hammered.Tungsten_Hammered_Shiny.png", + "size": 104817 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Knurling.Tungsten_Knurling.png", + "size": 116750 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Knurling.Tungsten_Knurling_Worn.png", + "size": 112727 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Scratched.Tungsten_Scratched.png", + "size": 107859 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Scratched.Tungsten_Scratched_Dark_Matte.png", + "size": 96290 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Scratched.Tungsten_Scratched_Dark_Shiny.png", + "size": 104557 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Scratched.Tungsten_Scratched_Dirty_Rough.png", + "size": 102547 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Scratched.Tungsten_Scratched_Light_Bumpy.png", + "size": 109366 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Scratched.Tungsten_Scratched_Scuffs_and_Grime.png", + "size": 101381 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet.png", + "size": 98108 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Glossy_Imperfections.png", + "size": 95892 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Glossy_Streaks.png", + "size": 98364 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Matte_Imperfections.png", + "size": 94351 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched.png", + "size": 134215 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Cross.png", + "size": 140276 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Hexagonal.png", + "size": 148190 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Hexagonal_Small.png", + "size": 139606 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Line.png", + "size": 129913 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Rhombus.png", + "size": 143200 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Small_Circular.png", + "size": 132805 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Square.png", + "size": 135939 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Star.png", + "size": 134223 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Triangle.png", + "size": 137382 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Soft_Splotches.png", + "size": 95848 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Tungsten_Sheet.Tungsten_Sheet_Splotchy_Streaks.png", + "size": 94561 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc.Zinc.png", + "size": 98430 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc.Zinc_Glossy_Fingerprints.png", + "size": 96011 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc.Zinc_Polished.png", + "size": 100391 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Brushed.Zinc_Brushed.png", + "size": 96200 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Brushed.Zinc_Brushed_Light_Brushing.png", + "size": 97765 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Brushed.Zinc_Brushed_Medium_Brushing.png", + "size": 96251 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Brushed.Zinc_Brushed_Medium_Light_Brushing.png", + "size": 97009 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Brushed.Zinc_Brushed_Very_Strong_Brushing.png", + "size": 96510 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Foil.Zinc_Foil.png", + "size": 97799 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Foil.Zinc_Foil_Heavy_Glossy_Wrinkles.png", + "size": 128132 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Foil.Zinc_Foil_Heavy_Matte_Wrinkled.png", + "size": 112076 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Foil.Zinc_Foil_Matte_Wrinkled.png", + "size": 97876 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Foil.Zinc_Foil_Shiny_Wrinkled.png", + "size": 104048 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Foil.Zinc_Foil_Smudged_Foil.png", + "size": 96102 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Galvanizing.Zinc_Dirty_Rough_Oxidized.png", + "size": 100240 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Galvanizing.Zinc_Galvanizing.png", + "size": 95155 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Galvanizing.Zinc_Rough_Crystals.png", + "size": 91551 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Galvanizing.Zinc_Rough_Heavy_Shiny_Oxidized.png", + "size": 96499 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Galvanizing.Zinc_Rough_Medium_Oxidized.png", + "size": 91545 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Hammered.Zinc_Hammered.png", + "size": 112731 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Hammered.Zinc_Hammered_Dull.png", + "size": 104959 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Hammered.Zinc_Hammered_Shiny.png", + "size": 103501 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Knurling.Metal_Knurling_Zinc.png", + "size": 117138 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Knurling.Metal_Knurling_Zinc_Worn.png", + "size": 112809 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Knurling.Zinc_Knurling.png", + "size": 117156 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Knurling.Zinc_Knurling_Worn.png", + "size": 112815 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Scratched.Zinc_Scratched.png", + "size": 107747 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Scratched.Zinc_Scratched_Dark_Matte.png", + "size": 96506 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Scratched.Zinc_Scratched_Dark_Shiny.png", + "size": 104569 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Scratched.Zinc_Scratched_Dirty_Rough.png", + "size": 102562 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Scratched.Zinc_Scratched_Light_Bumpy.png", + "size": 109027 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Scratched.Zinc_Scratched_Scuffs_and_Grime.png", + "size": 101594 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet.png", + "size": 97531 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Glossy_Imperfections.png", + "size": 95146 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Glossy_Streaks.png", + "size": 97605 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Matte_Imperfections.png", + "size": 93136 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched.png", + "size": 130831 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Cross.png", + "size": 132719 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Hexagonal.png", + "size": 140269 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Hexagonal_Small.png", + "size": 131012 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Line.png", + "size": 123352 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Rhombus.png", + "size": 135558 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Small_Circular.png", + "size": 125263 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Square.png", + "size": 129206 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Star.png", + "size": 126760 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Triangle.png", + "size": 129525 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Soft_Splotches.png", + "size": 95029 + }, + { + "key": "Materials/vMaterials_2/Metal/.thumbs/Zinc_Sheet.Zinc_Sheet_Splotchy_Streaks.png", + "size": 93350 + }, + { + "key": "Materials/vMaterials_2/Metal/Aging_Copper.mdl", + "size": 120911 + }, + { + "key": "Materials/vMaterials_2/Metal/Aluminum.mdl", + "size": 16724 + }, + { + "key": "Materials/vMaterials_2/Metal/Aluminum_Anodized.mdl", + "size": 117637 + }, + { + "key": "Materials/vMaterials_2/Metal/Aluminum_Brushed.mdl", + "size": 18536 + }, + { + "key": "Materials/vMaterials_2/Metal/Aluminum_Foil.mdl", + "size": 28955 + }, + { + "key": "Materials/vMaterials_2/Metal/Aluminum_Hammered.mdl", + "size": 32711 + }, + { + "key": "Materials/vMaterials_2/Metal/Aluminum_Knurling.mdl", + "size": 12303 + }, + { + "key": "Materials/vMaterials_2/Metal/Aluminum_Scratched.mdl", + "size": 48341 + }, + { + "key": "Materials/vMaterials_2/Metal/Aluminum_Sheet.mdl", + "size": 61632 + }, + { + "key": "Materials/vMaterials_2/Metal/Blued_Steel_Cold.mdl", + "size": 26050 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass.mdl", + "size": 37918 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass_Antique.mdl", + "size": 23070 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass_Brushed.mdl", + "size": 42199 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass_Foil.mdl", + "size": 40169 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass_Hammered.mdl", + "size": 37407 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass_Knurling.mdl", + "size": 31511 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass_Polished.mdl", + "size": 37872 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass_Scratched.mdl", + "size": 65656 + }, + { + "key": "Materials/vMaterials_2/Metal/Brass_Sheet.mdl", + "size": 44478 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze.mdl", + "size": 37715 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Antique.mdl", + "size": 31216 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Brushed.mdl", + "size": 31372 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Foil.mdl", + "size": 30620 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Hammered.mdl", + "size": 32272 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Knurling.mdl", + "size": 27896 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Polished.mdl", + "size": 30228 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Scratched.mdl", + "size": 53784 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Sheet.mdl", + "size": 33380 + }, + { + "key": "Materials/vMaterials_2/Metal/Bronze_Sheet_Punched.mdl", + "size": 58976 + }, + { + "key": "Materials/vMaterials_2/Metal/Chrome_Hammered.mdl", + "size": 30616 + }, + { + "key": "Materials/vMaterials_2/Metal/Chromium.mdl", + "size": 16621 + }, + { + "key": "Materials/vMaterials_2/Metal/Chromium_Brushed.mdl", + "size": 18526 + }, + { + "key": "Materials/vMaterials_2/Metal/Chromium_Foil.mdl", + "size": 28861 + }, + { + "key": "Materials/vMaterials_2/Metal/Chromium_Knurling.mdl", + "size": 12267 + }, + { + "key": "Materials/vMaterials_2/Metal/Chromium_Scratched.mdl", + "size": 48272 + }, + { + "key": "Materials/vMaterials_2/Metal/Chromium_Sheet.mdl", + "size": 61564 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper.mdl", + "size": 16701 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper_Antique_Brushed.mdl", + "size": 16031 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper_Antique_Brushed_Patinated.mdl", + "size": 21313 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper_Brushed.mdl", + "size": 18469 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper_Foil.mdl", + "size": 28761 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper_Hammered.mdl", + "size": 32308 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper_Knurling.mdl", + "size": 12262 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper_Scratched.mdl", + "size": 48203 + }, + { + "key": "Materials/vMaterials_2/Metal/Copper_Sheet.mdl", + "size": 61628 + }, + { + "key": "Materials/vMaterials_2/Metal/Diamond_Plate_Double_Tear.mdl", + "size": 32102 + }, + { + "key": "Materials/vMaterials_2/Metal/Diamond_Plate_Quadruple_Tear.mdl", + "size": 32106 + }, + { + "key": "Materials/vMaterials_2/Metal/Diamond_Plate_Quintuple_Tear.mdl", + "size": 32160 + }, + { + "key": "Materials/vMaterials_2/Metal/Diamond_Plate_Single_Tear.mdl", + "size": 32062 + }, + { + "key": "Materials/vMaterials_2/Metal/Diamond_Plate_Spike.mdl", + "size": 31917 + }, + { + "key": "Materials/vMaterials_2/Metal/Diamond_Plate_Triple_Tear.mdl", + "size": 32076 + }, + { + "key": "Materials/vMaterials_2/Metal/Gold.mdl", + "size": 16623 + }, + { + "key": "Materials/vMaterials_2/Metal/Gold_Brushed.mdl", + "size": 18413 + }, + { + "key": "Materials/vMaterials_2/Metal/Gold_Foil.mdl", + "size": 28766 + }, + { + "key": "Materials/vMaterials_2/Metal/Gold_Hammered.mdl", + "size": 32315 + }, + { + "key": "Materials/vMaterials_2/Metal/Gold_Knurling.mdl", + "size": 12264 + }, + { + "key": "Materials/vMaterials_2/Metal/Gold_Scratched.mdl", + "size": 48266 + }, + { + "key": "Materials/vMaterials_2/Metal/Gold_Sheet.mdl", + "size": 60086 + }, + { + "key": "Materials/vMaterials_2/Metal/Iron.mdl", + "size": 16556 + }, + { + "key": "Materials/vMaterials_2/Metal/Iron_Brushed.mdl", + "size": 18411 + }, + { + "key": "Materials/vMaterials_2/Metal/Iron_Foil.mdl", + "size": 28722 + }, + { + "key": "Materials/vMaterials_2/Metal/Iron_Hammered.mdl", + "size": 32232 + }, + { + "key": "Materials/vMaterials_2/Metal/Iron_Knurling.mdl", + "size": 12232 + }, + { + "key": "Materials/vMaterials_2/Metal/Iron_Pitted_Steel.mdl", + "size": 17023 + }, + { + "key": "Materials/vMaterials_2/Metal/Iron_Scratched.mdl", + "size": 48271 + }, + { + "key": "Materials/vMaterials_2/Metal/Iron_Sheet.mdl", + "size": 60713 + }, + { + "key": "Materials/vMaterials_2/Metal/Mercury.mdl", + "size": 15059 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_01.mdl.png", + "size": 99545 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_01.mdl@Metal_Mesh_Weave_01.png", + "size": 99545 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_01.mdl@Woven_Metal_01_Copper_Steel.png", + "size": 104142 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_01.mdl@Woven_Metal_01_Faint_Copper.png", + "size": 102647 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_01.mdl@Woven_Metal_01_Golden_Steel.png", + "size": 102977 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_01.mdl@Woven_Metal_01_Pure_Steel.png", + "size": 99538 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_01.mdl@Woven_Metal_01_Steel_Brass.png", + "size": 101587 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_01.mdl@Woven_Metal_01_Warmgolden_Steel.png", + "size": 104034 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl.png", + "size": 93092 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Metal_Mesh_Weave_02.png", + "size": 93092 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Woven_Metal_02_Brass_Pure.png", + "size": 96889 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Woven_Metal_02_Brass_Steel.png", + "size": 97926 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Woven_Metal_02_Copper_Pure.png", + "size": 97286 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Woven_Metal_02_Copper_Steel.png", + "size": 98465 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Woven_Metal_02_Gold_Glossy.png", + "size": 98753 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Woven_Metal_02_Gold_Matte.png", + "size": 99157 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Woven_Metal_02_Steel_Brass.png", + "size": 94626 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_02.mdl@Woven_Metal_02_Steel_Pure.png", + "size": 93577 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl.png", + "size": 98381 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Metal_Mesh_Weave_03.png", + "size": 98381 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Brass_Glossy.png", + "size": 98913 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Brass_Polished.png", + "size": 102433 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Brass_Worn.png", + "size": 102480 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Copper_Glossy.png", + "size": 99682 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Copper_Polished.png", + "size": 103258 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Copper_Worn.png", + "size": 103579 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Steel_Glossy.png", + "size": 97383 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Steel_Polished.png", + "size": 98138 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/256x256/Metal_Mesh_Weave_03.mdl@Woven_Metal_03_Steel_Worn.png", + "size": 99508 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_01.Metal_Mesh_Weave_01.png", + "size": 96616 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_01.Woven_Metal_01_Copper_Steel.png", + "size": 104529 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_01.Woven_Metal_01_Faint_Copper.png", + "size": 106993 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_01.Woven_Metal_01_Golden_Steel.png", + "size": 103596 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_01.Woven_Metal_01_Pure_Steel.png", + "size": 105885 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_01.Woven_Metal_01_Steel_Brass.png", + "size": 106385 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_01.Woven_Metal_01_Warmgolden_Steel.png", + "size": 104842 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Metal_Mesh_Weave_02.png", + "size": 95086 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Woven_Metal_02_Brass_Pure.png", + "size": 103649 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Woven_Metal_02_Brass_Steel.png", + "size": 104252 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Woven_Metal_02_Copper_Pure.png", + "size": 103218 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Woven_Metal_02_Copper_Steel.png", + "size": 102680 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Woven_Metal_02_Gold_Glossy.png", + "size": 104990 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Woven_Metal_02_Gold_Matte.png", + "size": 102987 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Woven_Metal_02_Steel_Brass.png", + "size": 102053 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_02.Woven_Metal_02_Steel_Pure.png", + "size": 101768 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Metal_Mesh_Weave_03.png", + "size": 112756 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Brass_Glossy.png", + "size": 109633 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Brass_Polished.png", + "size": 112414 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Brass_Worn.png", + "size": 111244 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Copper_Glossy.png", + "size": 109031 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Copper_Polished.png", + "size": 111872 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Copper_Worn.png", + "size": 110539 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Steel_Glossy.png", + "size": 111520 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Steel_Polished.png", + "size": 113818 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/.thumbs/Metal_Mesh_Weave_03.Woven_Metal_03_Steel_Worn.png", + "size": 112670 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/Metal_Mesh_Weave_01.mdl", + "size": 18450 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/Metal_Mesh_Weave_02.mdl", + "size": 21080 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/Metal_Mesh_Weave_03.mdl", + "size": 24767 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_01_AO.jpg", + "size": 34416 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_01_brushing_norm.jpg", + "size": 3660848 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_01_colormask.png", + "size": 9194 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_01_norm.jpg", + "size": 104683 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_01_rough2.jpg", + "size": 452632 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_02_AO.jpg", + "size": 386339 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_02_color_mask.png", + "size": 4212 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_02_metalcolor_mask.png", + "size": 669924 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_02_norm.jpg", + "size": 937997 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_02_rough.jpg", + "size": 819354 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_03_AO.jpg", + "size": 394535 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_03_color_mask.png", + "size": 2198 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_03_detail_norm.jpg", + "size": 607086 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_03_detail_scratches_norm.jpg", + "size": 298665 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_03_metal.jpg", + "size": 711344 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_03_norm.jpg", + "size": 197435 + }, + { + "key": "Materials/vMaterials_2/Metal/Mesh/textures/metalweave_03_rough.jpg", + "size": 3441599 + }, + { + "key": "Materials/vMaterials_2/Metal/Metal_Cast.mdl", + "size": 48298 + }, + { + "key": "Materials/vMaterials_2/Metal/Nickel.mdl", + "size": 16612 + }, + { + "key": "Materials/vMaterials_2/Metal/Nickel_Brushed.mdl", + "size": 18455 + }, + { + "key": "Materials/vMaterials_2/Metal/Nickel_Foil.mdl", + "size": 28921 + }, + { + "key": "Materials/vMaterials_2/Metal/Nickel_Hammered.mdl", + "size": 32260 + }, + { + "key": "Materials/vMaterials_2/Metal/Nickel_Knurling.mdl", + "size": 12269 + }, + { + "key": "Materials/vMaterials_2/Metal/Nickel_Scratched.mdl", + "size": 48367 + }, + { + "key": "Materials/vMaterials_2/Metal/Nickel_Sheet.mdl", + "size": 60997 + }, + { + "key": "Materials/vMaterials_2/Metal/PCB_Copper.mdl", + "size": 18611 + }, + { + "key": "Materials/vMaterials_2/Metal/PCB_Goldfinger.mdl", + "size": 15270 + }, + { + "key": "Materials/vMaterials_2/Metal/Platinum.mdl", + "size": 16651 + }, + { + "key": "Materials/vMaterials_2/Metal/Platinum_Brushed.mdl", + "size": 18517 + }, + { + "key": "Materials/vMaterials_2/Metal/Platinum_Foil.mdl", + "size": 28889 + }, + { + "key": "Materials/vMaterials_2/Metal/Platinum_Hammered.mdl", + "size": 32297 + }, + { + "key": "Materials/vMaterials_2/Metal/Platinum_Knurling.mdl", + "size": 12295 + }, + { + "key": "Materials/vMaterials_2/Metal/Platinum_Scratched.mdl", + "size": 48327 + }, + { + "key": "Materials/vMaterials_2/Metal/Platinum_Sheet.mdl", + "size": 60785 + }, + { + "key": "Materials/vMaterials_2/Metal/Punched_Circular_Plate.mdl", + "size": 30756 + }, + { + "key": "Materials/vMaterials_2/Metal/Silver.mdl", + "size": 16610 + }, + { + "key": "Materials/vMaterials_2/Metal/Silver_Brushed.mdl", + "size": 18492 + }, + { + "key": "Materials/vMaterials_2/Metal/Silver_Foil.mdl", + "size": 28767 + }, + { + "key": "Materials/vMaterials_2/Metal/Silver_Hammered.mdl", + "size": 32266 + }, + { + "key": "Materials/vMaterials_2/Metal/Silver_Knurling.mdl", + "size": 12269 + }, + { + "key": "Materials/vMaterials_2/Metal/Silver_Scratched.mdl", + "size": 48426 + }, + { + "key": "Materials/vMaterials_2/Metal/Silver_Sheet.mdl", + "size": 60814 + }, + { + "key": "Materials/vMaterials_2/Metal/Solder_Paste.mdl", + "size": 16809 + }, + { + "key": "Materials/vMaterials_2/Metal/Stainless_Steel.mdl", + "size": 49563 + }, + { + "key": "Materials/vMaterials_2/Metal/Stainless_Steel_Brushed.mdl", + "size": 67011 + }, + { + "key": "Materials/vMaterials_2/Metal/Stainless_Steel_Brushed_Punched.mdl", + "size": 100851 + }, + { + "key": "Materials/vMaterials_2/Metal/Stainless_Steel_Milled.mdl", + "size": 33037 + }, + { + "key": "Materials/vMaterials_2/Metal/Stainless_Steel_Punched.mdl", + "size": 75793 + }, + { + "key": "Materials/vMaterials_2/Metal/Steel_Carbon.mdl", + "size": 56197 + }, + { + "key": "Materials/vMaterials_2/Metal/Steel_Galvanized.mdl", + "size": 36335 + }, + { + "key": "Materials/vMaterials_2/Metal/Steel_Painted.mdl", + "size": 119906 + }, + { + "key": "Materials/vMaterials_2/Metal/Steel_Painted_Cracked.mdl", + "size": 120795 + }, + { + "key": "Materials/vMaterials_2/Metal/Titanium.mdl", + "size": 16649 + }, + { + "key": "Materials/vMaterials_2/Metal/Titanium_Brushed.mdl", + "size": 18554 + }, + { + "key": "Materials/vMaterials_2/Metal/Titanium_Foil.mdl", + "size": 28887 + }, + { + "key": "Materials/vMaterials_2/Metal/Titanium_Hammered.mdl", + "size": 32291 + }, + { + "key": "Materials/vMaterials_2/Metal/Titanium_Knurling.mdl", + "size": 12295 + }, + { + "key": "Materials/vMaterials_2/Metal/Titanium_Scratched.mdl", + "size": 48328 + }, + { + "key": "Materials/vMaterials_2/Metal/Titanium_Sheet.mdl", + "size": 60786 + }, + { + "key": "Materials/vMaterials_2/Metal/Tungsten.mdl", + "size": 16663 + }, + { + "key": "Materials/vMaterials_2/Metal/Tungsten_Brushed.mdl", + "size": 18554 + }, + { + "key": "Materials/vMaterials_2/Metal/Tungsten_Foil.mdl", + "size": 31134 + }, + { + "key": "Materials/vMaterials_2/Metal/Tungsten_Hammered.mdl", + "size": 32300 + }, + { + "key": "Materials/vMaterials_2/Metal/Tungsten_Knurling.mdl", + "size": 12295 + }, + { + "key": "Materials/vMaterials_2/Metal/Tungsten_Scratched.mdl", + "size": 48327 + }, + { + "key": "Materials/vMaterials_2/Metal/Tungsten_Sheet.mdl", + "size": 60564 + }, + { + "key": "Materials/vMaterials_2/Metal/Zinc.mdl", + "size": 16583 + }, + { + "key": "Materials/vMaterials_2/Metal/Zinc_Brushed.mdl", + "size": 18429 + }, + { + "key": "Materials/vMaterials_2/Metal/Zinc_Foil.mdl", + "size": 31108 + }, + { + "key": "Materials/vMaterials_2/Metal/Zinc_Galvanizing.mdl", + "size": 43114 + }, + { + "key": "Materials/vMaterials_2/Metal/Zinc_Hammered.mdl", + "size": 32232 + }, + { + "key": "Materials/vMaterials_2/Metal/Zinc_Knurling.mdl", + "size": 12237 + }, + { + "key": "Materials/vMaterials_2/Metal/Zinc_Scratched.mdl", + "size": 48178 + }, + { + "key": "Materials/vMaterials_2/Metal/Zinc_Sheet.mdl", + "size": 61244 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/aging_copper_gradient.png", + "size": 5775 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/aging_copper_haze_weight.png", + "size": 4792 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", + "size": 4679540 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", + "size": 3505179 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/aging_copper_norm.jpg", + "size": 5484772 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/analum_dirt_norm.jpg", + "size": 1181064 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/analum_multi_smudges.jpg", + "size": 3385374 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/analum_scratches_dist.png", + "size": 341253 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/analum_scratches_norm.png", + "size": 431691 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/analum_worn_norm.jpg", + "size": 323702 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/atlas_02_norm_dist.png", + "size": 1576300 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/blued_steel_diff.jpg", + "size": 2510845 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", + "size": 3679326 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/blued_steel_norm.jpg", + "size": 538520 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_antique_diff.jpg", + "size": 2030923 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", + "size": 4995317 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_antique_normal.jpg", + "size": 1281923 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_gradients_yellow_gold_red.png", + "size": 334 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_hammered_multi_R_pit_G_ao_rough.jpg", + "size": 5691375 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", + "size": 7305819 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_multi_R_grad_G_scratches_B_rough.jpg", + "size": 5255631 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_multi_R_noise_G_scratches_B_rough.jpg", + "size": 10508434 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brass_normal.jpg", + "size": 862195 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", + "size": 5897504 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/bronze_antique_diff.jpg", + "size": 2033096 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/bronze_gradients.png", + "size": 344 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_antique_copper_diff.jpg", + "size": 1418954 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_antique_copper_norm.jpg", + "size": 824545 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_antique_copper_patina_diff.jpg", + "size": 404974 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_antique_copper_ref.jpg", + "size": 719606 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_antique_copper_rough.jpg", + "size": 2729601 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_antique_copper_smudge_map.jpg", + "size": 3096394 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_antique_copper_spots_mask.jpg", + "size": 636412 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", + "size": 6136073 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/brushed_metal_linear_norm.jpg", + "size": 5404672 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/carbon_steel_ao.jpg", + "size": 3192900 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/carbon_steel_multi.jpg", + "size": 3527961 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/carbon_steel_norm.jpg", + "size": 3387620 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cast_metal_multi_R_rough_G_smudges.jpg", + "size": 3126748 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cast_metal_norm.jpg", + "size": 2449107 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/circdiam_multi_ao_height.png", + "size": 1058523 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/circdiam_norm.jpg", + "size": 315240 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/circle_shape_multi_R_ao_G_height_B_opacity.jpg", + "size": 597489 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/circle_shape_norm.jpg", + "size": 584188 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/copper_patina_diff.jpg", + "size": 2505139 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/copper_patina_norm.jpg", + "size": 5627717 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_bare_metal_albedo.jpg", + "size": 1729606 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_bare_norm.png", + "size": 758753 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_chaotic_paint_norm.jpg", + "size": 2234857 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_crackedpaint_multi.jpg", + "size": 7157220 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_crackedpaint_norm.jpg", + "size": 2091535 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", + "size": 4235280 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", + "size": 902327 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_met_norm.jpg", + "size": 1023125 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/cracked_paint_surface_paint_bg_norm.jpg", + "size": 1139662 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/dirt.jpg", + "size": 792158 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/doubletear_shape_multi_R_ao_G_height_B_opacity.png", + "size": 1421832 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/doubletear_shape_norm.jpg", + "size": 780381 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/fivetear_shape_multi_R_ao_G_height_B_opacity.jpg", + "size": 989895 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/fivetear_shape_norm.jpg", + "size": 1032704 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", + "size": 2459224 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/foil_crumpled_R_smudge_G_splotch.jpg", + "size": 6000999 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/foil_crumpled_norm.jpg", + "size": 1257236 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/fourtear_shape_multi_R_ao_G_height.png", + "size": 1141594 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/fourtear_shape_norm.jpg", + "size": 696231 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/hammered_multi_R_pit_G_ao_B_hammer.jpg", + "size": 4822565 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/hammered_multi_R_rough_G_corrspots_B_metal.jpg", + "size": 5385252 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/hammered_norm.jpg", + "size": 1435260 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_dents_bump.png", + "size": 322166 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_dents_bump_02.png", + "size": 1493349 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_dents_bump_03.png", + "size": 977004 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_heat_diff.jpg", + "size": 297389 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_no_dents_diff.jpg", + "size": 1024489 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_no_spots_metal.png", + "size": 1195335 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_norm.jpg", + "size": 4181033 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_roughness_no_spots.jpg", + "size": 1009775 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/iron_pitted_steel_rust_diffuse.jpg", + "size": 422369 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_antique_normal.jpg", + "size": 1281923 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_galvan_multi_R_base_G_dirtmask_B_dirt.jpg", + "size": 2899859 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_galvan_multi_R_dirt_G_urough_B_vrough.jpg", + "size": 3547124 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_galvan_normal.jpg", + "size": 2516459 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", + "size": 1789886 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", + "size": 5944332 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_knurling_multi_heights.jpg", + "size": 2076774 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_knurling_norm.jpg", + "size": 1900541 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", + "size": 3114776 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", + "size": 6891717 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_scratched_norm.jpg", + "size": 1997338 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_scratched_scratch_norm.jpg", + "size": 3254868 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/metal_smudges_rough.jpg", + "size": 2901291 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/pcb_copper_diff.jpg", + "size": 1231290 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/pcb_copper_norm.jpg", + "size": 1465546 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/pcb_copper_rough.jpg", + "size": 1101185 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/pcb_goldfinger_norm.jpg", + "size": 1849285 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/pcb_goldfinger_rough.jpg", + "size": 1259173 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/plate_dirt.jpg", + "size": 3542758 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/plate_dirt_norm.jpg", + "size": 1191931 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/polish_norm.jpg", + "size": 3060774 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/polish_wipe.jpg", + "size": 3509286 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/scratched_multi_R_dents_G_crust_B_rough.jpg", + "size": 10917898 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", + "size": 9683102 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/scratched_normal.jpg", + "size": 5076504 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/sheet_metal_R_rough_G_ao_B_streaks.jpg", + "size": 4451500 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/sheet_metal_multi_rough.jpg", + "size": 7088427 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/sheet_metal_norm.jpg", + "size": 3633863 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/solder_paste_norm.jpg", + "size": 574505 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/solder_paste_rough.jpg", + "size": 748789 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", + "size": 3045027 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_brushed_norm.jpg", + "size": 3323602 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_brushed_smudges.jpg", + "size": 2232876 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_damages_norm.jpg", + "size": 964428 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", + "size": 2409773 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_milled_norm.jpg", + "size": 1339310 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_multi_R_diff_G_rough_B_dents.jpg", + "size": 3129252 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_norm.jpg", + "size": 1219078 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/stainless_smudges.jpg", + "size": 2211375 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/tear_multi_ao_height.png", + "size": 1181973 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/tear_norm.jpg", + "size": 309152 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/transition_noise.jpg", + "size": 334039 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/tripletear_multi_ao_height.png", + "size": 1213745 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/tripletear_shape_normal.jpg", + "size": 633918 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", + "size": 2903400 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", + "size": 4597032 + }, + { + "key": "Materials/vMaterials_2/Metal/textures/zinc_galvanized_normal.jpg", + "size": 2144947 + }, + { + "key": "Materials/vMaterials_2/NVIDIA_VMATERIALS_2_VERSION.txt", + "size": 59 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly.mdl.png", + "size": 122509 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly.mdl@Jelly.png", + "size": 122509 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly.mdl@Jelly_Dark_Red_Raspberry.png", + "size": 112313 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly.mdl@Jelly_Green_Apple.png", + "size": 112326 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly.mdl@Jelly_Red_Orange.png", + "size": 124423 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly.mdl@Jelly_Red_Strawberry.png", + "size": 116811 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly.mdl@Jelly_White_Pineapple.png", + "size": 112049 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly.mdl@Jelly_Yellow_Lemon.png", + "size": 125719 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly_Clear.mdl.png", + "size": 117494 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly_Clear.mdl@Jelly_Clear.png", + "size": 117494 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly_Clear.mdl@Jelly_Clear_Dark_Red_Raspberry.png", + "size": 103692 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly_Clear.mdl@Jelly_Clear_Green_Apple.png", + "size": 107161 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly_Clear.mdl@Jelly_Clear_Orange.png", + "size": 117043 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly_Clear.mdl@Jelly_Clear_Red_Strawberry.png", + "size": 113371 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly_Clear.mdl@Jelly_Clear_White_Pineapple.png", + "size": 109780 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/256x256/Jelly_Clear.mdl@Jelly_Clear_Yellow_Lemon.png", + "size": 117647 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly.Jelly.png", + "size": 131700 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly.Jelly_Dark_Red_Raspberry.png", + "size": 123236 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly.Jelly_Green_Apple.png", + "size": 123024 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly.Jelly_Red_Orange.png", + "size": 136910 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly.Jelly_Red_Strawberry.png", + "size": 127124 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly.Jelly_White_Pineapple.png", + "size": 121170 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly.Jelly_Yellow_Lemon.png", + "size": 138481 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly_Clear.Jelly_Clear.png", + "size": 123420 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly_Clear.Jelly_Clear_Dark_Red_Raspberry.png", + "size": 114295 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly_Clear.Jelly_Clear_Green_Apple.png", + "size": 118164 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly_Clear.Jelly_Clear_Orange.png", + "size": 126851 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly_Clear.Jelly_Clear_Red_Strawberry.png", + "size": 121589 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly_Clear.Jelly_Clear_White_Pineapple.png", + "size": 114299 + }, + { + "key": "Materials/vMaterials_2/Other/Food/.thumbs/Jelly_Clear.Jelly_Clear_Yellow_Lemon.png", + "size": 126502 + }, + { + "key": "Materials/vMaterials_2/Other/Food/Jelly.mdl", + "size": 13202 + }, + { + "key": "Materials/vMaterials_2/Other/Food/Jelly_Clear.mdl", + "size": 11292 + }, + { + "key": "Materials/vMaterials_2/Other/Food/textures/jelly_normal.jpg", + "size": 491940 + }, + { + "key": "Materials/vMaterials_2/Other/Food/textures/jelly_roughness.jpg", + "size": 448078 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Material.mdl.png", + "size": 76834 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Material.mdl@Retroreflective_Material.png", + "size": 76834 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Material.mdl@Retroreflective_Material_Blue.png", + "size": 79497 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Material.mdl@Retroreflective_Material_Gray_Worn.png", + "size": 76209 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Material.mdl@Retroreflective_Material_Orange.png", + "size": 80187 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Material.mdl@Retroreflective_Material_Red.png", + "size": 79973 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Material.mdl@Retroreflective_Material_White.png", + "size": 74272 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Material.mdl@Retroreflective_Material_Yellow.png", + "size": 79123 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Tape.mdl.png", + "size": 99033 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Tape.mdl@Retroreflective_Tape.png", + "size": 99033 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Tape.mdl@Retroreflective_Tape_Blue.png", + "size": 94780 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Tape.mdl@Retroreflective_Tape_Green.png", + "size": 100705 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Tape.mdl@Retroreflective_Tape_Orange.png", + "size": 99264 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Tape.mdl@Retroreflective_Tape_Red.png", + "size": 95589 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Tape.mdl@Retroreflective_Tape_White.png", + "size": 93670 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Tape.mdl@Retroreflective_Tape_Yellow_Worn.png", + "size": 98443 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Warnstripes.mdl.png", + "size": 100470 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Warnstripes.mdl@Retroreflective_Warnstripes.png", + "size": 100470 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Warnstripes.mdl@Retroreflective_Warnstripes_Black_White.png", + "size": 94949 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/256x256/Retroreflective_Warnstripes.mdl@Retroreflective_Warnstripes_Black_Yellow.png", + "size": 100607 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Material.Retroreflective_Material.png", + "size": 94344 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Material.Retroreflective_Material_Blue.png", + "size": 102885 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Material.Retroreflective_Material_Gray_Worn.png", + "size": 93014 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Material.Retroreflective_Material_Orange.png", + "size": 108306 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Material.Retroreflective_Material_Red.png", + "size": 107078 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Material.Retroreflective_Material_White.png", + "size": 96018 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Material.Retroreflective_Material_Yellow.png", + "size": 106421 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Tape.Retroreflective_Tape.png", + "size": 115120 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Tape.Retroreflective_Tape_Blue.png", + "size": 107676 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Tape.Retroreflective_Tape_Green.png", + "size": 118126 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Tape.Retroreflective_Tape_Orange.png", + "size": 117269 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Tape.Retroreflective_Tape_Red.png", + "size": 112884 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Tape.Retroreflective_Tape_White.png", + "size": 107237 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Tape.Retroreflective_Tape_Yellow_Worn.png", + "size": 115936 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Warnstripes.Retroreflective_Warnstripes.png", + "size": 110685 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Warnstripes.Retroreflective_Warnstripes_Black_White.png", + "size": 99780 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/.thumbs/Retroreflective_Warnstripes.Retroreflective_Warnstripes_Black_Yellow.png", + "size": 105979 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/Retroreflective_Material.mdl", + "size": 20467 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/Retroreflective_Tape.mdl", + "size": 28822 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/Retroreflective_Warnstripes.mdl", + "size": 27733 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/textures/diagonal_stripes.png", + "size": 3932 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/textures/glitter_noise_1k.png", + "size": 839543 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/textures/smudges_retro_paint.jpg", + "size": 2528999 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/textures/smudges_scratches_B_height.jpg", + "size": 1378528 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/textures/tape_patterns_hex_mask.png", + "size": 900324 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/textures/tape_patterns_norm.jpg", + "size": 382888 + }, + { + "key": "Materials/vMaterials_2/Other/Retroreflective/textures/tape_patterns_rounded_mask.png", + "size": 893953 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl.png", + "size": 83222 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Eraser_Blue.png", + "size": 68221 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Eraser_Gray.png", + "size": 64623 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Eraser_Red.png", + "size": 71119 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Eraser_White.png", + "size": 67909 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Black_Clean.png", + "size": 64562 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Black_Soft.png", + "size": 67083 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Black_Transparent.png", + "size": 73161 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Citrus_Clean.png", + "size": 81465 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Citrus_Soft.png", + "size": 80959 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Citrus_Transparent.png", + "size": 100536 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Grass_Clean.png", + "size": 76944 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Grass_Soft.png", + "size": 77847 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Grass_Transparent.png", + "size": 92232 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Lime_Clean.png", + "size": 81007 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Lime_Soft.png", + "size": 79996 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Lime_Transparent.png", + "size": 102402 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Mustard_Clean.png", + "size": 83561 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Mustard_Soft.png", + "size": 82726 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Mustard_Transparent.png", + "size": 104664 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Pink_Clean.png", + "size": 85337 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Pink_Soft.png", + "size": 84335 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Pink_Transparent.png", + "size": 105121 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Radish_Clean.png", + "size": 79396 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Radish_Soft.png", + "size": 78028 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Radish_Transparent.png", + "size": 97321 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Red_Clean.png", + "size": 79893 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Red_Soft.png", + "size": 80785 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Red_Transparent.png", + "size": 97195 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Tangerine_Clean.png", + "size": 81626 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Tangerine_Soft.png", + "size": 80964 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Tangerine_Transparent.png", + "size": 102694 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Turquoise_Clean.png", + "size": 82860 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Turquoise_Soft.png", + "size": 80850 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Turquoise_Transparent.png", + "size": 100726 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Ultra_Blue_Clean.png", + "size": 81706 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Ultra_Blue_Soft.png", + "size": 80605 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Latex_Ultra_Blue_Transparent.png", + "size": 100927 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Nitrile_Black_Clean.png", + "size": 64029 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Nitrile_Blue_Clean.png", + "size": 90703 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Nitrile_Cream_White_Clean.png", + "size": 102447 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Nitrile_Light_Blue_Clean.png", + "size": 108264 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Nitrile_Ultra_White_Clean.png", + "size": 104153 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Nitrile_Violet_Clean.png", + "size": 97194 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber.png", + "size": 83222 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Beet_Matte.png", + "size": 69813 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Beet_Shiny.png", + "size": 71541 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Black_Matte.png", + "size": 65911 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Black_Shiny.png", + "size": 66226 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Frog_Matte.png", + "size": 77948 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Frog_Shiny.png", + "size": 82951 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Heaven_Matte.png", + "size": 93632 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Heaven_Shiny.png", + "size": 97742 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Lemon_Matte.png", + "size": 91538 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Lemon_Shiny.png", + "size": 96276 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Lolly_Matte.png", + "size": 98066 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Lolly_Shiny.png", + "size": 101589 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Mandarin_Matte.png", + "size": 83813 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Mandarin_Shiny.png", + "size": 88762 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Orange_Matte.png", + "size": 97332 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Orange_Shiny.png", + "size": 100681 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Submarine_Matte.png", + "size": 77536 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Submarine_Shiny.png", + "size": 81632 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Turtle_Matte.png", + "size": 72839 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Turtle_Shiny.png", + "size": 76119 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Wine_Matte.png", + "size": 74874 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Rubber_Wine_Shiny.png", + "size": 76474 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Blue.png", + "size": 110150 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Blue_Matte.png", + "size": 106477 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Blue_Opaque.png", + "size": 95367 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Cream.png", + "size": 106010 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Cream_Matte.png", + "size": 103509 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Cream_Opaque.png", + "size": 94396 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Gray.png", + "size": 102486 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Gray_Matte.png", + "size": 99588 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Gray_Opaque.png", + "size": 82995 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Green.png", + "size": 102388 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Green_Matte.png", + "size": 97822 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Green_Opaque.png", + "size": 84800 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Light_Pink.png", + "size": 110454 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Light_Pink_Matte.png", + "size": 109842 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Light_Pink_Opaque.png", + "size": 104633 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Marone.png", + "size": 104224 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Marone_Matte.png", + "size": 100477 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Marone_Opaque.png", + "size": 85266 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Red.png", + "size": 109439 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Red_Matte.png", + "size": 105652 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Red_Opaque.png", + "size": 95729 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_White.png", + "size": 110129 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_White_Matte.png", + "size": 110050 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_White_Opaque.png", + "size": 97564 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Yellow.png", + "size": 117563 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Yellow_Matte.png", + "size": 115116 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Caoutchouc.mdl@Silicone_Yellow_Opaque.png", + "size": 106918 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Tire.mdl.png", + "size": 67516 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Tire.mdl@Tire.png", + "size": 67516 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Tire.mdl@Tire_Dusty.png", + "size": 77104 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Tire.mdl@Tire_New.png", + "size": 64308 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Tire.mdl@Tire_Offroad.png", + "size": 64230 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/256x256/Tire.mdl@Tire_Slick.png", + "size": 63102 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Eraser_Blue.png", + "size": 89138 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Eraser_Gray.png", + "size": 83198 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Eraser_Red.png", + "size": 94630 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Eraser_White.png", + "size": 91426 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Black_Clean.png", + "size": 92681 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Black_Soft.png", + "size": 89330 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Black_Transparent.png", + "size": 93530 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Citrus_Clean.png", + "size": 109071 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Citrus_Soft.png", + "size": 107121 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Citrus_Transparent.png", + "size": 119689 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Grass_Clean.png", + "size": 108204 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Grass_Soft.png", + "size": 104165 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Grass_Transparent.png", + "size": 107786 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Lime_Clean.png", + "size": 110555 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Lime_Soft.png", + "size": 108087 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Lime_Transparent.png", + "size": 119949 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Mustard_Clean.png", + "size": 114139 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Mustard_Soft.png", + "size": 111991 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Mustard_Transparent.png", + "size": 126118 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Pink_Clean.png", + "size": 118060 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Pink_Soft.png", + "size": 116020 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Pink_Transparent.png", + "size": 127918 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Radish_Clean.png", + "size": 110209 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Radish_Soft.png", + "size": 107069 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Radish_Transparent.png", + "size": 112165 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Red_Clean.png", + "size": 110566 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Red_Soft.png", + "size": 107753 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Red_Transparent.png", + "size": 118111 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Tangerine_Clean.png", + "size": 112401 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Tangerine_Soft.png", + "size": 110049 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Tangerine_Transparent.png", + "size": 122147 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Turquoise_Clean.png", + "size": 111560 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Turquoise_Soft.png", + "size": 108622 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Turquoise_Transparent.png", + "size": 118338 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Ultra_Blue_Clean.png", + "size": 111523 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Ultra_Blue_Soft.png", + "size": 107900 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Latex_Ultra_Blue_Transparent.png", + "size": 117491 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Nitrile_Black_Clean.png", + "size": 85665 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Nitrile_Blue_Clean.png", + "size": 103727 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Nitrile_Cream_White_Clean.png", + "size": 115840 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Nitrile_Light_Blue_Clean.png", + "size": 123548 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Nitrile_Ultra_White_Clean.png", + "size": 115106 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Nitrile_Violet_Clean.png", + "size": 111110 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber.png", + "size": 96551 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Beet_Matte.png", + "size": 90582 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Beet_Shiny.png", + "size": 98782 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Black_Matte.png", + "size": 85798 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Black_Shiny.png", + "size": 93165 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Frog_Matte.png", + "size": 98696 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Frog_Shiny.png", + "size": 106453 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Heaven_Matte.png", + "size": 107773 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Heaven_Shiny.png", + "size": 112650 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Lemon_Matte.png", + "size": 105026 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Lemon_Shiny.png", + "size": 110608 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Lolly_Matte.png", + "size": 112724 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Lolly_Shiny.png", + "size": 117828 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Mandarin_Matte.png", + "size": 101921 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Mandarin_Shiny.png", + "size": 108596 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Orange_Matte.png", + "size": 111249 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Orange_Shiny.png", + "size": 117004 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Submarine_Matte.png", + "size": 95905 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Submarine_Shiny.png", + "size": 102713 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Turtle_Matte.png", + "size": 94363 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Turtle_Shiny.png", + "size": 102209 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Wine_Matte.png", + "size": 96985 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Rubber_Wine_Shiny.png", + "size": 104563 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Blue.png", + "size": 125440 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Blue_Matte.png", + "size": 116173 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Blue_Opaque.png", + "size": 110292 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Cream.png", + "size": 120904 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Cream_Matte.png", + "size": 116931 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Cream_Opaque.png", + "size": 103509 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Gray.png", + "size": 115300 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Gray_Matte.png", + "size": 109005 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Gray_Opaque.png", + "size": 95810 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Green.png", + "size": 120006 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Green_Matte.png", + "size": 108149 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Green_Opaque.png", + "size": 106983 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Light_Pink.png", + "size": 130582 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Light_Pink_Matte.png", + "size": 128205 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Light_Pink_Opaque.png", + "size": 117977 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Marone.png", + "size": 122622 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Marone_Matte.png", + "size": 113074 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Marone_Opaque.png", + "size": 104120 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Red.png", + "size": 126261 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Red_Matte.png", + "size": 116297 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Red_Opaque.png", + "size": 112256 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_White.png", + "size": 123938 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_White_Matte.png", + "size": 122984 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_White_Opaque.png", + "size": 104716 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Yellow.png", + "size": 136175 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Yellow_Matte.png", + "size": 130023 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Caoutchouc.Silicone_Yellow_Opaque.png", + "size": 119001 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Tire.Tire.png", + "size": 85196 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Tire.Tire_Dusty.png", + "size": 88158 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Tire.Tire_New.png", + "size": 85450 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Tire.Tire_Offroad.png", + "size": 81967 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/.thumbs/Tire.Tire_Slick.png", + "size": 85134 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/Caoutchouc.mdl", + "size": 119746 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/Tire.mdl", + "size": 39563 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/textures/tire_fractal_sum_norm.jpg", + "size": 2790214 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/textures/tire_grunge_A_norm.jpg", + "size": 971609 + }, + { + "key": "Materials/vMaterials_2/Other/Rubber/textures/tire_multi_rough_R_fractal_sum_G_grungeA_B_BnWSpots3.jpg", + "size": 1098606 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl.png", + "size": 78221 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint.png", + "size": 78221 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Bark.png", + "size": 72720 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Black_Bean.png", + "size": 69971 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Charcoal_Blue.png", + "size": 71524 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Contemplation.png", + "size": 74902 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Dark_Forest.png", + "size": 71158 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Deep_Emerald.png", + "size": 72613 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Distance.png", + "size": 74013 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Elation.png", + "size": 77800 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Felted_Wool.png", + "size": 74555 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Misty.png", + "size": 77755 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Moonlight.png", + "size": 78133 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Moonstone.png", + "size": 77131 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Morning_Dew.png", + "size": 75299 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Night_Watch.png", + "size": 71219 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Origami.png", + "size": 78072 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Rose_Ash.png", + "size": 77470 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Roses.png", + "size": 77097 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Summernight.png", + "size": 70537 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint.mdl@Chalk_Paint_Wine.png", + "size": 72475 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl.png", + "size": 80126 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles.png", + "size": 80126 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Bark.png", + "size": 74036 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Black_Bean.png", + "size": 71176 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Charcoal_Blue.png", + "size": 72137 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Contemplation.png", + "size": 76381 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Dark_Forest.png", + "size": 72157 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Deep_Emerald.png", + "size": 74207 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Distance.png", + "size": 75511 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Elation.png", + "size": 79832 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Felted_Wool.png", + "size": 76634 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Misty.png", + "size": 79566 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Moonlight.png", + "size": 80441 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Moonstone.png", + "size": 79179 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Morning_Dew.png", + "size": 77074 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Night_Watch.png", + "size": 72022 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Origami.png", + "size": 80300 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Rose_Ash.png", + "size": 80125 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Roses.png", + "size": 79219 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Summernight.png", + "size": 71647 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Chalk_Paint_Pebbles.mdl@Chalk_Paint_Pebbles_Wine.png", + "size": 73472 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl.png", + "size": 99047 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint.png", + "size": 99047 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Aluminum.png", + "size": 99000 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Anthracite.png", + "size": 89884 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Black.png", + "size": 85612 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Brilliant_Blue.png", + "size": 97580 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Copper.png", + "size": 110752 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Dark_Red.png", + "size": 108145 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Gold.png", + "size": 101367 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Green.png", + "size": 104262 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Hammer_Paint.mdl@Hammer_Paint_Red.png", + "size": 107090 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl.png", + "size": 72047 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell.png", + "size": 72047 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Ash.png", + "size": 66679 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Burnt_Red.png", + "size": 71235 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Camel.png", + "size": 70707 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Cashmere.png", + "size": 71271 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Copper.png", + "size": 70841 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Denim.png", + "size": 67751 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Earth.png", + "size": 66963 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Leaf.png", + "size": 70178 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Light_Denim.png", + "size": 70073 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Lime.png", + "size": 72023 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Nude.png", + "size": 71923 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Pale_Rose.png", + "size": 71678 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Peach.png", + "size": 72253 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Sunny.png", + "size": 73879 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Taupe.png", + "size": 68101 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Teal.png", + "size": 72382 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_Vanilla.png", + "size": 72368 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Eggshell.mdl@Paint_Eggshell_White.png", + "size": 72450 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl.png", + "size": 78547 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal.png", + "size": 78547 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal_Black_0.png", + "size": 74965 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal_Black_25.png", + "size": 78557 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal_Black_50.png", + "size": 79868 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal_Black_75.png", + "size": 80165 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal_Gray_0.png", + "size": 73590 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal_Gray_25.png", + "size": 77610 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal_Gray_50.png", + "size": 79017 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/256x256/Paint_Gun_Metal.mdl@Paint_Gun_Metal_Gray_75.png", + "size": 79865 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint.png", + "size": 98118 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Bark.png", + "size": 90755 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Black_Bean.png", + "size": 87842 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Charcoal_Blue.png", + "size": 88485 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Contemplation.png", + "size": 93854 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Dark_Forest.png", + "size": 88837 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Deep_Emerald.png", + "size": 91495 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Distance.png", + "size": 92561 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Elation.png", + "size": 97409 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Felted_Wool.png", + "size": 94030 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Misty.png", + "size": 97193 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Moonlight.png", + "size": 97260 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Moonstone.png", + "size": 96336 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Morning_Dew.png", + "size": 94563 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Night_Watch.png", + "size": 89973 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Origami.png", + "size": 97540 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Rose_Ash.png", + "size": 97584 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Roses.png", + "size": 97838 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Summernight.png", + "size": 87719 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint.Chalk_Paint_Wine.png", + "size": 91302 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles.png", + "size": 97654 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Bark.png", + "size": 92078 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Black_Bean.png", + "size": 88499 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Charcoal_Blue.png", + "size": 89101 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Contemplation.png", + "size": 94699 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Dark_Forest.png", + "size": 89518 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Deep_Emerald.png", + "size": 92084 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Distance.png", + "size": 93627 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Elation.png", + "size": 98160 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Felted_Wool.png", + "size": 94543 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Misty.png", + "size": 97224 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Moonlight.png", + "size": 98193 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Moonstone.png", + "size": 96707 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Morning_Dew.png", + "size": 95057 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Night_Watch.png", + "size": 90650 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Origami.png", + "size": 98210 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Rose_Ash.png", + "size": 98227 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Roses.png", + "size": 98630 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Summernight.png", + "size": 88678 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Chalk_Paint_Pebbles.Chalk_Paint_Pebbles_Wine.png", + "size": 92451 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint.png", + "size": 109203 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Aluminum.png", + "size": 105656 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Anthracite.png", + "size": 101446 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Black.png", + "size": 100211 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Brilliant_Blue.png", + "size": 107982 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Copper.png", + "size": 118162 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Dark_Red.png", + "size": 115498 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Gold.png", + "size": 114883 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Green.png", + "size": 110421 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Hammer_Paint.Hammer_Paint_Red.png", + "size": 117615 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell.png", + "size": 99581 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Ash.png", + "size": 91731 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Burnt_Red.png", + "size": 102513 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Camel.png", + "size": 99306 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Cashmere.png", + "size": 99388 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Copper.png", + "size": 101366 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Denim.png", + "size": 93614 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Earth.png", + "size": 94880 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Leaf.png", + "size": 98756 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Light_Denim.png", + "size": 97975 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Lime.png", + "size": 102213 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Nude.png", + "size": 104772 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Pale_Rose.png", + "size": 103547 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Peach.png", + "size": 104090 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Sunny.png", + "size": 107702 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Taupe.png", + "size": 95115 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Teal.png", + "size": 103600 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_Vanilla.png", + "size": 101371 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Eggshell.Paint_Eggshell_White.png", + "size": 101496 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal.png", + "size": 83054 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal_Black_0.png", + "size": 75961 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal_Black_25.png", + "size": 83075 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal_Black_50.png", + "size": 87121 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal_Black_75.png", + "size": 89344 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal_Gray_0.png", + "size": 75963 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal_Gray_25.png", + "size": 83193 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal_Gray_50.png", + "size": 86712 + }, + { + "key": "Materials/vMaterials_2/Paint/.thumbs/Paint_Gun_Metal.Paint_Gun_Metal_Gray_75.png", + "size": 89086 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl.png", + "size": 119670 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Black_Monster_Flakes_Candy.png", + "size": 98873 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Blue_Intense_Candy_Coat.png", + "size": 112230 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Blue_Murdered_Candy_Coat.png", + "size": 112293 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Carpaint_Candy.png", + "size": 119670 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Green_Candy_Coat.png", + "size": 120365 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Green_Murdered_Candy_Coat.png", + "size": 102019 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Orange_Murdered_Candy_Coat.png", + "size": 115455 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Pinkie_Pie.png", + "size": 110537 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Purple_Candy_Madness.png", + "size": 112419 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Purple_Monster_Flakes.png", + "size": 123904 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Red_Candy_Coat.png", + "size": 99615 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Red_Murdered_Candy_Coat.png", + "size": 96420 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Candy.mdl@Yellow_Candy_Coat.png", + "size": 125260 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl.png", + "size": 97225 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Black_Sparkling_Metallic.png", + "size": 91352 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Bright_Silver_Metallic.png", + "size": 92972 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Carpaint_Metallic.png", + "size": 97225 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Cherry_Red_Metallic.png", + "size": 100833 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Dark_Gray_Metallic.png", + "size": 101145 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Dark_Red_Metallic.png", + "size": 94247 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Dark_Silver_Metallic.png", + "size": 109413 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Electric_Blue_Metallic.png", + "size": 117462 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Elegant_Blue_Metallic.png", + "size": 111951 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Emerald_Metallic.png", + "size": 107213 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Flaming_Orange_Metallic.png", + "size": 117877 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Gold_Metallic.png", + "size": 123796 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Golden_Flakes_Metallic.png", + "size": 114581 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Golden_Yellow_Metallic.png", + "size": 98393 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Graphite_Metallic.png", + "size": 93178 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Grass_Green_Metallic.png", + "size": 109514 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Gunmetal_Matte_Metallic.png", + "size": 98104 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Mocha_Metallic.png", + "size": 108234 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Pink_Glamour_Metallic.png", + "size": 128440 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Poseidon_Blue_Metallic.png", + "size": 94902 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Purple_Rain_Metallic.png", + "size": 135961 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Rainforest_Metallic.png", + "size": 105580 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Silverblue_Metallic.png", + "size": 112239 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Sparkling_Lime_Metallic.png", + "size": 124846 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Taupe_Metallic.png", + "size": 100398 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Teal_Metallic.png", + "size": 102322 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@Vintage_Turquoise_Metallic.png", + "size": 116504 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@White_Blue_Metallic.png", + "size": 94589 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@White_Light_Metallic.png", + "size": 99269 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@White_Silver_Metallic.png", + "size": 91343 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Metallic.mdl@White_Strong_Metallic.png", + "size": 117662 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl.png", + "size": 94653 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Andromeda.png", + "size": 121645 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Aquatic.png", + "size": 100360 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Bionic_Flare.png", + "size": 111213 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Blue_Purple_Emerald.png", + "size": 112316 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Blue_Saphire.png", + "size": 106111 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Carpaint_Shifting_Flakes.png", + "size": 94653 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Deep_Blue_Purple.png", + "size": 101377 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Desert_Wind.png", + "size": 104232 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Dimmed_Green.png", + "size": 109596 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Electric_Shimmer.png", + "size": 99550 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Elegant_Emerald.png", + "size": 102312 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Emerald_to_Blue.png", + "size": 93559 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Goblin_Fire.png", + "size": 99255 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Gold_Green_Purple.png", + "size": 107327 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Golden_Green_Intense.png", + "size": 99354 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Green_Aquatic.png", + "size": 109403 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Green_Dragon_Monsterflakes.png", + "size": 133566 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Magic_Green.png", + "size": 104932 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Nebular.png", + "size": 101844 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Petrol_Purple.png", + "size": 101378 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Poseidon.png", + "size": 94060 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Princess_Fire.png", + "size": 98807 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Purple_Red_Orange.png", + "size": 96228 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Red_Elegance.png", + "size": 99065 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Soft_Golden_Green.png", + "size": 100312 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Turquoise_Purple.png", + "size": 105327 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@Voodoo.png", + "size": 99282 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@White_Chameleon.png", + "size": 99941 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@White_to_Blue.png", + "size": 93439 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@White_to_Gold.png", + "size": 97023 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Shifting_Flakes.mdl@White_to_Purple.png", + "size": 92948 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl.png", + "size": 69819 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Agent_Gray.png", + "size": 70773 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Agent_Gray_Matte.png", + "size": 73922 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Black.png", + "size": 70666 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Black_Matte.png", + "size": 73059 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Blood_Red.png", + "size": 72907 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Blue.png", + "size": 74882 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Brown_Matte.png", + "size": 73082 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Bumblebee.png", + "size": 78187 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Carpaint_Solid.png", + "size": 69819 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Dark_Decent_Blue.png", + "size": 70511 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Dark_Decent_Red.png", + "size": 70538 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Feline_Dark_Green.png", + "size": 69646 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Hunting_Green_Matte.png", + "size": 74248 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Orange.png", + "size": 76958 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Tarreri_Red.png", + "size": 75428 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Vintage_Maroon.png", + "size": 72456 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Vintage_Sky_Blue.png", + "size": 73983 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Vintage_White.png", + "size": 72290 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@Wasp.png", + "size": 77266 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Carpaint_Solid.mdl@White.png", + "size": 71601 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl.png", + "size": 110904 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Aqua_Racer.png", + "size": 106849 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Borealis.png", + "size": 104867 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Candytron.png", + "size": 102973 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Deep_Purple.png", + "size": 99674 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Desert_Fire.png", + "size": 99358 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Goblin_Fire.png", + "size": 107893 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Golden_Green.png", + "size": 101362 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Golden_Lavender.png", + "size": 94662 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Pink_Slip.png", + "size": 106451 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Chameleon_Pigment_Scarabeus.png", + "size": 97720 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/256x256/Effect_Pigment_Metallic.mdl@Effect_Pigment_Metallic.png", + "size": 110904 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Black_Monster_Flakes_Candy.png", + "size": 114772 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Blue_Intense_Candy_Coat.png", + "size": 113405 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Blue_Murdered_Candy_Coat.png", + "size": 110501 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Carpaint_Candy.png", + "size": 119042 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Green_Candy_Coat.png", + "size": 118855 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Green_Murdered_Candy_Coat.png", + "size": 108553 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Orange_Murdered_Candy_Coat.png", + "size": 119217 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Pinkie_Pie.png", + "size": 113040 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Purple_Candy_Madness.png", + "size": 113445 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Purple_Monster_Flakes.png", + "size": 126117 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Red_Candy_Coat.png", + "size": 111521 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Red_Murdered_Candy_Coat.png", + "size": 112561 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Candy.Yellow_Candy_Coat.png", + "size": 121795 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Black_Sparkling_Metallic.png", + "size": 108362 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Bright_Silver_Metallic.png", + "size": 107845 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Carpaint_Metallic.png", + "size": 111463 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Cherry_Red_Metallic.png", + "size": 117886 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Dark_Gray_Metallic.png", + "size": 107515 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Dark_Red_Metallic.png", + "size": 114377 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Dark_Silver_Metallic.png", + "size": 110804 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Electric_Blue_Metallic.png", + "size": 123727 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Elegant_Blue_Metallic.png", + "size": 114653 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Emerald_Metallic.png", + "size": 115663 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Flaming_Orange_Metallic.png", + "size": 123143 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Gold_Metallic.png", + "size": 123834 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Golden_Flakes_Metallic.png", + "size": 123997 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Golden_Yellow_Metallic.png", + "size": 115253 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Graphite_Metallic.png", + "size": 102876 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Grass_Green_Metallic.png", + "size": 119437 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Gunmetal_Matte_Metallic.png", + "size": 104529 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Mocha_Metallic.png", + "size": 113322 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Pink_Glamour_Metallic.png", + "size": 120525 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Poseidon_Blue_Metallic.png", + "size": 108736 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Purple_Rain_Metallic.png", + "size": 126956 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Rainforest_Metallic.png", + "size": 118650 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Silverblue_Metallic.png", + "size": 112360 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Sparkling_Lime_Metallic.png", + "size": 125525 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Taupe_Metallic.png", + "size": 107460 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Teal_Metallic.png", + "size": 115071 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.Vintage_Turquoise_Metallic.png", + "size": 116736 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.White_Blue_Metallic.png", + "size": 109658 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.White_Light_Metallic.png", + "size": 106228 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.White_Silver_Metallic.png", + "size": 102554 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Metallic.White_Strong_Metallic.png", + "size": 113495 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Andromeda.png", + "size": 126965 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Aquatic.png", + "size": 117447 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Bionic_Flare.png", + "size": 122162 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Blue_Purple_Emerald.png", + "size": 122780 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Blue_Saphire.png", + "size": 116298 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Carpaint_Shifting_Flakes.png", + "size": 111646 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Deep_Blue_Purple.png", + "size": 113874 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Desert_Wind.png", + "size": 119208 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Dimmed_Green.png", + "size": 117861 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Electric_Shimmer.png", + "size": 116170 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Elegant_Emerald.png", + "size": 116457 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Emerald_to_Blue.png", + "size": 118744 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Goblin_Fire.png", + "size": 123635 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Gold_Green_Purple.png", + "size": 119070 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Golden_Green_Intense.png", + "size": 120163 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Green_Aquatic.png", + "size": 124584 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Green_Dragon_Monsterflakes.png", + "size": 129663 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Magic_Green.png", + "size": 123930 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Nebular.png", + "size": 127593 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Petrol_Purple.png", + "size": 113874 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Poseidon.png", + "size": 111326 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Princess_Fire.png", + "size": 117101 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Purple_Red_Orange.png", + "size": 121998 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Red_Elegance.png", + "size": 118350 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Soft_Golden_Green.png", + "size": 116830 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Turquoise_Purple.png", + "size": 119644 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.Voodoo.png", + "size": 113333 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.White_Chameleon.png", + "size": 109139 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.White_to_Blue.png", + "size": 107988 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.White_to_Gold.png", + "size": 105489 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Shifting_Flakes.White_to_Purple.png", + "size": 109347 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Agent_Gray.png", + "size": 97658 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Agent_Gray_Matte.png", + "size": 95137 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Black.png", + "size": 97498 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Black_Matte.png", + "size": 92811 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Blood_Red.png", + "size": 108243 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Blue.png", + "size": 108592 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Brown_Matte.png", + "size": 96536 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Bumblebee.png", + "size": 113413 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Carpaint_Solid.png", + "size": 98916 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Dark_Decent_Blue.png", + "size": 98802 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Dark_Decent_Red.png", + "size": 101255 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Feline_Dark_Green.png", + "size": 100288 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Hunting_Green_Matte.png", + "size": 96538 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Orange.png", + "size": 112248 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Tarreri_Red.png", + "size": 111460 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Vintage_Maroon.png", + "size": 104932 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Vintage_Sky_Blue.png", + "size": 105821 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Vintage_White.png", + "size": 101257 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.Wasp.png", + "size": 111164 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Carpaint_Solid.White.png", + "size": 99401 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Aqua_Racer.png", + "size": 125301 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Borealis.png", + "size": 125664 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Candytron.png", + "size": 130264 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Deep_Purple.png", + "size": 126260 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Desert_Fire.png", + "size": 123834 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Goblin_Fire.png", + "size": 128690 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Golden_Green.png", + "size": 122596 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Golden_Lavender.png", + "size": 123588 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Pink_Slip.png", + "size": 124708 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Chameleon_Pigment_Scarabeus.png", + "size": 125541 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/.thumbs/Effect_Pigment_Metallic.Effect_Pigment_Metallic.png", + "size": 131520 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/Carpaint_Candy.mdl", + "size": 38428 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/Carpaint_Metallic.mdl", + "size": 59254 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/Carpaint_Shifting_Flakes.mdl", + "size": 69757 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/Carpaint_Solid.mdl", + "size": 44622 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/Effect_Pigment_Metallic.mdl", + "size": 24658 + }, + { + "key": "Materials/vMaterials_2/Paint/Carpaint/textures/smudges_scratches_A_rough.jpg", + "size": 2669524 + }, + { + "key": "Materials/vMaterials_2/Paint/Chalk_Paint.mdl", + "size": 32028 + }, + { + "key": "Materials/vMaterials_2/Paint/Chalk_Paint_Pebbles.mdl", + "size": 33651 + }, + { + "key": "Materials/vMaterials_2/Paint/Hammer_Paint.mdl", + "size": 42265 + }, + { + "key": "Materials/vMaterials_2/Paint/Paint_Eggshell.mdl", + "size": 49992 + }, + { + "key": "Materials/vMaterials_2/Paint/Paint_Gun_Metal.mdl", + "size": 11309 + }, + { + "key": "Materials/vMaterials_2/Paint/textures/Chalk_Paint_Pebbles_multi_R_diff_G_rough_B_height.jpg", + "size": 3080694 + }, + { + "key": "Materials/vMaterials_2/Paint/textures/Chalk_Paint_Pebbles_norm.jpg", + "size": 2527304 + }, + { + "key": "Materials/vMaterials_2/Paint/textures/Chalk_Paint_Strokes_multi_R_diff_G_rough.jpg", + "size": 3062915 + }, + { + "key": "Materials/vMaterials_2/Paint/textures/Chalk_Paint_Strokes_norm.jpg", + "size": 4648796 + }, + { + "key": "Materials/vMaterials_2/Paint/textures/hammer_paint_multi_diff.jpg", + "size": 2306217 + }, + { + "key": "Materials/vMaterials_2/Paint/textures/hammer_paint_multi_rough.jpg", + "size": 2663725 + }, + { + "key": "Materials/vMaterials_2/Paint/textures/hammer_paint_norm.jpg", + "size": 1062448 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard.mdl.png", + "size": 86762 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard.mdl@Cardboard.png", + "size": 86762 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard.mdl@Cardboard_Worn.png", + "size": 85891 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard_Low_Quality.mdl.png", + "size": 91133 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard_Low_Quality.mdl@Cardboard_Low_Quality.png", + "size": 91133 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard_Low_Quality.mdl@Cardboard_Low_Quality_Burnt.png", + "size": 76615 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard_Low_Quality.mdl@Cardboard_Low_Quality_Corrugation.png", + "size": 98260 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard_Low_Quality.mdl@Cardboard_Low_Quality_Dirt.png", + "size": 85280 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Cardboard_Low_Quality.mdl@Cardboard_Low_Quality_Used.png", + "size": 93591 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Paper_Plain.mdl.png", + "size": 76793 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Paper_Plain.mdl@Paper_Coldpressed.png", + "size": 82384 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Paper_Plain.mdl@Paper_Coldpressed_Watercolor.png", + "size": 82329 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/256x256/Paper_Plain.mdl@Paper_Plain.png", + "size": 76793 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard.Cardboard.png", + "size": 77504 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard.Cardboard_Worn.png", + "size": 78114 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality.png", + "size": 79898 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_.png", + "size": 78299 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Burnt.png", + "size": 76193 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Corrugation.png", + "size": 81639 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Dirt.png", + "size": 78293 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Used.png", + "size": 79820 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Cardboard_Low_Quality.LQ_Simple_Cardboard.png", + "size": 79897 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Paper_Plain.Paper_Coldpressed.png", + "size": 80775 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Paper_Plain.Paper_Coldpressed_Watercolor.png", + "size": 80987 + }, + { + "key": "Materials/vMaterials_2/Paper/.thumbs/Paper_Plain.Paper_Plain.png", + "size": 91043 + }, + { + "key": "Materials/vMaterials_2/Paper/Cardboard.mdl", + "size": 13280 + }, + { + "key": "Materials/vMaterials_2/Paper/Cardboard_Low_Quality.mdl", + "size": 24831 + }, + { + "key": "Materials/vMaterials_2/Paper/Paper_Plain.mdl", + "size": 26704 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_new_01_diff.jpg", + "size": 571974 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_new_01_norm.jpg", + "size": 846694 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_new_01_rough.jpg", + "size": 1023937 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_norm2_ao.jpg", + "size": 458147 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_norm_2.jpg", + "size": 409531 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_normal_var.jpg", + "size": 23021 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_worn_01_diff.jpg", + "size": 690132 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_worn_01_norm.jpg", + "size": 781608 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/cardboard_worn_01_rough.jpg", + "size": 830892 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/lq_simple_cardboard_diff.jpg", + "size": 1565009 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/lq_simple_cardboard_multi.jpg", + "size": 1059215 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/lq_simple_cardboard_norm.jpg", + "size": 310615 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/paper_coldpressed_3_norm.jpg", + "size": 732513 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/paper_coldpressed_3_trans.jpg", + "size": 444225 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/paper_coldpressed_4_norm.jpg", + "size": 747919 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/paper_coldpressed_4_trans.jpg", + "size": 455166 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/paper_plain_norm.jpg", + "size": 818569 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/paper_plain_rough.jpg", + "size": 1123577 + }, + { + "key": "Materials/vMaterials_2/Paper/textures/paper_plain_trans.jpg", + "size": 319282 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Facade_Plaster_Rough.mdl.png", + "size": 104797 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Facade_Plaster_Rough.mdl@Facade_Plaster_Rough.png", + "size": 104797 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Facade_Plaster_Rough.mdl@Facade_Plaster_Rough_Bright_Dirt.png", + "size": 118187 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Facade_Plaster_Rough.mdl@Facade_Plaster_Rough_Dark_Dirt.png", + "size": 112114 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Facade_Plaster_Rough.mdl@Facade_Plaster_Rough_Matte.png", + "size": 105421 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Mosaic_Multi_Color_Stone.mdl.png", + "size": 135660 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Mosaic_Multi_Color_Stone.mdl@Mosaic_Multi_Color_Stone.png", + "size": 135660 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Mosaic_Multi_Color_Stone.mdl@Mosaic_Multi_Color_Stone_Ash.png", + "size": 128972 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Mosaic_Multi_Color_Stone.mdl@Mosaic_Multi_Color_Stone_Brown.png", + "size": 125322 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Mosaic_Multi_Color_Stone.mdl@Mosaic_Multi_Color_Stone_Red.png", + "size": 135234 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Plaster_Wall.mdl.png", + "size": 82937 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Plaster_Wall.mdl@Plaster_Wall.png", + "size": 82937 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Plaster_Wall.mdl@Plaster_Wall_Cracked.png", + "size": 87016 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Plaster_Wall.mdl@Plaster_Wall_Slightly_Cracked.png", + "size": 84611 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Plaster_Wall.mdl@Plaster_Wall_Weathered.png", + "size": 87937 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Stucco.mdl.png", + "size": 76263 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Stucco.mdl@Stucco.png", + "size": 76263 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Stucco.mdl@Stucco_Dirty.png", + "size": 84735 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Stucco.mdl@Stucco_Old_Repainted.png", + "size": 84340 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Stucco.mdl@Stucco_Shiny_Rough.png", + "size": 82965 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Stucco.mdl@Stucco_Slight_Dirt.png", + "size": 79407 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/256x256/Stucco.mdl@Stucco_Subtle_Dirt.png", + "size": 74488 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Facade_Plaster_Rough.Facade_Plaster_Rough.png", + "size": 110161 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Facade_Plaster_Rough.Facade_Plaster_Rough_Bright_Dirt.png", + "size": 122378 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Facade_Plaster_Rough.Facade_Plaster_Rough_Dark_Dirt.png", + "size": 117270 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Facade_Plaster_Rough.Facade_Plaster_Rough_Matte.png", + "size": 110449 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Mosaic_Multi_Color_Stone.Mosaic_Multi_Color_Stone.png", + "size": 98615 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Mosaic_Multi_Color_Stone.Mosaic_Multi_Color_Stone_Ash.png", + "size": 96153 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Mosaic_Multi_Color_Stone.Mosaic_Multi_Color_Stone_Brown.png", + "size": 96630 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Mosaic_Multi_Color_Stone.Mosaic_Multi_Color_Stone_Red.png", + "size": 98950 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Plaster_Wall.Plaster_Wall.png", + "size": 96479 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Plaster_Wall.Plaster_Wall_Cracked.png", + "size": 98617 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Plaster_Wall.Plaster_Wall_Slightly_Cracked.png", + "size": 97296 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Plaster_Wall.Plaster_Wall_Weathered.png", + "size": 100964 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Stucco.Stucco.png", + "size": 99960 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Stucco.Stucco_Dirty.png", + "size": 100558 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Stucco.Stucco_Old_Repainted.png", + "size": 101933 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Stucco.Stucco_Shiny_Rough.png", + "size": 100999 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Stucco.Stucco_Slight_Dirt.png", + "size": 100080 + }, + { + "key": "Materials/vMaterials_2/Plaster/.thumbs/Stucco.Stucco_Subtle_Dirt.png", + "size": 99259 + }, + { + "key": "Materials/vMaterials_2/Plaster/Facade_Plaster_Rough.mdl", + "size": 24565 + }, + { + "key": "Materials/vMaterials_2/Plaster/Mosaic_Multi_Color_Stone.mdl", + "size": 14203 + }, + { + "key": "Materials/vMaterials_2/Plaster/Plaster_Wall.mdl", + "size": 21520 + }, + { + "key": "Materials/vMaterials_2/Plaster/Stucco.mdl", + "size": 38920 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/deposits_norm.jpg", + "size": 256157 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/grunge_norm.jpg", + "size": 600366 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/mosaic_multi_color_stone_diff.jpg", + "size": 4426057 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/mosaic_multi_color_stone_multi_R_rough_G_ao_B_diffColor_mask.jpg", + "size": 5468176 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/mosaic_multi_color_stone_norm.jpg", + "size": 4552470 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/multi_R_diff_G_grunge_B_deposits.jpg", + "size": 1220603 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/plaster_rough_diff.jpg", + "size": 1955185 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/plaster_rough_multi_R_rough_G_ao_B_height.jpg", + "size": 3541609 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/plaster_rough_norm.jpg", + "size": 2677077 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/plaster_wall_cracks_norm.jpg", + "size": 844849 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/plaster_wall_multi_r_ao_g_grunge_b_diff.jpg", + "size": 5210314 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/plaster_wall_multi_r_rough_g_cracksmask_b_grunge2.jpg", + "size": 5170898 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/plaster_wall_norm.jpg", + "size": 4202535 + }, + { + "key": "Materials/vMaterials_2/Plaster/textures/stucco_norm.jpg", + "size": 646486 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl.png", + "size": 104569 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg.png", + "size": 104569 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg_Rough.png", + "size": 104100 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg_Shiny.png", + "size": 106955 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl.png", + "size": 81256 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask.png", + "size": 81256 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Black.png", + "size": 81924 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Black_Fast.png", + "size": 75502 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Blue.png", + "size": 79558 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Blue_Fast.png", + "size": 78579 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Green_Fast.png", + "size": 78624 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Red.png", + "size": 81678 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Red_Fast.png", + "size": 84203 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_White.png", + "size": 78748 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_White_Fast.png", + "size": 78349 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Yellow.png", + "size": 83903 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Yellow_Fast.png", + "size": 84535 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl.png", + "size": 129996 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl@PET_Clear.png", + "size": 129996 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl@PET_Smudged.png", + "size": 133179 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl.png", + "size": 74497 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish.png", + "size": 74497 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_Template_V2.png", + "size": 76903 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V12.png", + "size": 68533 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V15.png", + "size": 69789 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V18.png", + "size": 74666 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V21.png", + "size": 74564 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V24.png", + "size": 74557 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V27.png", + "size": 74584 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V30.png", + "size": 75922 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V33.png", + "size": 75873 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V36.png", + "size": 75970 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V39.png", + "size": 75872 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V42.png", + "size": 76222 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V45.png", + "size": 79302 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl.png", + "size": 103883 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@Plastic_Thick_Translucent.png", + "size": 103883 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_black.png", + "size": 79179 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_blue.png", + "size": 87005 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_blue.png", + "size": 82413 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_gray.png", + "size": 79979 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_green.png", + "size": 81249 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_orange.png", + "size": 88393 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_green.png", + "size": 85241 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_ivory_white.png", + "size": 79172 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_lemon.png", + "size": 92816 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_blue.png", + "size": 84031 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_gray.png", + "size": 79600 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_green.png", + "size": 87707 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_lime_green.png", + "size": 88191 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_magenta.png", + "size": 87150 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_orange.png", + "size": 89723 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_purple.png", + "size": 90088 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_red.png", + "size": 85995 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_simple_controls.png", + "size": 87952 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_sky_blue.png", + "size": 85308 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_teal.png", + "size": 86317 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_white.png", + "size": 78222 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_yellow_orange.png", + "size": 89303 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl.png", + "size": 115620 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@Plastic_Thick_Translucent_Flakes.png", + "size": 115620 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@metallic_plastic_simple_controls.png", + "size": 100613 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_black.png", + "size": 104492 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_blue.png", + "size": 103128 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_blue.png", + "size": 103159 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_gray.png", + "size": 101580 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_green.png", + "size": 104009 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_orange.png", + "size": 103925 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_green.png", + "size": 106144 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_ivory_white.png", + "size": 89591 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_lemon.png", + "size": 104029 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_blue.png", + "size": 95021 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_gray.png", + "size": 94122 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_green.png", + "size": 106345 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_lime_green.png", + "size": 103625 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_magenta.png", + "size": 101572 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_orange.png", + "size": 102704 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_purple.png", + "size": 104202 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_red.png", + "size": 105558 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_sky_blue.png", + "size": 99735 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_teal.png", + "size": 101931 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_white.png", + "size": 87764 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_yellow_orange.png", + "size": 101495 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl.png", + "size": 104393 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl@Polycarbonate_Clear.png", + "size": 104393 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl@Polycarbonate_Smudged.png", + "size": 110559 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl.png", + "size": 115748 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy.png", + "size": 115748 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Rough.png", + "size": 115804 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Soft.png", + "size": 111215 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Thick.png", + "size": 140133 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl.png", + "size": 86421 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Black.png", + "size": 66438 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Blue.png", + "size": 90938 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Blue.png", + "size": 89373 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Gray.png", + "size": 90091 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Green.png", + "size": 87344 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Orange.png", + "size": 88828 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Green.png", + "size": 90349 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Ivory.png", + "size": 83113 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Lemon.png", + "size": 90684 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Blue.png", + "size": 87180 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Gray.png", + "size": 90652 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Green.png", + "size": 89213 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Lime_Green.png", + "size": 88798 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Magenta.png", + "size": 91271 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Opaque.png", + "size": 86421 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Purple.png", + "size": 86390 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Red.png", + "size": 86838 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Sky_Blue.png", + "size": 90352 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Teal.png", + "size": 90524 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Yellow.png", + "size": 90137 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl.png", + "size": 130065 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl@Polycarbonate_Spectral_Clear.png", + "size": 130065 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl@Polycarbonate_Spectral_Smudges.png", + "size": 132643 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl.png", + "size": 129385 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl@Polyethylene_Clear.png", + "size": 129385 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl@Polyethylene_Smudged.png", + "size": 132542 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl.png", + "size": 115828 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy.png", + "size": 115828 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Rough.png", + "size": 115651 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Soft.png", + "size": 111647 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Thick.png", + "size": 139719 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl.png", + "size": 89077 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Black.png", + "size": 66277 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Blue.png", + "size": 90723 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Blue.png", + "size": 89680 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Gray.png", + "size": 89623 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Green.png", + "size": 87216 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Orange.png", + "size": 88816 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Green.png", + "size": 90340 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Ivory.png", + "size": 82945 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Lemon.png", + "size": 90874 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Blue.png", + "size": 87070 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Gray.png", + "size": 90837 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Green.png", + "size": 89105 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Lime_Green.png", + "size": 88546 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Magenta.png", + "size": 91041 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Opaque.png", + "size": 89077 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Purple.png", + "size": 86228 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Red.png", + "size": 86387 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Sky_Blue.png", + "size": 90115 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Teal.png", + "size": 90466 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Yellow.png", + "size": 90041 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl.png", + "size": 113812 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl@Polymethylmethacrylate_Clear.png", + "size": 113812 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl@Polymethylmethacrylate_Smudged.png", + "size": 95332 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl.png", + "size": 103330 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl@Polypropylene_Clear.png", + "size": 103330 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl@Polypropylene_Smudged.png", + "size": 108908 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl.png", + "size": 115860 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy.png", + "size": 115860 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Rough.png", + "size": 115617 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Soft.png", + "size": 111651 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Thick.png", + "size": 139718 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl.png", + "size": 87946 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Black.png", + "size": 65885 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Blue.png", + "size": 88253 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Blue.png", + "size": 87872 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Gray.png", + "size": 91893 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Green.png", + "size": 87031 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Orange.png", + "size": 88442 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Green.png", + "size": 89815 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Ivory.png", + "size": 83897 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Lemon.png", + "size": 89669 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Blue.png", + "size": 87300 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Gray.png", + "size": 90676 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Green.png", + "size": 88301 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Lime_Green.png", + "size": 87033 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Magenta.png", + "size": 89676 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Opaque.png", + "size": 87946 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Purple.png", + "size": 86444 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Red.png", + "size": 86045 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Sky_Blue.png", + "size": 88577 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Teal.png", + "size": 91019 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Yellow.png", + "size": 89242 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl.png", + "size": 130213 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl@Polystyrene_Clear.png", + "size": 130213 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl@Polystyrene_Smudged.png", + "size": 133310 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl.png", + "size": 102845 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl@Styrofoam.png", + "size": 102845 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl@Styrofoam_no_SSS.png", + "size": 105408 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg.png", + "size": 112222 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg_Rough.png", + "size": 110271 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg_Shiny.png", + "size": 113600 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask.png", + "size": 114401 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black.png", + "size": 107918 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black_Fast.png", + "size": 92589 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Blue.png", + "size": 104802 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Blue_Fast.png", + "size": 101508 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Green_Fast.png", + "size": 101836 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Red.png", + "size": 109961 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Red_Fast.png", + "size": 106835 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Smooth.png", + "size": 109393 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Soft.png", + "size": 112513 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White.png", + "size": 109308 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White_Fast.png", + "size": 97429 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Yellow.png", + "size": 114529 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Yellow_Fast.png", + "size": 105421 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PET_Clear.PET_Clear.png", + "size": 148432 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/PET_Clear.PET_Smudged.png", + "size": 147888 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish.png", + "size": 93946 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_Template_V2.png", + "size": 91527 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V12.png", + "size": 92218 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V15.png", + "size": 92478 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V18.png", + "size": 92793 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V21.png", + "size": 92810 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V24.png", + "size": 92811 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V27.png", + "size": 92716 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V30.png", + "size": 92018 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V33.png", + "size": 92033 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V36.png", + "size": 91976 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V39.png", + "size": 92159 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V42.png", + "size": 91941 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V45.png", + "size": 92191 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.Plastic_Thick_Translucent.png", + "size": 127073 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_black.png", + "size": 100692 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_blue.png", + "size": 113332 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_blue.png", + "size": 106816 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_gray.png", + "size": 101055 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_green.png", + "size": 108023 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_orange.png", + "size": 115204 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_green.png", + "size": 113679 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_ivory_white.png", + "size": 104409 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_lemon.png", + "size": 120033 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_blue.png", + "size": 111334 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_gray.png", + "size": 102222 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_green.png", + "size": 116818 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_lime_green.png", + "size": 115773 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_magenta.png", + "size": 115354 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_orange.png", + "size": 118088 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_purple.png", + "size": 117433 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_red.png", + "size": 112822 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_simple_controls.png", + "size": 113310 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_sky_blue.png", + "size": 114717 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_teal.png", + "size": 115008 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_white.png", + "size": 102741 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_yellow_orange.png", + "size": 118408 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.Plastic_Thick_Translucent_Flakes.png", + "size": 129715 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_black.png", + "size": 92934 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_blue.png", + "size": 97495 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_blue.png", + "size": 96193 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_gray.png", + "size": 88950 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_green.png", + "size": 95347 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_orange.png", + "size": 97332 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_green.png", + "size": 97576 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_ivory_white.png", + "size": 89935 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_lemon.png", + "size": 98358 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_blue.png", + "size": 93264 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_gray.png", + "size": 85208 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_green.png", + "size": 98340 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_lime_green.png", + "size": 96948 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_magenta.png", + "size": 95897 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_orange.png", + "size": 97893 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_purple.png", + "size": 97796 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_red.png", + "size": 97887 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_simple_controls.png", + "size": 117236 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_sky_blue.png", + "size": 95853 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_teal.png", + "size": 95886 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_white.png", + "size": 85592 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_yellow_orange.png", + "size": 97353 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_black.png", + "size": 114129 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_blue.png", + "size": 119571 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_blue.png", + "size": 116721 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_gray.png", + "size": 112644 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_green.png", + "size": 116366 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_orange.png", + "size": 119964 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_green.png", + "size": 121886 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_ivory_white.png", + "size": 108591 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lemon.png", + "size": 122685 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_blue.png", + "size": 114219 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_gray.png", + "size": 109353 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_green.png", + "size": 123431 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lime_green.png", + "size": 120813 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_magenta.png", + "size": 119486 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_orange.png", + "size": 121900 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_purple.png", + "size": 121204 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_red.png", + "size": 120197 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_sky_blue.png", + "size": 118426 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_teal.png", + "size": 119172 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_white.png", + "size": 106701 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_yellow_orange.png", + "size": 120604 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Clear.Polycarbonate_Clear.png", + "size": 122232 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Clear.Polycarbonate_Smudged.png", + "size": 118707 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy.png", + "size": 124668 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy_Rough.png", + "size": 125662 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy_Soft.png", + "size": 126884 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy_Thick.png", + "size": 155286 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Black.png", + "size": 96744 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Blue.png", + "size": 114694 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Blue.png", + "size": 109705 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Gray.png", + "size": 106135 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Green.png", + "size": 112472 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Orange.png", + "size": 115507 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Green.png", + "size": 116211 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Ivory.png", + "size": 106484 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Lemon.png", + "size": 113475 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Blue.png", + "size": 112194 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Gray.png", + "size": 106824 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Green.png", + "size": 116683 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Lime_Green.png", + "size": 115740 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Magenta.png", + "size": 116978 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Opaque.png", + "size": 105119 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Purple.png", + "size": 113677 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Red.png", + "size": 114201 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Sky_Blue.png", + "size": 113688 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Teal.png", + "size": 117042 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Yellow.png", + "size": 116701 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Spectral_Clear.Polycarbonate_Spectral_Clear.png", + "size": 148228 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polycarbonate_Spectral_Clear.Polycarbonate_Spectral_Smudges.png", + "size": 147980 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Clear.Polyethylene_Clear.png", + "size": 147792 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Clear.Polyethylene_Smudged.png", + "size": 147979 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy.png", + "size": 123472 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Rough.png", + "size": 124249 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Soft.png", + "size": 125870 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Thick.png", + "size": 154151 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Black.png", + "size": 97238 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Blue.png", + "size": 114730 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Blue.png", + "size": 110577 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Gray.png", + "size": 106476 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Green.png", + "size": 112896 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Orange.png", + "size": 115460 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Green.png", + "size": 116126 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Ivory.png", + "size": 106047 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Lemon.png", + "size": 113707 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Light_Blue.png", + "size": 112122 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Light_Gray.png", + "size": 107428 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Light_Green.png", + "size": 117412 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Lime_Green.png", + "size": 116346 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Magenta.png", + "size": 117320 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Opaque.png", + "size": 107872 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Purple.png", + "size": 113736 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Red.png", + "size": 114054 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Sky_Blue.png", + "size": 113484 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Teal.png", + "size": 117015 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Yellow.png", + "size": 116472 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polymethylmethacrylate_Clear.Polymethylmethacrylate_Clear.png", + "size": 139748 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polymethylmethacrylate_Clear.Polymethylmethacrylate_Smudged.png", + "size": 112414 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Clear.Polypropylene_Clear.png", + "size": 122381 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Clear.Polypropylene_Smudged.png", + "size": 118907 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy.png", + "size": 123468 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Rough.png", + "size": 124389 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Soft.png", + "size": 125903 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Thick.png", + "size": 153603 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Black.png", + "size": 93899 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Blue.png", + "size": 110202 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Blue.png", + "size": 105744 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Gray.png", + "size": 102629 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Green.png", + "size": 108303 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Orange.png", + "size": 110269 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Green.png", + "size": 112088 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Ivory.png", + "size": 102043 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Lemon.png", + "size": 108706 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Light_Blue.png", + "size": 107846 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Light_Gray.png", + "size": 101575 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Light_Green.png", + "size": 113152 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Lime_Green.png", + "size": 111051 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Magenta.png", + "size": 112605 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Opaque.png", + "size": 102031 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Purple.png", + "size": 109487 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Red.png", + "size": 110111 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Sky_Blue.png", + "size": 108891 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Teal.png", + "size": 113003 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Yellow.png", + "size": 112039 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polystyrene_Clear.Polystyrene_Clear.png", + "size": 148376 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Polystyrene_Clear.Polystyrene_Smudged.png", + "size": 147984 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Styrofoam.Styrofoam.png", + "size": 107646 + }, + { + "key": "Materials/vMaterials_2/Plastic/.thumbs/Styrofoam.Styrofoam_no_SSS.png", + "size": 111181 + }, + { + "key": "Materials/vMaterials_2/Plastic/PCB_Prepreg.mdl", + "size": 18478 + }, + { + "key": "Materials/vMaterials_2/Plastic/PCB_Solder_Mask.mdl", + "size": 37569 + }, + { + "key": "Materials/vMaterials_2/Plastic/PET_Clear.mdl", + "size": 19502 + }, + { + "key": "Materials/vMaterials_2/Plastic/Plastic_Standardized_Surface_Finish.mdl", + "size": 72251 + }, + { + "key": "Materials/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl", + "size": 30015 + }, + { + "key": "Materials/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl", + "size": 38565 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polycarbonate_Clear.mdl", + "size": 19505 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polycarbonate_Cloudy.mdl", + "size": 25849 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polycarbonate_Opaque.mdl", + "size": 38998 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polycarbonate_Spectral_Clear.mdl", + "size": 23489 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polyethylene_Clear.mdl", + "size": 19503 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polyethylene_Cloudy.mdl", + "size": 25863 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polyethylene_Opaque.mdl", + "size": 41237 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polymethylmethacrylate_Clear.mdl", + "size": 20330 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polypropylene_Clear.mdl", + "size": 19617 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polypropylene_Cloudy.mdl", + "size": 25862 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polypropylene_Opaque.mdl", + "size": 40875 + }, + { + "key": "Materials/vMaterials_2/Plastic/Polystyrene_Clear.mdl", + "size": 19498 + }, + { + "key": "Materials/vMaterials_2/Plastic/Styrofoam.mdl", + "size": 19067 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/mold_01_norm.jpg", + "size": 1618840 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/mold_01_rough.jpg", + "size": 2121591 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/mold_45_norm.jpg", + "size": 2582378 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/mold_45_r_rough_g_ao.jpg", + "size": 3582391 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/pcb_prepreg_diff.jpg", + "size": 407714 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/pcb_prepreg_norm.jpg", + "size": 548125 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/pcb_prepreg_rough.jpg", + "size": 393321 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/pcb_solder_mask_SSS.jpg", + "size": 137176 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/pcb_solder_mask_grey_diff.jpg", + "size": 2253464 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/pcb_solder_mask_norm.jpg", + "size": 1176401 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/pcb_solder_mask_rough.jpg", + "size": 1341287 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/plastic_smudges.jpg", + "size": 4078041 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/styrofoam_diff.jpg", + "size": 1493646 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/styrofoam_multi_R_rough_G_ao.jpg", + "size": 4296168 + }, + { + "key": "Materials/vMaterials_2/Plastic/textures/styrofoam_norm.jpg", + "size": 941408 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Ardesia_Grigia.mdl.png", + "size": 92608 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Ardesia_Grigia.mdl@Ardesia_Grigia.png", + "size": 92608 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Ardesia_Grigia.mdl@Ardesia_Grigia_Polished.png", + "size": 92039 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Ardesia_Grigia.mdl@Ardesia_Grigia_Polished_Dark.png", + "size": 94119 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Ardesia_Grigia.mdl@Ardesia_Grigia_Polished_Imperfections.png", + "size": 92995 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Ardesia_Grigia.mdl@Ardesia_Grigia_Worn.png", + "size": 100411 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Basaltite.mdl.png", + "size": 99466 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Basaltite.mdl@Basaltite.png", + "size": 99466 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Basaltite.mdl@Basaltite_Imperfections.png", + "size": 99334 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Basaltite.mdl@Basaltite_Polished.png", + "size": 99920 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Basaltite.mdl@Basaltite_Polished_Dark.png", + "size": 97848 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Basaltite.mdl@Basaltite_Worn.png", + "size": 100531 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl.png", + "size": 91300 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl@Devil_Black.png", + "size": 91300 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl@Devil_Black_Clean_Pollished.png", + "size": 93660 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl@Devil_Black_Dark.png", + "size": 79986 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl@Devil_Black_Grunge.png", + "size": 92417 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl@Devil_Black_Matte.png", + "size": 86484 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl@Devil_Black_Ripple.png", + "size": 94648 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl@Devil_Black_Satin.png", + "size": 92883 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Devil_Black.mdl@Devil_Black_Stain.png", + "size": 99191 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl.png", + "size": 116742 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@Granite_Polished.png", + "size": 116742 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@baltic_red.png", + "size": 117088 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@black_galaxy.png", + "size": 80396 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@blue_eyes.png", + "size": 110485 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@butterfly_verde.png", + "size": 117274 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@caledonia.png", + "size": 113892 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@castor_brown.png", + "size": 129913 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@emerald_pearl.png", + "size": 96221 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@giallo_fiorito.png", + "size": 122692 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@golden_galaxy.png", + "size": 112586 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@ice_kynite.png", + "size": 98080 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@morning_rose.png", + "size": 128938 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@tan_brown.png", + "size": 121228 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Granite_Polished.mdl@tiger_skin_gold.png", + "size": 129362 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Imperial_Red.mdl.png", + "size": 120541 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Imperial_Red.mdl@Imperial_Red.png", + "size": 120541 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Imperial_Red.mdl@Imperial_Red_Bleached.png", + "size": 119061 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Imperial_Red.mdl@Imperial_Red_Polished.png", + "size": 120846 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Imperial_Red.mdl@Imperial_Red_Polished_Imperfections.png", + "size": 119182 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Imperial_Red.mdl@Imperial_Red_Worn.png", + "size": 115100 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Padang_Dark_Gray.mdl.png", + "size": 116068 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Padang_Dark_Gray.mdl@Padang_Dark_Gray.png", + "size": 116068 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Padang_Dark_Gray.mdl@Padang_Dark_Gray_Polished.png", + "size": 110365 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Padang_Dark_Gray.mdl@Padang_Dark_Gray_Polished_Bright.png", + "size": 109320 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Padang_Dark_Gray.mdl@Padang_Dark_Gray_Polished_Imperfections.png", + "size": 108724 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Padang_Dark_Gray.mdl@Padang_Dark_Gray_Worn.png", + "size": 107813 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Rosa_Beta.mdl.png", + "size": 100238 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Rosa_Beta.mdl@Rosa_Beta.png", + "size": 100238 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Rosa_Beta.mdl@Rosa_Beta_Clean_Pollished.png", + "size": 101421 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Rosa_Beta.mdl@Rosa_Beta_Glossy_Stain.png", + "size": 99897 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Rosa_Beta.mdl@Rosa_Beta_Grunge.png", + "size": 99784 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Rosa_Beta.mdl@Rosa_Beta_Matte.png", + "size": 98902 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Rosa_Beta.mdl@Rosa_Beta_Satin.png", + "size": 97342 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Rosa_Beta.mdl@Rosa_Beta_Stain.png", + "size": 100026 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Serizzo_Gneis.mdl.png", + "size": 108688 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Serizzo_Gneis.mdl@Serizzo_Gneis.png", + "size": 108688 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Serizzo_Gneis.mdl@Serizzo_Gneis_Polished.png", + "size": 105248 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Serizzo_Gneis.mdl@Serizzo_Gneis_Polished_Dark.png", + "size": 108976 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Serizzo_Gneis.mdl@Serizzo_Gneis_Polished_Imperfections.png", + "size": 107192 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Serizzo_Gneis.mdl@Serizzo_Gneis_Worn.png", + "size": 109054 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Star_Galaxy.mdl.png", + "size": 103885 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Star_Galaxy.mdl@Star_Galaxy.png", + "size": 103885 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Star_Galaxy.mdl@Star_Galaxy_Dark.png", + "size": 78938 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Star_Galaxy.mdl@Star_Galaxy_Ice.png", + "size": 114181 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Star_Galaxy.mdl@Star_Galaxy_Polished.png", + "size": 105215 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Star_Galaxy.mdl@Star_Galaxy_Used.png", + "size": 111192 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl.png", + "size": 112110 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl@Steel_Grey.png", + "size": 112110 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl@Steel_Grey_Alabaster.png", + "size": 119663 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl@Steel_Grey_Bright.png", + "size": 119670 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl@Steel_Grey_Dark_Clean_Ripple.png", + "size": 100326 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl@Steel_Grey_Dark_Sprinkles.png", + "size": 110562 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl@Steel_Grey_Dust.png", + "size": 96878 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl@Steel_Grey_Polished.png", + "size": 113922 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Steel_Grey.mdl@Steel_Grey_Soft_Alabaster.png", + "size": 114942 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Mediterranean.mdl.png", + "size": 109487 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Mediterranean.mdl@Stone_Mediterranean.png", + "size": 109487 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Mediterranean.mdl@Stone_Mediterranean_Matte.png", + "size": 111786 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Mediterranean.mdl@Stone_Mediterranean_Warm_Matte.png", + "size": 117571 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Mediterranean.mdl@Stone_Mediterranean_Warm_Shiny.png", + "size": 116442 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Natural_Black.mdl.png", + "size": 88658 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Natural_Black.mdl@Stone_Natural_Black.png", + "size": 88658 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Natural_Black.mdl@Stone_Natural_Black_Matte.png", + "size": 87587 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Stone_Natural_Black.mdl@Stone_Natural_Black_Shiny.png", + "size": 94543 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Terrazzo.mdl.png", + "size": 122719 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Terrazzo.mdl@Terrazzo.png", + "size": 122719 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Terrazzo.mdl@Terrazzo_Diffuse_Clean.png", + "size": 102163 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Terrazzo.mdl@Terrazzo_Dry_Matt.png", + "size": 119617 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Terrazzo.mdl@Terrazzo_Footprints.png", + "size": 102619 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Terrazzo.mdl@Terrazzo_Freckled_Highlights.png", + "size": 103073 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Terrazzo.mdl@Terrazzo_Shiny_Clean.png", + "size": 121890 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Terrazzo.mdl@Terrazzo_Speckled_Spots.png", + "size": 110203 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Volga_Blue.mdl.png", + "size": 112925 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Volga_Blue.mdl@Volga_Blue.png", + "size": 112925 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Volga_Blue.mdl@Volga_Blue_Bright_Blue.png", + "size": 119155 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Volga_Blue.mdl@Volga_Blue_Darken.png", + "size": 109208 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Volga_Blue.mdl@Volga_Blue_Deep_Pollished.png", + "size": 109096 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/256x256/Volga_Blue.mdl@Volga_Blue_Imperfections.png", + "size": 112752 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Ardesia_Grigia.Ardesia_Grigia.png", + "size": 91702 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Ardesia_Grigia.Ardesia_Grigia_Polished.png", + "size": 91206 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Ardesia_Grigia.Ardesia_Grigia_Polished_Dark.png", + "size": 90514 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Ardesia_Grigia.Ardesia_Grigia_Polished_Imperfections.png", + "size": 92481 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Ardesia_Grigia.Ardesia_Grigia_Worn.png", + "size": 98131 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Basaltite.Basaltite.png", + "size": 90156 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Basaltite.Basaltite_Imperfections.png", + "size": 92046 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Basaltite.Basaltite_Polished.png", + "size": 90757 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Basaltite.Basaltite_Polished_Dark.png", + "size": 90216 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Basaltite.Basaltite_Worn.png", + "size": 94367 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Devil_Black.Devil_Black.png", + "size": 78557 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Devil_Black.Devil_Black_Clean_Pollished.png", + "size": 79768 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Devil_Black.Devil_Black_Dark.png", + "size": 74962 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Devil_Black.Devil_Black_Grunge.png", + "size": 77938 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Devil_Black.Devil_Black_Matte.png", + "size": 75102 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Devil_Black.Devil_Black_Ripple.png", + "size": 79103 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Devil_Black.Devil_Black_Satin.png", + "size": 80819 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Devil_Black.Devil_Black_Stain.png", + "size": 84539 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.Granite_Polished.png", + "size": 95934 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.baltic_red.png", + "size": 95766 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.black_galaxy.png", + "size": 73944 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.blue_eyes.png", + "size": 98461 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.butterfly_verde.png", + "size": 94704 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.caledonia.png", + "size": 100092 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.castor_brown.png", + "size": 100296 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.emerald_pearl.png", + "size": 81786 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.giallo_fiorito.png", + "size": 101292 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.golden_galaxy.png", + "size": 98533 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.ice_kynite.png", + "size": 83335 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.morning_rose.png", + "size": 112139 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.tan_brown.png", + "size": 99415 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Granite_Polished.tiger_skin_gold.png", + "size": 107443 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Imperial_Red.Imperial_Red.png", + "size": 103343 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Imperial_Red.Imperial_Red_Bleached.png", + "size": 103940 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Imperial_Red.Imperial_Red_Polished.png", + "size": 104252 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Imperial_Red.Imperial_Red_Polished_Imperfections.png", + "size": 103625 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Imperial_Red.Imperial_Red_Worn.png", + "size": 103509 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Padang_Dark_Gray.Padang_Dark_Gray.png", + "size": 95976 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Padang_Dark_Gray.Padang_Dark_Gray_Polished.png", + "size": 97317 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Padang_Dark_Gray.Padang_Dark_Gray_Polished_Bright.png", + "size": 96869 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Padang_Dark_Gray.Padang_Dark_Gray_Polished_Imperfections.png", + "size": 97294 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Padang_Dark_Gray.Padang_Dark_Gray_Worn.png", + "size": 98922 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Rosa_Beta.Rosa_Beta.png", + "size": 92960 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Rosa_Beta.Rosa_Beta_Clean_Pollished.png", + "size": 93633 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Rosa_Beta.Rosa_Beta_Glossy_Stain.png", + "size": 93437 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Rosa_Beta.Rosa_Beta_Grunge.png", + "size": 89522 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Rosa_Beta.Rosa_Beta_Matte.png", + "size": 89419 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Rosa_Beta.Rosa_Beta_Satin.png", + "size": 87363 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Rosa_Beta.Rosa_Beta_Stain.png", + "size": 90233 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Serizzo_Gneis.Serizzo_Gneis.png", + "size": 97830 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Serizzo_Gneis.Serizzo_Gneis_Polished.png", + "size": 97594 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Serizzo_Gneis.Serizzo_Gneis_Polished_Dark.png", + "size": 96910 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Serizzo_Gneis.Serizzo_Gneis_Polished_Imperfections.png", + "size": 97632 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Serizzo_Gneis.Serizzo_Gneis_Worn.png", + "size": 100801 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Star_Galaxy.Star_Galaxy.png", + "size": 93855 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Star_Galaxy.Star_Galaxy_Dark.png", + "size": 76333 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Star_Galaxy.Star_Galaxy_Ice.png", + "size": 99712 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Star_Galaxy.Star_Galaxy_Polished.png", + "size": 89651 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Star_Galaxy.Star_Galaxy_Used.png", + "size": 95237 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Alabaster.png", + "size": 110739 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Dark_Sprinkles.png", + "size": 104670 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Dust.png", + "size": 94887 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Grey.png", + "size": 95900 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Grey_Alabaster.png", + "size": 106668 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Grey_Bright.png", + "size": 106813 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Grey_Dark_Clean_Ripple.png", + "size": 87872 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Grey_Dark_Sprinkles.png", + "size": 101408 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Grey_Dust.png", + "size": 92910 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Grey_Polished.png", + "size": 99935 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Grey_Soft_Alabaster.png", + "size": 105439 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Steel_Grey.Steel_Soft_Alabaster.png", + "size": 110072 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Stone_Mediterranean.Stone_Mediterranean.png", + "size": 94336 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Stone_Mediterranean.Stone_Mediterranean_Matte.png", + "size": 92545 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Stone_Mediterranean.Stone_Mediterranean_Warm_Matte.png", + "size": 96339 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Stone_Mediterranean.Stone_Mediterranean_Warm_Shiny.png", + "size": 97868 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Stone_Natural_Black.Stone_Natural_Black.png", + "size": 73846 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Stone_Natural_Black.Stone_Natural_Black_Matte.png", + "size": 73234 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Stone_Natural_Black.Stone_Natural_Black_Shiny.png", + "size": 76555 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Terrazzo.Terrazzo.png", + "size": 104083 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Terrazzo.Terrazzo_Diffuse_Clean.png", + "size": 81913 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Terrazzo.Terrazzo_Dry_Matt.png", + "size": 99726 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Terrazzo.Terrazzo_Footprints.png", + "size": 82659 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Terrazzo.Terrazzo_Freckled_Highlights.png", + "size": 82932 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Terrazzo.Terrazzo_Shiny_Clean.png", + "size": 102132 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Terrazzo.Terrazzo_Speckled_Spots.png", + "size": 90078 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Volga_Blue.Volga_Blue.png", + "size": 106109 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Volga_Blue.Volga_Blue_Bright_Blue.png", + "size": 107729 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Volga_Blue.Volga_Blue_Darken.png", + "size": 94030 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Volga_Blue.Volga_Blue_Deep_Pollished.png", + "size": 99818 + }, + { + "key": "Materials/vMaterials_2/Stone/.thumbs/Volga_Blue.Volga_Blue_Imperfections.png", + "size": 106789 + }, + { + "key": "Materials/vMaterials_2/Stone/Ardesia_Grigia.mdl", + "size": 43713 + }, + { + "key": "Materials/vMaterials_2/Stone/Basaltite.mdl", + "size": 44504 + }, + { + "key": "Materials/vMaterials_2/Stone/Devil_Black.mdl", + "size": 35846 + }, + { + "key": "Materials/vMaterials_2/Stone/Granite_Polished.mdl", + "size": 57043 + }, + { + "key": "Materials/vMaterials_2/Stone/Imperial_Red.mdl", + "size": 45314 + }, + { + "key": "Materials/vMaterials_2/Stone/Padang_Dark_Gray.mdl", + "size": 45608 + }, + { + "key": "Materials/vMaterials_2/Stone/Rosa_Beta.mdl", + "size": 34731 + }, + { + "key": "Materials/vMaterials_2/Stone/Serizzo_Gneis.mdl", + "size": 43553 + }, + { + "key": "Materials/vMaterials_2/Stone/Star_Galaxy.mdl", + "size": 44726 + }, + { + "key": "Materials/vMaterials_2/Stone/Steel_Grey.mdl", + "size": 46630 + }, + { + "key": "Materials/vMaterials_2/Stone/Stone_Mediterranean.mdl", + "size": 22721 + }, + { + "key": "Materials/vMaterials_2/Stone/Stone_Natural_Black.mdl", + "size": 19572 + }, + { + "key": "Materials/vMaterials_2/Stone/Terrazzo.mdl", + "size": 34735 + }, + { + "key": "Materials/vMaterials_2/Stone/Volga_Blue.mdl", + "size": 37812 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/ardesia_diff.jpg", + "size": 1228720 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/ardesia_norm.jpg", + "size": 2289029 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/ardesia_rough.jpg", + "size": 2290473 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/ardesia_sss.jpg", + "size": 74574 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/baltic_brown_diff.png", + "size": 2771642 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/baltic_red_diff.png", + "size": 2668604 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/basaltite_SSS.jpg", + "size": 121633 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/basaltite_diff.jpg", + "size": 3195838 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/basaltite_norm.jpg", + "size": 2102895 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/basaltite_rough.jpg", + "size": 2088769 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/butterfly_verde_diff.png", + "size": 2716838 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/caledonia_diff.png", + "size": 2374679 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/castor_brown_diff.png", + "size": 740456 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/devil_black_diff.jpg", + "size": 1429451 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/devil_black_multi.jpg", + "size": 2569701 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/devil_black_norm.jpg", + "size": 1430148 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/emerald_pearl_diff.png", + "size": 2021780 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/giallo_fiorito_diff.png", + "size": 2881757 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/golden_galaxy_diff.png", + "size": 2569736 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/granite_a_mask.png", + "size": 23794 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/granite_blackgalaxy_diff.png", + "size": 4664039 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/granite_blue_eyes_diff.png", + "size": 2295032 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/ice_kynite_diff.png", + "size": 1939858 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/imperial_red_diff.jpg", + "size": 2972038 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/imperial_red_multi_R_rough_G_ao_B_spots.jpg", + "size": 4562741 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/imperial_red_norm.jpg", + "size": 2553628 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/imperial_red_sss.jpg", + "size": 150191 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/morning_rose_diff.png", + "size": 1907021 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/multi_R_dust_G_scratches_B_smudges.jpg", + "size": 6670331 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/multi_R_dust_G_scratches_B_smudges_2.jpg", + "size": 5263860 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/natural_stone_black_diff.jpg", + "size": 3222459 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/natural_stone_black_multi_R_rough_G_ao_B_height.jpg", + "size": 5667377 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/natural_stone_black_norm.jpg", + "size": 2556587 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/padang_dark_grey_SSS.jpg", + "size": 304110 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/padang_dark_grey_diff.jpg", + "size": 3314015 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/padang_dark_grey_multi_R_rough_G_ao_B_height.jpg", + "size": 2237145 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/padang_dark_grey_norm.jpg", + "size": 2439286 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/rosa_beta_diff.jpg", + "size": 2917078 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/rosa_beta_multi.jpg", + "size": 2149130 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/rosa_beta_norm.jpg", + "size": 2029762 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/serizzo_gneis_SSS.jpg", + "size": 100054 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/serizzo_gneis_diff.jpg", + "size": 2959477 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/serizzo_gneis_norm.jpg", + "size": 3661347 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/serizzo_gneis_rough.jpg", + "size": 1927741 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/star_galaxy_SSS.jpg", + "size": 219559 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/star_galaxy_diff.jpg", + "size": 3367147 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/star_galaxy_multi_R_rough_G_height_B_ao.jpg", + "size": 4158753 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/star_galaxy_norm.jpg", + "size": 2320972 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/steel_grey_diff.jpg", + "size": 2130749 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/steel_grey_diff_SSS.jpg", + "size": 141978 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/steel_grey_multi_R_rough_G_height_B_ao.jpg", + "size": 1025405 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/steel_grey_norm.jpg", + "size": 992362 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/stone_mediterranian_diff.jpg", + "size": 2739321 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/stone_mediterranian_multi_R_rough_G_ao.jpg", + "size": 4658372 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/stone_mediterranian_norm.jpg", + "size": 2925626 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/tan_brown_diff.png", + "size": 1156353 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/terrazzo_diff.jpg", + "size": 3473291 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/terrazzo_multi.jpg", + "size": 3942743 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/terrazzo_norm.jpg", + "size": 4382846 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/tiger_skin_gold_diff.png", + "size": 2122580 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/volga_blue_diff.jpg", + "size": 2026304 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/volga_blue_multi_R_trans_G_height_B_rough.jpg", + "size": 939698 + }, + { + "key": "Materials/vMaterials_2/Stone/textures/volga_blue_norm.jpg", + "size": 569089 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Laminate_Oak.mdl.png", + "size": 96189 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Laminate_Oak.mdl@Laminate_Oak.png", + "size": 96189 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Laminate_Oak.mdl@Laminate_Oak_Dirty.png", + "size": 92168 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Laminate_Oak.mdl@Laminate_Oak_Polished.png", + "size": 94203 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Laminate_Oak.mdl@Laminate_Oak_Slight_Smudges.png", + "size": 93209 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/OSB_Wood.mdl.png", + "size": 109237 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/OSB_Wood.mdl@OSB_Wood.png", + "size": 109237 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/OSB_Wood.mdl@OSB_Wood_Shiny.png", + "size": 109609 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/OSB_Wood_Splattered.mdl.png", + "size": 112441 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/OSB_Wood_Splattered.mdl@OSB_Wood_Splattered.png", + "size": 112441 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/OSB_Wood_Splattered.mdl@OSB_Wood_Splattered_Dense.png", + "size": 116586 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Bark.mdl.png", + "size": 106858 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Bark.mdl@Wood_Bark.png", + "size": 106858 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Bark.mdl@bark_oak_dark_contrast.png", + "size": 106305 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Cork.mdl.png", + "size": 119240 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Cork.mdl@Wood_Cork.png", + "size": 119240 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Cork.mdl@Wood_Cork_Coated_Glossy.png", + "size": 115178 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Cork.mdl@Wood_Cork_Coated_Matte.png", + "size": 114809 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl.png", + "size": 89434 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash.png", + "size": 89434 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Brickbond.png", + "size": 95110 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Chantilly.png", + "size": 98022 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Chevron.png", + "size": 101234 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Cubes.png", + "size": 98718 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Diagonal.png", + "size": 100327 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Herringbone.png", + "size": 100860 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Mosaic.png", + "size": 97332 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Stackbond.png", + "size": 94591 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Versailles.png", + "size": 100950 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash.mdl@Wood_Tiles_Ash_Woodstrip.png", + "size": 95148 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash_Multicolor.mdl.png", + "size": 105785 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash_Multicolor.mdl@Wood_Tiles_Ash_Large_Star.png", + "size": 105538 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash_Multicolor.mdl@Wood_Tiles_Ash_Melbury.png", + "size": 105498 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash_Multicolor.mdl@Wood_Tiles_Ash_Multicolor.png", + "size": 105785 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Ash_Multicolor.mdl@Wood_Tiles_Ash_Stars.png", + "size": 105800 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl.png", + "size": 91217 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech.png", + "size": 91217 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Brickbond.png", + "size": 90071 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Chantilly.png", + "size": 91079 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Chevron.png", + "size": 95466 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Cubes.png", + "size": 94352 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Diagonal.png", + "size": 94554 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Herringbone.png", + "size": 95268 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Mosaic.png", + "size": 92784 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Stackbond.png", + "size": 89407 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Versailles.png", + "size": 95052 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech.mdl@Wood_Tiles_Beech_Woodstrip.png", + "size": 90055 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech_Multicolor.mdl.png", + "size": 92621 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech_Multicolor.mdl@Wood_Tiles_Beech_Large_Star.png", + "size": 99322 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech_Multicolor.mdl@Wood_Tiles_Beech_Melbury.png", + "size": 96135 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech_Multicolor.mdl@Wood_Tiles_Beech_Multicolor.png", + "size": 92621 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Beech_Multicolor.mdl@Wood_Tiles_Beech_Stars.png", + "size": 99600 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl.png", + "size": 86056 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline.png", + "size": 86056 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Brickbond.png", + "size": 86825 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Chantilly.png", + "size": 87808 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Chevron.png", + "size": 90867 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Cubes.png", + "size": 90222 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Diagonal.png", + "size": 91073 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Herringbone.png", + "size": 91228 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Mosaic.png", + "size": 88742 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Stackbond.png", + "size": 85889 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Versailles.png", + "size": 90498 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline.mdl@Wood_Tiles_Fineline_Woodstrip.png", + "size": 86041 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline_Multicolor.mdl.png", + "size": 96485 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline_Multicolor.mdl@Wood_Tiles_Fineline_Large_Star.png", + "size": 99172 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline_Multicolor.mdl@Wood_Tiles_Fineline_Melbury.png", + "size": 98681 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline_Multicolor.mdl@Wood_Tiles_Fineline_Multicolor.png", + "size": 96485 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Fineline_Multicolor.mdl@Wood_Tiles_Fineline_Stars.png", + "size": 94134 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl.png", + "size": 92947 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain.png", + "size": 92947 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Brickbond.png", + "size": 92925 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Chantilly.png", + "size": 93806 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Chevron.png", + "size": 98487 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Cubes.png", + "size": 97448 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Diagonal.png", + "size": 98369 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Herringbone.png", + "size": 97776 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Mosaic.png", + "size": 94624 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Stackbond.png", + "size": 91866 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Versailles.png", + "size": 98100 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain.mdl@Wood_Tiles_Oak_Mountain_Woodstrip.png", + "size": 92633 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain_Multicolor.mdl.png", + "size": 102546 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain_Multicolor.mdl@Wood_Tiles_Oak_Mountain_Large_Star.png", + "size": 104478 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain_Multicolor.mdl@Wood_Tiles_Oak_Mountain_Melbury.png", + "size": 103439 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain_Multicolor.mdl@Wood_Tiles_Oak_Mountain_Multicolor.png", + "size": 102546 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Oak_Mountain_Multicolor.mdl@Wood_Tiles_Oak_Mountain_Stars.png", + "size": 105771 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl.png", + "size": 95048 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine.png", + "size": 95048 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Brickbond.png", + "size": 100578 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Chantilly.png", + "size": 103070 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Chevron.png", + "size": 110272 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Cubes.png", + "size": 106925 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Diagonal.png", + "size": 106041 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Herringbone.png", + "size": 108961 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Mosaic.png", + "size": 102654 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Stackbond.png", + "size": 98757 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Versailles.png", + "size": 108806 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine.mdl@Wood_Tiles_Pine_Woodstrip.png", + "size": 100246 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine_Multicolor.mdl.png", + "size": 100330 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine_Multicolor.mdl@Wood_Tiles_Pine_Large_Star.png", + "size": 99475 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine_Multicolor.mdl@Wood_Tiles_Pine_Melbury.png", + "size": 99984 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine_Multicolor.mdl@Wood_Tiles_Pine_Multicolor.png", + "size": 100330 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Pine_Multicolor.mdl@Wood_Tiles_Pine_Stars.png", + "size": 100879 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl.png", + "size": 108225 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar.png", + "size": 108225 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Brickbond.png", + "size": 108376 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Chantilly.png", + "size": 109023 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Chevron.png", + "size": 113928 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Cubes.png", + "size": 115060 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Diagonal.png", + "size": 111795 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Herringbone.png", + "size": 113684 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Mosaic.png", + "size": 111845 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Stackbond.png", + "size": 106551 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Versailles.png", + "size": 113740 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar.mdl@Wood_Tiles_Poplar_Woodstrip.png", + "size": 106790 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar_Multicolor.mdl.png", + "size": 113012 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar_Multicolor.mdl@Wood_Tiles_Poplar_Large_Star.png", + "size": 111747 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar_Multicolor.mdl@Wood_Tiles_Poplar_Melbury.png", + "size": 112366 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar_Multicolor.mdl@Wood_Tiles_Poplar_Multicolor.png", + "size": 113012 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Poplar_Multicolor.mdl@Wood_Tiles_Poplar_Stars.png", + "size": 111603 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl.png", + "size": 88878 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut.png", + "size": 88878 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Brickbond.png", + "size": 86868 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Chantilly.png", + "size": 86746 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Chevron.png", + "size": 90569 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Cubes.png", + "size": 89187 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Diagonal.png", + "size": 90086 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Herringbone.png", + "size": 89982 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Mosaic.png", + "size": 88188 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Stackbond.png", + "size": 85676 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Versailles.png", + "size": 89963 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut.mdl@Wood_Tiles_Walnut_Woodstrip.png", + "size": 86167 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut_Multicolor.mdl.png", + "size": 95286 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut_Multicolor.mdl@Wood_Tiles_Walnut_Large_Star.png", + "size": 97640 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut_Multicolor.mdl@Wood_Tiles_Walnut_Melbury.png", + "size": 99254 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut_Multicolor.mdl@Wood_Tiles_Walnut_Multicolor.png", + "size": 95286 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/256x256/Wood_Tiles_Walnut_Multicolor.mdl@Wood_Tiles_Walnut_Stars.png", + "size": 99103 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Laminate_Oak.Laminate_Oak.png", + "size": 85382 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Laminate_Oak.Laminate_Oak_Dirty.png", + "size": 85607 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Laminate_Oak.Laminate_Oak_Polished.png", + "size": 84467 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Laminate_Oak.Laminate_Oak_Slight_Smudges.png", + "size": 85889 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/OSB_Wood.OSB_Wood.png", + "size": 96132 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/OSB_Wood.OSB_Wood_Shiny.png", + "size": 95773 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/OSB_Wood_Splattered.OSB_Wood_Splattered.png", + "size": 98779 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/OSB_Wood_Splattered.OSB_Wood_Splattered_Dense.png", + "size": 102921 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Bark.Wood_Bark.png", + "size": 95091 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Bark.bark_oak_dark_contrast.png", + "size": 94920 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Cork.Wood_Cork.png", + "size": 99812 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Cork.Wood_Cork_Coated_Glossy.png", + "size": 97696 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Cork.Wood_Cork_Coated_Matte.png", + "size": 98089 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash.png", + "size": 90994 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Brickbond.png", + "size": 91058 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Chantilly.png", + "size": 91585 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Chevron.png", + "size": 91664 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Cubes.png", + "size": 91509 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Diagonal.png", + "size": 91333 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Herringbone.png", + "size": 91592 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Mosaic.png", + "size": 91655 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Stackbond.png", + "size": 90863 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Versailles.png", + "size": 92317 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash.Wood_Tiles_Ash_Woodstrip.png", + "size": 90799 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash_Multicolor.Wood_Tiles_Ash_Large_Star.png", + "size": 117425 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash_Multicolor.Wood_Tiles_Ash_Melbury.png", + "size": 116832 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash_Multicolor.Wood_Tiles_Ash_Multicolor.png", + "size": 117230 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Ash_Multicolor.Wood_Tiles_Ash_Stars.png", + "size": 122178 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech.png", + "size": 93877 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Brickbond.png", + "size": 94838 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Chantilly.png", + "size": 93353 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Chevron.png", + "size": 96792 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Cubes.png", + "size": 94316 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Diagonal.png", + "size": 96349 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Herringbone.png", + "size": 97297 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Mosaic.png", + "size": 95461 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Stackbond.png", + "size": 94943 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Versailles.png", + "size": 95140 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech.Wood_Tiles_Beech_Woodstrip.png", + "size": 95208 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech_Multicolor.Wood_Tiles_Beech_Large_Star.png", + "size": 99600 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech_Multicolor.Wood_Tiles_Beech_Melbury.png", + "size": 100692 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech_Multicolor.Wood_Tiles_Beech_Multicolor.png", + "size": 100723 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Beech_Multicolor.Wood_Tiles_Beech_Stars.png", + "size": 110150 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline.png", + "size": 78522 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Brickbond.png", + "size": 78677 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Chantilly.png", + "size": 78595 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Chevron.png", + "size": 78993 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Cubes.png", + "size": 78978 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Diagonal.png", + "size": 78527 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Herringbone.png", + "size": 78963 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Mosaic.png", + "size": 78630 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Stackbond.png", + "size": 78830 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Versailles.png", + "size": 79012 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline.Wood_Tiles_Fineline_Woodstrip.png", + "size": 78882 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline_Multicolor.Wood_Tiles_Fineline_Large_Star.png", + "size": 89648 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline_Multicolor.Wood_Tiles_Fineline_Melbury.png", + "size": 90197 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline_Multicolor.Wood_Tiles_Fineline_Multicolor.png", + "size": 89711 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Fineline_Multicolor.Wood_Tiles_Fineline_Stars.png", + "size": 88627 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain.png", + "size": 90425 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Brickbond.png", + "size": 91266 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Chantilly.png", + "size": 90633 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Chevron.png", + "size": 92816 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Cubes.png", + "size": 91293 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Diagonal.png", + "size": 92603 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Herringbone.png", + "size": 92985 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Mosaic.png", + "size": 91985 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Stackbond.png", + "size": 91620 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Versailles.png", + "size": 91810 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain.Wood_Tiles_Oak_Mountain_Woodstrip.png", + "size": 91137 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain_Multicolor.Wood_Tiles_Oak_Mountain_Large_Star.png", + "size": 104763 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain_Multicolor.Wood_Tiles_Oak_Mountain_Melbury.png", + "size": 104943 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain_Multicolor.Wood_Tiles_Oak_Mountain_Multicolor.png", + "size": 104191 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Oak_Mountain_Multicolor.Wood_Tiles_Oak_Mountain_Stars.png", + "size": 105841 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine.png", + "size": 98208 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Brickbond.png", + "size": 110250 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Chantilly.png", + "size": 109766 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Chevron.png", + "size": 111916 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Cubes.png", + "size": 110304 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Diagonal.png", + "size": 110917 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Herringbone.png", + "size": 111740 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Mosaic.png", + "size": 109693 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Stackbond.png", + "size": 110487 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Versailles.png", + "size": 111648 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine.Wood_Tiles_Pine_Woodstrip.png", + "size": 110238 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine_Multicolor.Wood_Tiles_Pine_Large_Star.png", + "size": 106716 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine_Multicolor.Wood_Tiles_Pine_Melbury.png", + "size": 107176 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine_Multicolor.Wood_Tiles_Pine_Multicolor.png", + "size": 107356 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Pine_Multicolor.Wood_Tiles_Pine_Stars.png", + "size": 116268 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar.png", + "size": 102080 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Brickbond.png", + "size": 101980 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Chantilly.png", + "size": 101109 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Chevron.png", + "size": 102872 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Cubes.png", + "size": 101314 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Diagonal.png", + "size": 102011 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Herringbone.png", + "size": 103178 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Mosaic.png", + "size": 101333 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Stackbond.png", + "size": 101748 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Versailles.png", + "size": 102046 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Woodstrip.png", + "size": 101619 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar_Multicolor.Wood_Tiles_Poplar_Large_Star.png", + "size": 110267 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar_Multicolor.Wood_Tiles_Poplar_Melbury.png", + "size": 113366 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar_Multicolor.Wood_Tiles_Poplar_Multicolor.png", + "size": 113245 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Poplar_Multicolor.Wood_Tiles_Poplar_Stars.png", + "size": 114071 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut.png", + "size": 83990 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Brickbond.png", + "size": 83692 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Chantilly.png", + "size": 83404 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Chevron.png", + "size": 84475 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Cubes.png", + "size": 83547 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Diagonal.png", + "size": 84261 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Herringbone.png", + "size": 84432 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Mosaic.png", + "size": 84022 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Stackbond.png", + "size": 83995 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Versailles.png", + "size": 83879 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut.Wood_Tiles_Walnut_Woodstrip.png", + "size": 83675 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut_Multicolor.Wood_Tiles_Walnut_Large_Star.png", + "size": 93386 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut_Multicolor.Wood_Tiles_Walnut_Melbury.png", + "size": 94085 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut_Multicolor.Wood_Tiles_Walnut_Multicolor.png", + "size": 93190 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/Wood_Tiles_Walnut_Multicolor.Wood_Tiles_Walnut_Stars.png", + "size": 95075 + }, + { + "key": "Materials/vMaterials_2/Wood/.thumbs/wood_tiles_master.Wood_Tiles_Master.png", + "size": 108599 + }, + { + "key": "Materials/vMaterials_2/Wood/Laminate_Oak.mdl", + "size": 22504 + }, + { + "key": "Materials/vMaterials_2/Wood/OSB_Wood.mdl", + "size": 23775 + }, + { + "key": "Materials/vMaterials_2/Wood/OSB_Wood_Splattered.mdl", + "size": 36730 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Bark.mdl", + "size": 19496 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Cork.mdl", + "size": 27375 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Ash.mdl", + "size": 125151 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Ash_Multicolor.mdl", + "size": 67974 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Beech.mdl", + "size": 125107 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Beech_Multicolor.mdl", + "size": 67822 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Fineline.mdl", + "size": 125203 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Fineline_Multicolor.mdl", + "size": 67926 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Oak_Mountain.mdl", + "size": 126038 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Oak_Mountain_Multicolor.mdl", + "size": 68265 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Pine.mdl", + "size": 124893 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Pine_Multicolor.mdl", + "size": 67863 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Poplar.mdl", + "size": 125101 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Poplar_Multicolor.mdl", + "size": 67954 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Walnut.mdl", + "size": 125453 + }, + { + "key": "Materials/vMaterials_2/Wood/Wood_Tiles_Walnut_Multicolor.mdl", + "size": 67949 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/bark_oak_diff.jpg", + "size": 3536361 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/bark_oak_mask.jpg", + "size": 353747 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/bark_oak_multi_R_rough_G_ao_B_height.jpg", + "size": 2938574 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/bark_oak_norm.jpg", + "size": 4029866 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/beech_diff.jpg", + "size": 2485806 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/beech_norm.jpg", + "size": 2935873 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/beech_rough_detail.jpg", + "size": 2615350 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/beech_rough_grain.jpg", + "size": 4395520 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/brick_bond_R_id_G_offs_B_rotation.png", + "size": 629024 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/brickbond_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5190594 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/brickbond_R_id_G_offs_B_rotation.png", + "size": 61671 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/brickbond_norm.png", + "size": 5097857 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/chantilly_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5192773 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/chantilly_R_id_G_offs_B_rotation.png", + "size": 165856 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/chantilly_norm.png", + "size": 5219533 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/chevron_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5561847 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/chevron_R_id_G_offs_B_rotation.png", + "size": 253093 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/chevron_norm.png", + "size": 7660298 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/concrete_diff.jpg", + "size": 393786 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/cubes_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5282713 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/cubes_R_id_G_offs_B_rotation.png", + "size": 188376 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/cubes_norm.png", + "size": 5932734 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/diagonal_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5507965 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/diagonal_R_id_G_offs_B_rotation.png", + "size": 278035 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/diagonal_norm.png", + "size": 7421414 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/fineline_diff.jpg", + "size": 2216725 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/fineline_norm.jpg", + "size": 2748933 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/fineline_rough_detail.jpg", + "size": 2583516 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/fineline_rough_grain.jpg", + "size": 1592267 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/herringbone_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5509842 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/herringbone_R_id_G_offs_B_rotation.png", + "size": 304083 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/herringbone_norm.png", + "size": 7592872 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/laminate_oak_diffuse.jpg", + "size": 2467433 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/laminate_oak_multi_R_rough_G_aniso.jpg", + "size": 10480809 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/laminate_oak_normal.jpg", + "size": 5397470 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/melbury_R_2ndcol_G_randmask.png", + "size": 101532 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/melbury_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 1797932 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/melbury_R_id_G_offset_B_rotation.png", + "size": 101682 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/melbury_norm.jpg", + "size": 838401 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/mosaic_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5345943 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/mosaic_R_id_G_offs_B_rotation.png", + "size": 74735 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/mosaic_norm.png", + "size": 5988778 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/osb_wood_R_rough_G_ao_B_rough.jpg", + "size": 4379360 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/osb_wood_diff.jpg", + "size": 2100435 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/osb_wood_norm.jpg", + "size": 2307539 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/pine_diff.jpg", + "size": 2419340 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/pine_norm.jpg", + "size": 1272881 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/pine_rough_detail.jpg", + "size": 3036865 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/pine_rough_grain.jpg", + "size": 2082660 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/poplar_diff.jpg", + "size": 3410789 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/poplar_norm.jpg", + "size": 1169507 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/poplar_rough_detail.jpg", + "size": 3708895 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/poplar_rough_grain.jpg", + "size": 3693382 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/splatter_splatter_mask.jpg", + "size": 926117 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/splatter_splatter_norm.jpg", + "size": 1351911 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/stackbond_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5339370 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/stackbond_R_id_G_offs_B_rotation.png", + "size": 622237 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/stackbond_norm.png", + "size": 5205492 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/star_large_R_2ndcol_G_randmask.png", + "size": 91048 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/star_large_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 2562678 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/star_large_R_id_G_offset_B_rotation.png", + "size": 91272 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/star_large_norm.jpg", + "size": 713268 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/stars_R_2ndcol_G_randmask.png", + "size": 157719 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/stars_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 3172876 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/stars_R_id_G_offset_B_rotation.png", + "size": 147169 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/stars_norm.jpg", + "size": 985488 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/tiles_wood_R_rough_G_dents_B_spots.jpg", + "size": 5318464 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/tiles_wood_orangepeel_norm.jpg", + "size": 583443 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/versailles_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5489803 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/versailles_R_id_G_offs_B_rotation.png", + "size": 164987 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/versailles_norm.png", + "size": 6678546 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_ash_diff.jpg", + "size": 1554112 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_ash_norm.jpg", + "size": 1942937 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_ash_rough_detail.jpg", + "size": 1838898 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_ash_rough_grain.jpg", + "size": 1596434 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_cork_diff.jpg", + "size": 3859074 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_cork_grunge.jpg", + "size": 2393991 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_cork_multi_R_rough_G_ao_B_height.jpg", + "size": 4519965 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_cork_norm.jpg", + "size": 4510495 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_oak_mountain_diff.jpg", + "size": 2735022 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_oak_mountain_norm.jpg", + "size": 2047800 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_oak_mountain_rough_detail.jpg", + "size": 3414660 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_oak_mountain_rough_grain.jpg", + "size": 1815090 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_walnut_diff.jpg", + "size": 3337031 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_walnut_norm.jpg", + "size": 4247942 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_walnut_rough_detail.jpg", + "size": 2973831 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/wood_walnut_rough_grain.jpg", + "size": 2695681 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/woodstrip_R_edgewear_G_gaps_B_gaps_rough.jpg", + "size": 5342612 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/woodstrip_R_id_G_offs_B_rotation.png", + "size": 525457 + }, + { + "key": "Materials/vMaterials_2/Wood/textures/woodstrip_norm.png", + "size": 5122769 + } + ] +} \ No newline at end of file diff --git a/vendor/libigl/include/igl/AABB.cpp b/vendor/libigl/include/igl/AABB.cpp new file mode 100644 index 0000000000000000000000000000000000000000..672e9b705ec984a0019c3ae981b0b12045526bbc --- /dev/null +++ b/vendor/libigl/include/igl/AABB.cpp @@ -0,0 +1,1070 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "AABB.h" +#include "EPS.h" +#include "barycenter.h" +#include "colon.h" +#include "doublearea.h" +#include "point_simplex_squared_distance.h" +#include "project_to_line_segment.h" +#include "sort.h" +#include "volume.h" +#include "ray_box_intersect.h" +#include "parallel_for.h" +#include "ray_mesh_intersect.h" +#include +#include +#include +#include +#include +#include + +template +template +IGL_INLINE void igl::AABB::init( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const Eigen::MatrixBase & bb_mins, + const Eigen::MatrixBase & bb_maxs, + const Eigen::MatrixBase & elements, + const int i) +{ + using namespace std; + using namespace Eigen; + deinit(); + if(bb_mins.size() > 0) + { + assert(bb_mins.rows() == bb_maxs.rows() && "Serial tree arrays must match"); + assert(bb_mins.cols() == V.cols() && "Serial tree array dim must match V"); + assert(bb_mins.cols() == bb_maxs.cols() && "Serial tree arrays must match"); + assert(bb_mins.rows() == elements.rows() && + "Serial tree arrays must match"); + // construct from serialization + m_box.extend(bb_mins.row(i).transpose()); + m_box.extend(bb_maxs.row(i).transpose()); + m_primitive = elements(i); + // Not leaf then recurse + if(m_primitive == -1) + { + m_left = new AABB(); + m_left->init( V,Ele,bb_mins,bb_maxs,elements,2*i+1); + m_right = new AABB(); + m_right->init( V,Ele,bb_mins,bb_maxs,elements,2*i+2); + //m_depth = std::max( m_left->m_depth, m_right->m_depth)+1; + } + }else + { + VectorXi allI = colon(0,Ele.rows()-1); + MatrixXDIMS BC; + if(Ele.cols() == 1) + { + // points + BC = V; + }else + { + // Simplices + barycenter(V,Ele,BC); + } + MatrixXi SI(BC.rows(),BC.cols()); + { + MatrixXDIMS _; + MatrixXi IS; + igl::sort(BC,1,true,_,IS); + // Need SI(i) to tell which place i would be sorted into + const int dim = IS.cols(); + for(int i = 0;i +template +void igl::AABB::init( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele) +{ + using namespace Eigen; + // deinit will be immediately called... + return init(V,Ele,MatrixXDIMS(),MatrixXDIMS(),VectorXi(),0); +} + + template +template < + typename DerivedEle, + typename DerivedSI, + typename DerivedI> +IGL_INLINE void igl::AABB::init( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const Eigen::MatrixBase & SI, + const Eigen::MatrixBase & I) +{ + using namespace Eigen; + using namespace std; + deinit(); + if(V.size() == 0 || Ele.size() == 0 || I.size() == 0) + { + return; + } + assert(DIM == V.cols() && "V.cols() should matched declared dimension"); + //const Scalar inf = numeric_limits::infinity(); + m_box = AlignedBox(); + // Compute bounding box + for(int i = 0;iint + { + size_t n = (A.size()-1)/2; + nth_element(A.data(),A.data()+n,A.data()+A.size()); + return A(n); + }; + const int med = median(SIdI); + VectorXi LI((I.rows()+1)/2),RI(I.rows()/2); + assert(LI.rows()+RI.rows() == I.rows()); + // Distribute left and right + { + int li = 0; + int ri = 0; + for(int i = 0;i0) + { + m_left = new AABB(); + m_left->init(V,Ele,SI,LI); + //m_depth = std::max(m_depth, m_left->m_depth+1); + } + if(RI.rows()>0) + { + m_right = new AABB(); + m_right->init(V,Ele,SI,RI); + //m_depth = std::max(m_depth, m_right->m_depth+1); + } + } + } +} + +template +IGL_INLINE bool igl::AABB::is_leaf() const +{ + return m_primitive != -1; +} + +template +template +IGL_INLINE std::vector igl::AABB::find( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const Eigen::MatrixBase & q, + const bool first) const +{ + using namespace std; + using namespace Eigen; + assert(q.size() == DIM && + "Query dimension should match aabb dimension"); + assert(Ele.cols() == V.cols()+1 && + "AABB::find only makes sense for (d+1)-simplices"); + const Scalar epsilon = igl::EPS(); + // Check if outside bounding box + bool inside = m_box.contains(q.transpose()); + if(!inside) + { + return std::vector(); + } + assert(m_primitive==-1 || (m_left == NULL && m_right == NULL)); + if(is_leaf()) + { + // Initialize to some value > -epsilon + Scalar a1=0,a2=0,a3=0,a4=0; + switch(DIM) + { + case 3: + { + // Barycentric coordinates + typedef Eigen::Matrix RowVector3S; + const RowVector3S V1 = V.row(Ele(m_primitive,0)); + const RowVector3S V2 = V.row(Ele(m_primitive,1)); + const RowVector3S V3 = V.row(Ele(m_primitive,2)); + const RowVector3S V4 = V.row(Ele(m_primitive,3)); + a1 = volume_single(V2,V4,V3,(RowVector3S)q); + a2 = volume_single(V1,V3,V4,(RowVector3S)q); + a3 = volume_single(V1,V4,V2,(RowVector3S)q); + a4 = volume_single(V1,V2,V3,(RowVector3S)q); + break; + } + case 2: + { + // Barycentric coordinates + typedef Eigen::Matrix Vector2S; + const Vector2S V1 = V.row(Ele(m_primitive,0)); + const Vector2S V2 = V.row(Ele(m_primitive,1)); + const Vector2S V3 = V.row(Ele(m_primitive,2)); + // Hack for now to keep templates simple. If becomes bottleneck + // consider using std::enable_if_t + const Vector2S q2 = q.head(2); + a1 = doublearea_single(V1,V2,q2); + a2 = doublearea_single(V2,V3,q2); + a3 = doublearea_single(V3,V1,q2); + break; + } + default:assert(false); + } + // Normalization is important for correcting sign + Scalar sum = a1+a2+a3+a4; + a1 /= sum; + a2 /= sum; + a3 /= sum; + a4 /= sum; + if( + a1>=-epsilon && + a2>=-epsilon && + a3>=-epsilon && + a4>=-epsilon) + { + return std::vector(1,m_primitive); + }else + { + return std::vector(); + } + } + std::vector left = m_left->find(V,Ele,q,first); + if(first && !left.empty()) + { + return left; + } + std::vector right = m_right->find(V,Ele,q,first); + if(first) + { + return right; + } + left.insert(left.end(),right.begin(),right.end()); + return left; +} + +template +IGL_INLINE int igl::AABB::subtree_size() const +{ + // 1 for self + int n = 1; + int n_left = 0,n_right = 0; + if(m_left != NULL) + { + n_left = m_left->subtree_size(); + } + if(m_right != NULL) + { + n_right = m_right->subtree_size(); + } + n += 2*std::max(n_left,n_right); + return n; +} + + +template +template +IGL_INLINE void igl::AABB::serialize( + Eigen::PlainObjectBase & bb_mins, + Eigen::PlainObjectBase & bb_maxs, + Eigen::PlainObjectBase & elements, + const int i) const +{ + using namespace std; + using namespace Eigen; + // Calling for root then resize output + if(i==0) + { + const int m = subtree_size(); + //cout<<"m: "<serialize(bb_mins,bb_maxs,elements,2*i+1); + } + if(m_right != NULL) + { + m_right->serialize(bb_mins,bb_maxs,elements,2*i+2); + } +} + +template +template +IGL_INLINE typename igl::AABB::Scalar +igl::AABB::squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + int & i, + Eigen::PlainObjectBase & c) const +{ + return squared_distance(V,Ele,p,std::numeric_limits::infinity(),i,c); +} + + +template +template +IGL_INLINE typename igl::AABB::Scalar +igl::AABB::squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + Scalar low_sqr_d, + Scalar up_sqr_d, + int & i, + Eigen::PlainObjectBase & c) const +{ + using namespace Eigen; + using namespace std; + //assert(low_sqr_d <= up_sqr_d); + if(low_sqr_d > up_sqr_d) + { + return low_sqr_d; + } + Scalar sqr_d = up_sqr_d; + //assert(DIM == 3 && "Code has only been tested for DIM == 3"); + assert((Ele.cols() == 3 || Ele.cols() == 2 || Ele.cols() == 1) + && "Code has only been tested for simplex sizes 3,2,1"); + + assert(m_primitive==-1 || (m_left == NULL && m_right == NULL)); + if(is_leaf()) + { + leaf_squared_distance(V,Ele,p,low_sqr_d,sqr_d,i,c); + }else + { + bool looked_left = false; + bool looked_right = false; + const auto & look_left = [&]() + { + int i_left; + RowVectorDIMS c_left = c; + Scalar sqr_d_left = + m_left->squared_distance(V,Ele,p,low_sqr_d,sqr_d,i_left,c_left); + this->set_min(p,sqr_d_left,i_left,c_left,sqr_d,i,c); + looked_left = true; + }; + const auto & look_right = [&]() + { + int i_right; + RowVectorDIMS c_right = c; + Scalar sqr_d_right = + m_right->squared_distance(V,Ele,p,low_sqr_d,sqr_d,i_right,c_right); + this->set_min(p,sqr_d_right,i_right,c_right,sqr_d,i,c); + looked_right = true; + }; + + // must look left or right if in box + if(m_left->m_box.contains(p.transpose())) + { + look_left(); + } + if(m_right->m_box.contains(p.transpose())) + { + look_right(); + } + // if haven't looked left and could be less than current min, then look + Scalar left_up_sqr_d = + m_left->m_box.squaredExteriorDistance(p.transpose()); + Scalar right_up_sqr_d = + m_right->m_box.squaredExteriorDistance(p.transpose()); + if(left_up_sqr_d < right_up_sqr_d) + { + if(!looked_left && left_up_sqr_d +template +IGL_INLINE typename igl::AABB::Scalar +igl::AABB::squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + Scalar up_sqr_d, + int & i, + Eigen::PlainObjectBase & c) const +{ + return squared_distance(V,Ele,p,0.0,up_sqr_d,i,c); +} + +template +template < + typename DerivedEle, + typename DerivedP, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> +IGL_INLINE void igl::AABB::squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const Eigen::MatrixBase & P, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) const +{ + assert(P.cols() == V.cols() && "cols in P should match dim of cols in V"); + sqrD.resize(P.rows(),1); + I.resize(P.rows(),1); + C.resizeLike(P); + // O( #P * log #Ele ), where log #Ele is really the depth of this AABB + // hierarchy + //for(int p = 0;p +template < + typename DerivedEle, + typename Derivedother_V, + typename Derivedother_Ele, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> +IGL_INLINE void igl::AABB::squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const AABB & other, + const Eigen::MatrixBase & other_V, + const Eigen::MatrixBase & other_Ele, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) const +{ + assert(other_Ele.cols() == 1 && + "Only implemented for other as list of points"); + assert(other_V.cols() == V.cols() && "other must match this dimension"); + sqrD.setConstant(other_Ele.rows(),1,std::numeric_limits::infinity()); + I.resize(other_Ele.rows(),1); + C.resize(other_Ele.rows(),other_V.cols()); + // All points in other_V currently think they need to check against root of + // this. The point of using another AABB is to quickly prune chunks of + // other_V so that most points just check some subtree of this. + + // This holds a conservative estimate of max(sqr_D) where sqr_D is the + // current best minimum squared distance for all points in this subtree + double up_sqr_d = std::numeric_limits::infinity(); + squared_distance_helper( + V,Ele,&other,other_V,other_Ele,0,up_sqr_d,sqrD,I,C); +} + +template +template < + typename DerivedEle, + typename Derivedother_V, + typename Derivedother_Ele, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> +IGL_INLINE typename igl::AABB::Scalar + igl::AABB::squared_distance_helper( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const AABB * other, + const Eigen::MatrixBase & other_V, + const Eigen::MatrixBase & other_Ele, + const Scalar /*up_sqr_d*/, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) const +{ + using namespace std; + using namespace Eigen; + + // This implementation is a bit disappointing. There's no major speed up. Any + // performance gains seem to come from accidental cache coherency and + // diminish for larger "other" (the opposite of what was intended). + + // Base case + if(other->is_leaf() && this->is_leaf()) + { + Scalar sqr_d = sqrD(other->m_primitive); + int i = I(other->m_primitive); + RowVectorDIMS c = C.row( other->m_primitive); + RowVectorDIMS p = other_V.row(other->m_primitive); + leaf_squared_distance(V,Ele,p,sqr_d,i,c); + sqrD( other->m_primitive) = sqr_d; + I( other->m_primitive) = i; + C.row(other->m_primitive) = c; + //cout<<"leaf: "<m_low_sqr_d = sqr_d; + return sqr_d; + } + + if(other->is_leaf()) + { + Scalar sqr_d = sqrD(other->m_primitive); + int i = I(other->m_primitive); + RowVectorDIMS c = C.row( other->m_primitive); + RowVectorDIMS p = other_V.row(other->m_primitive); + sqr_d = squared_distance(V,Ele,p,sqr_d,i,c); + sqrD( other->m_primitive) = sqr_d; + I( other->m_primitive) = i; + C.row(other->m_primitive) = c; + //other->m_low_sqr_d = sqr_d; + return sqr_d; + } + + //// Exact minimum squared distance between arbitrary primitives inside this and + //// othre's bounding boxes + //const auto & min_squared_distance = [&]( + // const AABB * A, + // const AABB * B)->Scalar + //{ + // return A->m_box.squaredExteriorDistance(B->m_box); + //}; + + if(this->is_leaf()) + { + //if(min_squared_distance(this,other) < other->m_low_sqr_d) + if(true) + { + this->squared_distance_helper( + V,Ele,other->m_left,other_V,other_Ele,0,sqrD,I,C); + this->squared_distance_helper( + V,Ele,other->m_right,other_V,other_Ele,0,sqrD,I,C); + }else + { + // This is never reached... + } + //// we know other is not a leaf + //other->m_low_sqr_d = std::max(other->m_left->m_low_sqr_d,other->m_right->m_low_sqr_d); + return 0; + } + + // FORCE DOWN TO OTHER LEAF EVAL + //if(min_squared_distance(this,other) < other->m_low_sqr_d) + if(true) + { + if(true) + { + this->squared_distance_helper( + V,Ele,other->m_left,other_V,other_Ele,0,sqrD,I,C); + this->squared_distance_helper( + V,Ele,other->m_right,other_V,other_Ele,0,sqrD,I,C); + }else // this direction never seems to be faster + { + this->m_left->squared_distance_helper( + V,Ele,other,other_V,other_Ele,0,sqrD,I,C); + this->m_right->squared_distance_helper( + V,Ele,other,other_V,other_Ele,0,sqrD,I,C); + } + }else + { + // this is never reached ... :-( + } + //// we know other is not a leaf + //other->m_low_sqr_d = std::max(other->m_left->m_low_sqr_d,other->m_right->m_low_sqr_d); + + return 0; +#if 0 // False + + // _Very_ conservative approximation of maximum squared distance between + // primitives inside this and other's bounding boxes + const auto & max_squared_distance = []( + const AABB * A, + const AABB * B)->Scalar + { + AlignedBox combo = A->m_box; + combo.extend(B->m_box); + return combo.diagonal().squaredNorm(); + }; + + //// other base-case + //if(other->is_leaf()) + //{ + // double sqr_d = sqrD(other->m_primitive); + // int i = I(other->m_primitive); + // RowVectorDIMS c = C.row(m_primitive); + // RowVectorDIMS p = other_V.row(m_primitive); + // leaf_squared_distance(V,Ele,p,sqr_d,i,c); + // sqrD(other->m_primitive) = sqr_d; + // I(other->m_primitive) = i; + // C.row(m_primitive) = c; + // return; + //} + std::vector * > this_list; + if(this->is_leaf()) + { + this_list.push_back(this); + }else + { + assert(this->m_left); + this_list.push_back(this->m_left); + assert(this->m_right); + this_list.push_back(this->m_right); + } + std::vector *> other_list; + if(other->is_leaf()) + { + other_list.push_back(other); + }else + { + assert(other->m_left); + other_list.push_back(other->m_left); + assert(other->m_right); + other_list.push_back(other->m_right); + } + + //const std::function * other) + // > low_sqr_d = [&sqrD,&low_sqr_d](const AABB * other)->Scalar + // { + // if(other->is_leaf()) + // { + // return sqrD(other->m_primitive); + // }else + // { + // return std::max(low_sqr_d(other->m_left),low_sqr_d(other->m_right)); + // } + // }; + + //// Potentially recurse on all pairs, if minimum distance is less than running + //// bound + //Eigen::Matrix other_low_sqr_d = + // Eigen::Matrix::Constant(other_list.size(),1,up_sqr_d); + for(size_t child = 0;child this_low_sqr_d(this_list.size(),1); + for(size_t t = 0;t this_low_sqr_d(1)) + ) + { + std::swap(this_list[0],this_list[1]); + //std::swap(this_low_sqr_d(0),this_low_sqr_d(1)); + } + const Scalar sqr_d = this_low_sqr_d.minCoeff(); + + + for(size_t t = 0;tm_low_sqr_d) + { + //cout<<"before: "<squared_distance_helper( + // V,Ele,other_tree,other_V,other_Ele,other_low_sqr_d(child),sqrD,I,C)); + //cout<<"after: "<squared_distance_helper( + V,Ele,other_tree,other_V,other_Ele,0,sqrD,I,C); + } + } + } + //const Scalar ret = other_low_sqr_d.maxCoeff(); + //const auto mm = low_sqr_d(other); + //assert(mm == ret); + //cout<<"non-leaf: "<is_leaf()) + { + other->m_low_sqr_d = std::max(other->m_left->m_low_sqr_d,other->m_right->m_low_sqr_d); + } + return 0; +#endif +} + +template +template +IGL_INLINE void igl::AABB::leaf_squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + const Scalar low_sqr_d, + Scalar & sqr_d, + int & i, + Eigen::PlainObjectBase & c) const +{ + using namespace Eigen; + using namespace std; + if(low_sqr_d > sqr_d) + { + sqr_d = low_sqr_d; + return; + } + RowVectorDIMS c_candidate; + Scalar sqr_d_candidate; + igl::point_simplex_squared_distance( + p,V,Ele,m_primitive,sqr_d_candidate,c_candidate); + set_min(p,sqr_d_candidate,m_primitive,c_candidate,sqr_d,i,c); +} + +template +template +IGL_INLINE void igl::AABB::leaf_squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + Scalar & sqr_d, + int & i, + Eigen::PlainObjectBase & c) const +{ + return leaf_squared_distance(V,Ele,p,0,sqr_d,i,c); +} + + +template +IGL_INLINE void igl::AABB::set_min( + const RowVectorDIMS & +#ifndef NDEBUG + p +#endif + , + const Scalar sqr_d_candidate, + const int i_candidate, + const RowVectorDIMS & c_candidate, + Scalar & sqr_d, + int & i, + Eigen::PlainObjectBase & c) const +{ +#ifndef NDEBUG + //std::cout< +template +IGL_INLINE bool +igl::AABB::intersect_ray( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & origin, + const RowVectorDIMS & dir, + std::vector & hits) const +{ + hits.clear(); + const Scalar t0 = 0; + const Scalar t1 = std::numeric_limits::infinity(); + { + Scalar _1,_2; + if(!ray_box_intersect(origin,dir,m_box,t0,t1,_1,_2)) + { + return false; + } + } + if(this->is_leaf()) + { + // Actually process elements + assert((Ele.size() == 0 || Ele.cols() == 3) && "Elements should be triangles"); + // Cheesecake way of hitting element + bool ret = ray_mesh_intersect(origin,dir,V,Ele.row(m_primitive),hits); + // Since we only gave ray_mesh_intersect a single face, it will have set + // any hits to id=0. Set these to this primitive's id + for(auto & hit : hits) + { + hit.id = m_primitive; + } + return ret; + } + std::vector left_hits; + std::vector right_hits; + const bool left_ret = m_left->intersect_ray(V,Ele,origin,dir,left_hits); + const bool right_ret = m_right->intersect_ray(V,Ele,origin,dir,right_hits); + hits.insert(hits.end(),left_hits.begin(),left_hits.end()); + hits.insert(hits.end(),right_hits.begin(),right_hits.end()); + return left_ret || right_ret; +} + +template +template +IGL_INLINE bool +igl::AABB::intersect_ray( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & origin, + const RowVectorDIMS & dir, + igl::Hit & hit) const +{ +#if false + // BFS + std::queue Q; + // Or DFS + //std::stack Q; + Q.push(this); + bool any_hit = false; + hit.t = std::numeric_limits::infinity(); + while(!Q.empty()) + { + const AABB * tree = Q.front(); + //const AABB * tree = Q.top(); + Q.pop(); + { + Scalar _1,_2; + if(!ray_box_intersect( + origin,dir,tree->m_box,Scalar(0),Scalar(hit.t),_1,_2)) + { + continue; + } + } + if(tree->is_leaf()) + { + // Actually process elements + assert((Ele.size() == 0 || Ele.cols() == 3) && "Elements should be triangles"); + igl::Hit leaf_hit; + if( + ray_mesh_intersect(origin,dir,V,Ele.row(tree->m_primitive),leaf_hit)&& + leaf_hit.t < hit.t) + { + // correct the id + leaf_hit.id = tree->m_primitive; + hit = leaf_hit; + } + continue; + } + // Add children to queue + Q.push(tree->m_left); + Q.push(tree->m_right); + } + return any_hit; +#else + // DFS + return intersect_ray( + V,Ele,origin,dir,std::numeric_limits::infinity(),hit); +#endif +} + +template +template +IGL_INLINE bool +igl::AABB::intersect_ray( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & origin, + const RowVectorDIMS & dir, + const Scalar _min_t, + igl::Hit & hit) const +{ + //// Naive, slow + //std::vector hits; + //intersect_ray(V,Ele,origin,dir,hits); + //if(hits.size() > 0) + //{ + // hit = hits.front(); + // return true; + //}else + //{ + // return false; + //} + Scalar min_t = _min_t; + const Scalar t0 = 0; + { + Scalar _1,_2; + if(!ray_box_intersect(origin,dir,m_box,t0,min_t,_1,_2)) + { + return false; + } + } + if(this->is_leaf()) + { + // Actually process elements + assert((Ele.size() == 0 || Ele.cols() == 3) && "Elements should be triangles"); + // Cheesecake way of hitting element + bool ret = ray_mesh_intersect(origin,dir,V,Ele.row(m_primitive),hit); + hit.id = m_primitive; + return ret; + } + + // Doesn't seem like smartly choosing left before/after right makes a + // differnce + igl::Hit left_hit; + igl::Hit right_hit; + bool left_ret = m_left->intersect_ray(V,Ele,origin,dir,min_t,left_hit); + if(left_ret && left_hit.tintersect_ray(V,Ele,origin,dir,min_t,right_hit); + if(right_ret && right_hit.t template<> IGL_INLINE float AABB, 2>::squared_distance( Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, int&, Eigen::PlainObjectBase >&) const { assert(false);return -1;}; + template<> template<> IGL_INLINE float igl::AABB, 2>::squared_distance( Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, float, float, int&, Eigen::PlainObjectBase >&) const { assert(false);return -1;}; + template<> template<> IGL_INLINE void igl::AABB, 2>::init (Eigen::MatrixBase > const&, Eigen::MatrixBase > const&) { assert(false);}; + template<> template<> IGL_INLINE double AABB, 2>::squared_distance( Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, int&, Eigen::PlainObjectBase >&) const { assert(false);return -1;}; + template<> template<> IGL_INLINE double igl::AABB, 2>::squared_distance( Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, double, double, int&, Eigen::PlainObjectBase >&) const { assert(false);return -1;}; + template<> template<> IGL_INLINE void igl::AABB, 2>::init (Eigen::MatrixBase > const&, Eigen::MatrixBase > const&) { assert(false);}; + template<> template<> IGL_INLINE void igl::AABB, 2>::init(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&) {assert(false);}; + template<> template<> IGL_INLINE float igl::AABB, 2>::squared_distance(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, float, float, int&, Eigen::PlainObjectBase >&) const { assert(false);return -1;}; +} + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::AABB, 3>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +// generated by autoexplicit.sh +template void igl::AABB, 3>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template bool igl::AABB, 3>::intersect_ray >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, Eigen::Matrix const&, igl::Hit&) const; +template double igl::AABB, 2>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, int&, Eigen::PlainObjectBase >&) const; +template double igl::AABB, 3>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, double, int&, Eigen::PlainObjectBase >&) const; +template double igl::AABB, 3>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, int&, Eigen::PlainObjectBase >&) const; +template double igl::AABB, 3>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, double, double, int&, Eigen::PlainObjectBase >&) const; +template float igl::AABB, 3>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, float, float, int&, Eigen::PlainObjectBase >&) const; +template float igl::AABB, 3>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, int&, Eigen::PlainObjectBase >&) const; +template std::vector > igl::AABB, 2>::find, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, bool) const; +template std::vector > igl::AABB, 3>::find, Eigen::Block const, 1, -1, false> >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase const, 1, -1, false> > const&, bool) const; +template std::vector > igl::AABB, 3>::find, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, bool) const; +template void igl::AABB, 2>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template void igl::AABB, 2>::init, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int); +template void igl::AABB, 2>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template void igl::AABB, 2>::serialize, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, int) const; +template void igl::AABB, 2>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 2>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 2>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 2>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 2>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 3>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template void igl::AABB, 3>::init, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int); +template void igl::AABB, 3>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template void igl::AABB, 3>::serialize, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, int) const; +template void igl::AABB, 3>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 3>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 3>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 3>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 3>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 3>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 3>::squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&) const; +template void igl::AABB, 3>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template void igl::AABB, 3>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template void igl::AABB, 3>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template double igl::AABB, 3>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, int&, Eigen::PlainObjectBase >&) const; +template double igl::AABB, 2>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, int&, Eigen::PlainObjectBase >&) const; +#ifdef WIN32 +template void igl::AABB,2>::squared_distance,class Eigen::Matrix,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix >(class Eigen::MatrixBase > const &,class Eigen::MatrixBase > const &,class Eigen::MatrixBase > const &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &)const; +template void igl::AABB,3>::squared_distance,class Eigen::Matrix,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix >(class Eigen::MatrixBase > const &,class Eigen::MatrixBase > const &,class Eigen::MatrixBase > const &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &)const; +#endif +#endif diff --git a/vendor/libigl/include/igl/AABB.h b/vendor/libigl/include/igl/AABB.h new file mode 100644 index 0000000000000000000000000000000000000000..891481aa0a580da43fd4233fbec733879ab437b1 --- /dev/null +++ b/vendor/libigl/include/igl/AABB.h @@ -0,0 +1,413 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_AABB_H +#define IGL_AABB_H + +#include "Hit.h" +#include "igl_inline.h" +#include +#include +#include +namespace igl +{ + // Implementation of semi-general purpose axis-aligned bounding box hierarchy. + // The mesh (V,Ele) is stored and managed by the caller and each routine here + // simply takes it as references (it better not change between calls). + // + // It's a little annoying that the Dimension is a template parameter and not + // picked up at run time from V. This leads to duplicated code for 2d/3d (up to + // dim). + template + class AABB + { +public: + typedef typename DerivedV::Scalar Scalar; + typedef Eigen::Matrix RowVectorDIMS; + typedef Eigen::Matrix VectorDIMS; + typedef Eigen::Matrix MatrixXDIMS; + // Shared pointers are slower... + AABB * m_left; + AABB * m_right; + Eigen::AlignedBox m_box; + // -1 non-leaf + int m_primitive; + //Scalar m_low_sqr_d; + //int m_depth; + AABB(): + m_left(NULL), m_right(NULL), + m_box(), m_primitive(-1) + //m_low_sqr_d(std::numeric_limits::infinity()), + //m_depth(0) + {} + // http://stackoverflow.com/a/3279550/148668 + AABB(const AABB& other): + m_left(other.m_left ? new AABB(*other.m_left) : NULL), + m_right(other.m_right ? new AABB(*other.m_right) : NULL), + m_box(other.m_box), + m_primitive(other.m_primitive) + //m_low_sqr_d(other.m_low_sqr_d), + //m_depth(std::max( + // m_left ? m_left->m_depth + 1 : 0, + // m_right ? m_right->m_depth + 1 : 0)) + { + } + // copy-swap idiom + friend void swap(AABB& first, AABB& second) + { + // Enable ADL + using std::swap; + swap(first.m_left,second.m_left); + swap(first.m_right,second.m_right); + swap(first.m_box,second.m_box); + swap(first.m_primitive,second.m_primitive); + //swap(first.m_low_sqr_d,second.m_low_sqr_d); + //swap(first.m_depth,second.m_depth); + } + // Pass-by-value (aka copy) + AABB& operator=(AABB other) + { + swap(*this,other); + return *this; + } + AABB(AABB&& other): + // initialize via default constructor + AABB() + { + swap(*this,other); + } + // Seems like there should have been an elegant solution to this using + // the copy-swap idiom above: + IGL_INLINE void deinit() + { + m_primitive = -1; + m_box = Eigen::AlignedBox(); + delete m_left; + m_left = NULL; + delete m_right; + m_right = NULL; + } + ~AABB() + { + deinit(); + } + // Build an Axis-Aligned Bounding Box tree for a given mesh and given + // serialization of a previous AABB tree. + // + // Inputs: + // V #V by dim list of mesh vertex positions. + // Ele #Ele by dim+1 list of mesh indices into #V. + // bb_mins max_tree by dim list of bounding box min corner positions + // bb_maxs max_tree by dim list of bounding box max corner positions + // elements max_tree list of element or (not leaf id) indices into Ele + // i recursive call index {0} + template < + typename DerivedEle, + typename Derivedbb_mins, + typename Derivedbb_maxs, + typename Derivedelements> + IGL_INLINE void init( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const Eigen::MatrixBase & bb_mins, + const Eigen::MatrixBase & bb_maxs, + const Eigen::MatrixBase & elements, + const int i = 0); + // Wrapper for root with empty serialization + template + IGL_INLINE void init( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele); + // Build an Axis-Aligned Bounding Box tree for a given mesh. + // + // Inputs: + // V #V by dim list of mesh vertex positions. + // Ele #Ele by dim+1 list of mesh indices into #V. + // SI #Ele by dim list revealing for each coordinate where Ele's + // barycenters would be sorted: SI(e,d) = i --> the dth coordinate of + // the barycenter of the eth element would be placed at position i in a + // sorted list. + // I #I list of indices into Ele of elements to include (for recursive + // calls) + // + template + IGL_INLINE void init( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const Eigen::MatrixBase & SI, + const Eigen::MatrixBase& I); + // Return whether at leaf node + IGL_INLINE bool is_leaf() const; + // Find the indices of elements containing given point: this makes sense + // when Ele is a co-dimension 0 simplex (tets in 3D, triangles in 2D). + // + // Inputs: + // V #V by dim list of mesh vertex positions. **Should be same as used to + // construct mesh.** + // Ele #Ele by dim+1 list of mesh indices into #V. **Should be same as used to + // construct mesh.** + // q dim row-vector query position + // first whether to only return first element containing q + // Returns: + // list of indices of elements containing q + template + IGL_INLINE std::vector find( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const Eigen::MatrixBase & q, + const bool first=false) const; + + // If number of elements m then total tree size should be 2*h where h is + // the deepest depth 2^ceil(log(#Ele*2-1)) + IGL_INLINE int subtree_size() const; + + // Serialize this class into 3 arrays (so we can pass it pack to matlab) + // + // Outputs: + // bb_mins max_tree by dim list of bounding box min corner positions + // bb_maxs max_tree by dim list of bounding box max corner positions + // elements max_tree list of element or (not leaf id) indices into Ele + // i recursive call index into these arrays {0} + template < + typename Derivedbb_mins, + typename Derivedbb_maxs, + typename Derivedelements> + IGL_INLINE void serialize( + Eigen::PlainObjectBase & bb_mins, + Eigen::PlainObjectBase & bb_maxs, + Eigen::PlainObjectBase & elements, + const int i = 0) const; + // Compute squared distance to a query point + // + // Inputs: + // V #V by dim list of vertex positions + // Ele #Ele by dim list of simplex indices + // p dim-long query point + // Outputs: + // i facet index corresponding to smallest distances + // c closest point + // Returns squared distance + // + // Known bugs: currently assumes Elements are triangles regardless of + // dimension. + template + IGL_INLINE Scalar squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + int & i, + Eigen::PlainObjectBase & c) const; +//private: + // Compute squared distance to a query point + // + // Inputs: + // V #V by dim list of vertex positions + // Ele #Ele by dim list of simplex indices + // p dim-long query point + // low_sqr_d lower bound on squared distance, specified maximum squared + // distance + // up_sqr_d current upper bounded on squared distance, current minimum + // squared distance (only consider distances less than this), see + // output. + // Outputs: + // up_sqr_d updated current minimum squared distance + // i facet index corresponding to smallest distances + // c closest point + // Returns squared distance + // + // Known bugs: currently assumes Elements are triangles regardless of + // dimension. + template + IGL_INLINE Scalar squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + const Scalar low_sqr_d, + const Scalar up_sqr_d, + int & i, + Eigen::PlainObjectBase & c) const; + // Default low_sqr_d + template + IGL_INLINE Scalar squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + const Scalar up_sqr_d, + int & i, + Eigen::PlainObjectBase & c) const; + // All hits + template + IGL_INLINE bool intersect_ray( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & origin, + const RowVectorDIMS & dir, + std::vector & hits) const; + // First hit + template + IGL_INLINE bool intersect_ray( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & origin, + const RowVectorDIMS & dir, + igl::Hit & hit) const; +//private: + template + IGL_INLINE bool intersect_ray( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & origin, + const RowVectorDIMS & dir, + const Scalar min_t, + igl::Hit & hit) const; + + +public: + // Compute the squared distance from all query points in P to the + // _closest_ points on the primitives stored in the AABB hierarchy for + // the mesh (V,Ele). + // + // Inputs: + // V #V by dim list of vertex positions + // Ele #Ele by dim list of simplex indices + // P #P by dim list of query points + // Outputs: + // sqrD #P list of squared distances + // I #P list of indices into Ele of closest primitives + // C #P by dim list of closest points + template < + typename DerivedEle, + typename DerivedP, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> + IGL_INLINE void squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const Eigen::MatrixBase & P, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) const; + + // Compute the squared distance from all query points in P already stored + // in its own AABB hierarchy to the _closest_ points on the primitives + // stored in the AABB hierarchy for the mesh (V,Ele). + // + // Inputs: + // V #V by dim list of vertex positions + // Ele #Ele by dim list of simplex indices + // other AABB hierarchy of another set of primitives (must be points) + // other_V #other_V by dim list of query points + // other_Ele #other_Ele by ss list of simplex indices into other_V + // (must be simple list of points: ss == 1) + // Outputs: + // sqrD #P list of squared distances + // I #P list of indices into Ele of closest primitives + // C #P by dim list of closest points + template < + typename DerivedEle, + typename Derivedother_V, + typename Derivedother_Ele, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> + IGL_INLINE void squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const AABB & other, + const Eigen::MatrixBase & other_V, + const Eigen::MatrixBase & other_Ele, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) const; +private: + template < + typename DerivedEle, + typename Derivedother_V, + typename Derivedother_Ele, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> + IGL_INLINE Scalar squared_distance_helper( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const AABB * other, + const Eigen::MatrixBase & other_V, + const Eigen::MatrixBase& other_Ele, + const Scalar up_sqr_d, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) const; + // Compute the squared distance to the primitive in this node: assumes + // that this is indeed a leaf node. + // + // Inputs: + // V #V by dim list of vertex positions + // Ele #Ele by dim list of simplex indices + // p dim-long query point + // sqr_d current minimum distance for this query, see output + // i current index into Ele of closest point, see output + // c dim-long current closest point, see output + // Outputs: + // sqr_d minimum of initial value and squared distance to this + // primitive + // i possibly updated index into Ele of closest point + // c dim-long possibly updated closest point + template + IGL_INLINE void leaf_squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + const Scalar low_sqr_d, + Scalar & sqr_d, + int & i, + Eigen::PlainObjectBase & c) const; + // Default low_sqr_d + template + IGL_INLINE void leaf_squared_distance( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + const RowVectorDIMS & p, + Scalar & sqr_d, + int & i, + Eigen::PlainObjectBase & c) const; + // If new distance (sqr_d_candidate) is less than current distance + // (sqr_d), then update this distance and its associated values + // _in-place_: + // + // Inputs: + // p dim-long query point (only used in DEBUG mode) + // sqr_d candidate minimum distance for this query, see output + // i candidate index into Ele of closest point, see output + // c dim-long candidate closest point, see output + // sqr_d current minimum distance for this query, see output + // i current index into Ele of closest point, see output + // c dim-long current closest point, see output + // Outputs: + // sqr_d minimum of initial value and squared distance to this + // primitive + // i possibly updated index into Ele of closest point + // c dim-long possibly updated closest point + IGL_INLINE void set_min( + const RowVectorDIMS & p, + const Scalar sqr_d_candidate, + const int i_candidate, + const RowVectorDIMS & c_candidate, + Scalar & sqr_d, + int & i, + Eigen::PlainObjectBase & c) const; +public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + }; +} + + +#ifndef IGL_STATIC_LIBRARY +# include "AABB.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/Camera.h b/vendor/libigl/include/igl/Camera.h new file mode 100644 index 0000000000000000000000000000000000000000..c812df8b4a35fed482c6f70c3f72e093340f6fe3 --- /dev/null +++ b/vendor/libigl/include/igl/Camera.h @@ -0,0 +1,359 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_CAMERA_H +#define IGL_CAMERA_H + +// you're idiot, M$! +#if defined(_WIN32) +#undef far +#undef near +#endif + +#include +#include +#include "PI.h" + +#define IGL_CAMERA_MIN_ANGLE 5.0 +namespace igl +{ + + // A simple camera class. The camera stores projection parameters (field of + // view angle, aspect ratio, near and far clips) as well as a rigid + // transformation *of the camera as if it were also a scene object*. Thus, the + // **inverse** of this rigid transformation is the modelview transformation. + class Camera + { + public: + // On windows you might need: -fno-delayed-template-parsing + //static constexpr double IGL_CAMERA_MIN_ANGLE = 5.; + // m_angle Field of view angle in degrees {45} + // m_aspect Aspect ratio {1} + // m_near near clipping plane {1e-2} + // m_far far clipping plane {100} + // m_at_dist distance of looking at point {1} + // m_orthographic whether to use othrographic projection {false} + // m_rotation_conj Conjugate of rotation part of rigid transformation of + // camera {identity}. Note: we purposefully store the conjugate because + // this is what TW_TYPE_QUAT4D is expecting. + // m_translation Translation part of rigid transformation of camera + // {(0,0,1)} + double m_angle, m_aspect, m_near, m_far, m_at_dist; + bool m_orthographic; + Eigen::Quaterniond m_rotation_conj; + Eigen::Vector3d m_translation; + public: + inline Camera(); + inline virtual ~Camera(){} + // Return projection matrix that takes relative camera coordinates and + // transforms it to viewport coordinates + // + // Note: + // + // if(m_angle > 0) + // { + // gluPerspective(m_angle,m_aspect,m_near,m_at_dist+m_far); + // }else + // { + // gluOrtho(-0.5*aspect,0.5*aspect,-0.5,0.5,m_at_dist+m_near,m_far); + // } + // + // Is equivalent to + // + // glMultMatrixd(projection().data()); + // + inline Eigen::Matrix4d projection() const; + // Return an Affine transformation (rigid actually) that + // takes relative coordinates and tramsforms them into world 3d + // coordinates: moves the camera into the scene. + inline Eigen::Affine3d affine() const; + // Return an Affine transformation (rigid actually) that puts the takes a + // world 3d coordinate and transforms it into the relative camera + // coordinates: moves the scene in front of the camera. + // + // Note: + // + // gluLookAt( + // eye()(0), eye()(1), eye()(2), + // at()(0), at()(1), at()(2), + // up()(0), up()(1), up()(2)); + // + // Is equivalent to + // + // glMultMatrixd(camera.inverse().matrix().data()); + // + // See also: affine, eye, at, up + inline Eigen::Affine3d inverse() const; + // Returns world coordinates position of center or "eye" of camera. + inline Eigen::Vector3d eye() const; + // Returns world coordinate position of a point "eye" is looking at. + inline Eigen::Vector3d at() const; + // Returns world coordinate unit vector of "up" vector + inline Eigen::Vector3d up() const; + // Return top right corner of unit plane in relative coordinates, that is + // (w/2,h/2,1) + inline Eigen::Vector3d unit_plane() const; + // Move dv in the relative coordinate frame of the camera (move the FPS) + // + // Inputs: + // dv (x,y,z) displacement vector + // + inline void dolly(const Eigen::Vector3d & dv); + // "Scale zoom": Move `eye`, but leave `at` + // + // Input: + // s amount to scale distance to at + inline void push_away(const double s); + // Aka "Hitchcock", "Vertigo", "Spielberg" or "Trombone" zoom: + // simultaneously dolly while changing angle so that `at` not only stays + // put in relative coordinates but also projected coordinates. That is + // + // Inputs: + // da change in angle in degrees + inline void dolly_zoom(const double da); + // Turn around eye so that rotation is now q + // + // Inputs: + // q new rotation as quaternion + inline void turn_eye(const Eigen::Quaterniond & q); + // Orbit around at so that rotation is now q + // + // Inputs: + // q new rotation as quaternion + inline void orbit(const Eigen::Quaterniond & q); + // Rotate and translate so that camera is situated at "eye" looking at "at" + // with "up" pointing up. + // + // Inputs: + // eye (x,y,z) coordinates of eye position + // at (x,y,z) coordinates of at position + // up (x,y,z) coordinates of up vector + inline void look_at( + const Eigen::Vector3d & eye, + const Eigen::Vector3d & at, + const Eigen::Vector3d & up); + // Needed any time Eigen Structures are used as class members + // http://eigen.tuxfamily.org/dox-devel/group__TopicStructHavingEigenMembers.html + public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + }; +} + +// Implementation +#include "PI.h" +#include "EPS.h" +#include +#include +#include + +inline igl::Camera::Camera(): + m_angle(45.0),m_aspect(1),m_near(1e-2),m_far(100),m_at_dist(1), + m_orthographic(false), + m_rotation_conj(1,0,0,0), + m_translation(0,0,1) +{ +} + +inline Eigen::Matrix4d igl::Camera::projection() const +{ + Eigen::Matrix4d P; + using namespace std; + const double far = m_at_dist + m_far; + const double near = m_near; + // http://stackoverflow.com/a/3738696/148668 + if(m_orthographic) + { + const double f = 0.5; + const double left = -f*m_aspect; + const double right = f*m_aspect; + const double bottom = -f; + const double top = f; + const double tx = (right+left)/(right-left); + const double ty = (top+bottom)/(top-bottom); + const double tz = (far+near)/(far-near); + const double z_fix = 0.5 /m_at_dist / tan(m_angle*0.5 * (igl::PI/180.) ); + P<< + z_fix*2./(right-left), 0, 0, -tx, + 0, z_fix*2./(top-bottom), 0, -ty, + 0, 0, -z_fix*2./(far-near), -tz, + 0, 0, 0, 1; + }else + { + const double yScale = tan(PI*0.5 - 0.5*m_angle*PI/180.); + // http://stackoverflow.com/a/14975139/148668 + const double xScale = yScale/m_aspect; + P<< + xScale, 0, 0, 0, + 0, yScale, 0, 0, + 0, 0, -(far+near)/(far-near), -1, + 0, 0, -2.*near*far/(far-near), 0; + P = P.transpose().eval(); + } + return P; +} + +inline Eigen::Affine3d igl::Camera::affine() const +{ + using namespace Eigen; + Affine3d t = Affine3d::Identity(); + t.rotate(m_rotation_conj.conjugate()); + t.translate(m_translation); + return t; +} + +inline Eigen::Affine3d igl::Camera::inverse() const +{ + using namespace Eigen; + Affine3d t = Affine3d::Identity(); + t.translate(-m_translation); + t.rotate(m_rotation_conj); + return t; +} + +inline Eigen::Vector3d igl::Camera::eye() const +{ + using namespace Eigen; + return affine() * Vector3d(0,0,0); +} + +inline Eigen::Vector3d igl::Camera::at() const +{ + using namespace Eigen; + return affine() * (Vector3d(0,0,-1)*m_at_dist); +} + +inline Eigen::Vector3d igl::Camera::up() const +{ + using namespace Eigen; + Affine3d t = Affine3d::Identity(); + t.rotate(m_rotation_conj.conjugate()); + return t * Vector3d(0,1,0); +} + +inline Eigen::Vector3d igl::Camera::unit_plane() const +{ + // Distance of center pixel to eye + const double d = 1.0; + const double a = m_aspect; + const double theta = m_angle*PI/180.; + const double w = + 2.*sqrt(-d*d/(a*a*pow(tan(0.5*theta),2.)-1.))*a*tan(0.5*theta); + const double h = w/a; + return Eigen::Vector3d(w*0.5,h*0.5,-d); +} + +inline void igl::Camera::dolly(const Eigen::Vector3d & dv) +{ + m_translation += dv; +} + +inline void igl::Camera::push_away(const double s) +{ + using namespace Eigen; +#ifndef NDEBUG + Vector3d old_at = at(); +#endif + const double old_at_dist = m_at_dist; + m_at_dist = old_at_dist * s; + dolly(Vector3d(0,0,1)*(m_at_dist - old_at_dist)); + assert((old_at-at()).squaredNorm() < DOUBLE_EPS); +} + +inline void igl::Camera::dolly_zoom(const double da) +{ + using namespace std; + using namespace Eigen; +#ifndef NDEBUG + Vector3d old_at = at(); +#endif + const double old_angle = m_angle; + if(old_angle + da < IGL_CAMERA_MIN_ANGLE) + { + m_orthographic = true; + }else if(old_angle + da > IGL_CAMERA_MIN_ANGLE) + { + m_orthographic = false; + } + if(!m_orthographic) + { + m_angle += da; + m_angle = min(89.,max(IGL_CAMERA_MIN_ANGLE,m_angle)); + // change in distance + const double s = + (2.*tan(old_angle/2./180.*igl::PI)) / + (2.*tan(m_angle/2./180.*igl::PI)) ; + const double old_at_dist = m_at_dist; + m_at_dist = old_at_dist * s; + dolly(Vector3d(0,0,1)*(m_at_dist - old_at_dist)); + assert((old_at-at()).squaredNorm() < DOUBLE_EPS); + } +} + +inline void igl::Camera::turn_eye(const Eigen::Quaterniond & q) +{ + using namespace Eigen; + Vector3d old_eye = eye(); + // eye should be fixed + // + // eye_1 = R_1 * t_1 = eye_0 + // t_1 = R_1' * eye_0 + m_rotation_conj = q.conjugate(); + m_translation = m_rotation_conj * old_eye; + assert((old_eye - eye()).squaredNorm() < DOUBLE_EPS); +} + +inline void igl::Camera::orbit(const Eigen::Quaterniond & q) +{ + using namespace Eigen; + Vector3d old_at = at(); + // at should be fixed + // + // at_1 = R_1 * t_1 - R_1 * z = at_0 + // t_1 = R_1' * (at_0 + R_1 * z) + m_rotation_conj = q.conjugate(); + m_translation = + m_rotation_conj * + (old_at + + m_rotation_conj.conjugate() * Vector3d(0,0,1) * m_at_dist); + assert((old_at - at()).squaredNorm() < DOUBLE_EPS); +} + +inline void igl::Camera::look_at( + const Eigen::Vector3d & eye, + const Eigen::Vector3d & at, + const Eigen::Vector3d & up) +{ + using namespace Eigen; + using namespace std; + // http://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml + // Normalize vector from at to eye + Vector3d F = eye-at; + m_at_dist = F.norm(); + F.normalize(); + // Project up onto plane orthogonal to F and normalize + assert(up.cross(F).norm() > DOUBLE_EPS && "(eye-at) x up ≈ 0"); + const Vector3d proj_up = (up-(up.dot(F))*F).normalized(); + Quaterniond a,b; + a.setFromTwoVectors(Vector3d(0,0,-1),-F); + b.setFromTwoVectors(a*Vector3d(0,1,0),proj_up); + m_rotation_conj = (b*a).conjugate(); + m_translation = m_rotation_conj * eye; + //cout<<"m_at_dist: "<eye().transpose()<at().transpose()<eye()-this->at()).normalized().transpose()<eye(): "<<(eye-this->eye()).squaredNorm()<eye()).squaredNorm() < DOUBLE_EPS); + //assert((F-(this->eye()-this->at()).normalized()).squaredNorm() < + // DOUBLE_EPS); + assert( (at-this->at()).squaredNorm() < DOUBLE_EPS); + //assert( (proj_up-this->up()).squaredNorm() < DOUBLE_EPS); +} + +#endif diff --git a/vendor/libigl/include/igl/MshSaver.h b/vendor/libigl/include/igl/MshSaver.h new file mode 100644 index 0000000000000000000000000000000000000000..6b95d2eedbab83b502da617bf2f95c9b460fb94b --- /dev/null +++ b/vendor/libigl/include/igl/MshSaver.h @@ -0,0 +1,84 @@ +// based on MSH writer from PyMesh + +// Copyright (c) 2015 Qingnan Zhou +// Copyright (C) 2020 Vladimir Fonov +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MSH_SAVER_H +#define IGL_MSH_SAVER_H +#include "igl_inline.h" + +#include +#include +#include + +namespace igl { + +// Class for dumping information to .msh file +// depends only on c++stl library +// current implementation works only with 3D information +class MshSaver { + public: + typedef double Float; + + typedef std::vector IndexVector; + typedef std::vector IntVector; + typedef std::vector FloatVector; + typedef std::vector FloatField; + typedef std::vector IntField; + typedef std::vector FieldNames; + + MshSaver(const std::string& filename, bool binary=true); + ~MshSaver(); + + public: + // Only these element types are supported right now + enum {ELEMENT_LINE=1, ELEMENT_TRI=2, ELEMENT_QUAD=3, + ELEMENT_TET=4, ELEMENT_HEX=5, ELEMENT_PRISM=6 }; + + public: + // save mesh geometry + void save_mesh( + const FloatVector& nodes, + const IndexVector& elements, + const IntVector& element_lengths, + const IntVector& element_type, + const IntVector& element_tags ); + + // save additional fields associated with the mesh + + // add node scalar field + void save_scalar_field(const std::string& fieldname, const FloatVector& field); + // add node vectot field + void save_vector_field(const std::string& fieldname, const FloatVector& field); + // add element scalar field + void save_elem_scalar_field(const std::string& fieldname, const FloatVector& field); + // add element vector field + void save_elem_vector_field(const std::string& fieldname, const FloatVector& field); + // add element tensor field + void save_elem_tensor_field(const std::string& fieldname, const FloatVector& field); + + protected: + void save_header(); + void save_nodes(const FloatVector& nodes); + void save_elements(const IndexVector& elements, + const IntVector& element_lengths, + const IntVector& element_type, + const IntVector& element_tags); + + private: + bool m_binary; + size_t m_num_nodes; + size_t m_num_elements; + + std::ofstream fout; +}; +} //igl + +#ifndef IGL_STATIC_LIBRARY +# include "MshSaver.cpp" +#endif + +#endif //MSH_SAVER_H diff --git a/vendor/libigl/include/igl/Singular_Value_Decomposition_Jacobi_Conjugation_Kernel.hpp b/vendor/libigl/include/igl/Singular_Value_Decomposition_Jacobi_Conjugation_Kernel.hpp new file mode 100644 index 0000000000000000000000000000000000000000..70b4371317e0c6f11b9756b8c53e6479e82fb5ad --- /dev/null +++ b/vendor/libigl/include/igl/Singular_Value_Decomposition_Jacobi_Conjugation_Kernel.hpp @@ -0,0 +1,118 @@ +//##################################################################### +// Copyright (c) 2010-2011, Eftychios Sifakis. +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +//##################################################################### + +//########################################################### +// Compute the Givens angle (and half-angle) +//########################################################### + +ENABLE_SCALAR_IMPLEMENTATION(Ssh.f=SS21.f*Sone_half.f;) ENABLE_SSE_IMPLEMENTATION(Vsh=_mm_mul_ps(VS21,Vone_half);) ENABLE_AVX_IMPLEMENTATION(Vsh=_mm256_mul_ps(VS21,Vone_half);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp5.f=SS11.f-SS22.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp5=_mm_sub_ps(VS11,VS22);) ENABLE_AVX_IMPLEMENTATION(Vtmp5=_mm256_sub_ps(VS11,VS22);) + +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.f=Ssh.f*Ssh.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_mul_ps(Vsh,Vsh);) ENABLE_AVX_IMPLEMENTATION(Vtmp2=_mm256_mul_ps(Vsh,Vsh);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp1.ui=(Stmp2.f>=Stiny_number.f)?0xffffffff:0;) ENABLE_SSE_IMPLEMENTATION(Vtmp1=_mm_cmpge_ps(Vtmp2,Vtiny_number);) ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_cmp_ps(Vtmp2,Vtiny_number, _CMP_GE_OS);) //ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_cmpge_ps(Vtmp2,Vtiny_number);) +ENABLE_SCALAR_IMPLEMENTATION(Ssh.ui=Stmp1.ui&Ssh.ui;) ENABLE_SSE_IMPLEMENTATION(Vsh=_mm_and_ps(Vtmp1,Vsh);) ENABLE_AVX_IMPLEMENTATION(Vsh=_mm256_and_ps(Vtmp1,Vsh);) +ENABLE_SCALAR_IMPLEMENTATION(Sch.ui=Stmp1.ui&Stmp5.ui;) ENABLE_SSE_IMPLEMENTATION(Vch=_mm_and_ps(Vtmp1,Vtmp5);) ENABLE_AVX_IMPLEMENTATION(Vch=_mm256_blendv_ps(Vone,Vtmp5,Vtmp1);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.ui=~Stmp1.ui&Sone.ui;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_andnot_ps(Vtmp1,Vone);) +ENABLE_SCALAR_IMPLEMENTATION(Sch.ui=Sch.ui|Stmp2.ui;) ENABLE_SSE_IMPLEMENTATION(Vch=_mm_or_ps(Vch,Vtmp2);) + +ENABLE_SCALAR_IMPLEMENTATION(Stmp1.f=Ssh.f*Ssh.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp1=_mm_mul_ps(Vsh,Vsh);) ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_mul_ps(Vsh,Vsh);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.f=Sch.f*Sch.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_mul_ps(Vch,Vch);) ENABLE_AVX_IMPLEMENTATION(Vtmp2=_mm256_mul_ps(Vch,Vch);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp3.f=Stmp1.f+Stmp2.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp3=_mm_add_ps(Vtmp1,Vtmp2);) ENABLE_AVX_IMPLEMENTATION(Vtmp3=_mm256_add_ps(Vtmp1,Vtmp2);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp4.f=rsqrt(Stmp3.f);) ENABLE_SSE_IMPLEMENTATION(Vtmp4=_mm_rsqrt_ps(Vtmp3);) ENABLE_AVX_IMPLEMENTATION(Vtmp4=_mm256_rsqrt_ps(Vtmp3);) + +#ifdef USE_ACCURATE_RSQRT_IN_JACOBI_CONJUGATION +ENABLE_SCALAR_IMPLEMENTATION(Ss.f=Stmp4.f*Sone_half.f;) ENABLE_SSE_IMPLEMENTATION(Vs=_mm_mul_ps(Vtmp4,Vone_half);) ENABLE_AVX_IMPLEMENTATION(Vs=_mm256_mul_ps(Vtmp4,Vone_half);) +ENABLE_SCALAR_IMPLEMENTATION(Sc.f=Stmp4.f*Ss.f;) ENABLE_SSE_IMPLEMENTATION(Vc=_mm_mul_ps(Vtmp4,Vs);) ENABLE_AVX_IMPLEMENTATION(Vc=_mm256_mul_ps(Vtmp4,Vs);) +ENABLE_SCALAR_IMPLEMENTATION(Sc.f=Stmp4.f*Sc.f;) ENABLE_SSE_IMPLEMENTATION(Vc=_mm_mul_ps(Vtmp4,Vc);) ENABLE_AVX_IMPLEMENTATION(Vc=_mm256_mul_ps(Vtmp4,Vc);) +ENABLE_SCALAR_IMPLEMENTATION(Sc.f=Stmp3.f*Sc.f;) ENABLE_SSE_IMPLEMENTATION(Vc=_mm_mul_ps(Vtmp3,Vc);) ENABLE_AVX_IMPLEMENTATION(Vc=_mm256_mul_ps(Vtmp3,Vc);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp4.f=Stmp4.f+Ss.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp4=_mm_add_ps(Vtmp4,Vs);) ENABLE_AVX_IMPLEMENTATION(Vtmp4=_mm256_add_ps(Vtmp4,Vs);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp4.f=Stmp4.f-Sc.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp4=_mm_sub_ps(Vtmp4,Vc);) ENABLE_AVX_IMPLEMENTATION(Vtmp4=_mm256_sub_ps(Vtmp4,Vc);) +#endif + +ENABLE_SCALAR_IMPLEMENTATION(Ssh.f=Stmp4.f*Ssh.f;) ENABLE_SSE_IMPLEMENTATION(Vsh=_mm_mul_ps(Vtmp4,Vsh);) ENABLE_AVX_IMPLEMENTATION(Vsh=_mm256_mul_ps(Vtmp4,Vsh);) +ENABLE_SCALAR_IMPLEMENTATION(Sch.f=Stmp4.f*Sch.f;) ENABLE_SSE_IMPLEMENTATION(Vch=_mm_mul_ps(Vtmp4,Vch);) ENABLE_AVX_IMPLEMENTATION(Vch=_mm256_mul_ps(Vtmp4,Vch);) + +ENABLE_SCALAR_IMPLEMENTATION(Stmp1.f=Sfour_gamma_squared.f*Stmp1.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp1=_mm_mul_ps(Vfour_gamma_squared,Vtmp1);) ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_mul_ps(Vfour_gamma_squared,Vtmp1);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp1.ui=(Stmp2.f<=Stmp1.f)?0xffffffff:0;) ENABLE_SSE_IMPLEMENTATION(Vtmp1=_mm_cmple_ps(Vtmp2,Vtmp1);) ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_cmp_ps(Vtmp2,Vtmp1, _CMP_LE_OS);) //ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_cmple_ps(Vtmp2,Vtmp1);) + +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.ui=Ssine_pi_over_eight.ui&Stmp1.ui;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_and_ps(Vsine_pi_over_eight,Vtmp1);) ENABLE_AVX_IMPLEMENTATION(Vsh=_mm256_blendv_ps(Vsh,Vsine_pi_over_eight,Vtmp1);) +ENABLE_SCALAR_IMPLEMENTATION(Ssh.ui=~Stmp1.ui&Ssh.ui;) ENABLE_SSE_IMPLEMENTATION(Vsh=_mm_andnot_ps(Vtmp1,Vsh);) +ENABLE_SCALAR_IMPLEMENTATION(Ssh.ui=Ssh.ui|Stmp2.ui;) ENABLE_SSE_IMPLEMENTATION(Vsh=_mm_or_ps(Vsh,Vtmp2);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.ui=Scosine_pi_over_eight.ui&Stmp1.ui;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_and_ps(Vcosine_pi_over_eight,Vtmp1);) ENABLE_AVX_IMPLEMENTATION(Vch=_mm256_blendv_ps(Vch,Vcosine_pi_over_eight,Vtmp1);) +ENABLE_SCALAR_IMPLEMENTATION(Sch.ui=~Stmp1.ui&Sch.ui;) ENABLE_SSE_IMPLEMENTATION(Vch=_mm_andnot_ps(Vtmp1,Vch);) +ENABLE_SCALAR_IMPLEMENTATION(Sch.ui=Sch.ui|Stmp2.ui;) ENABLE_SSE_IMPLEMENTATION(Vch=_mm_or_ps(Vch,Vtmp2);) + +ENABLE_SCALAR_IMPLEMENTATION(Stmp1.f=Ssh.f*Ssh.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp1=_mm_mul_ps(Vsh,Vsh);) ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_mul_ps(Vsh,Vsh);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.f=Sch.f*Sch.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_mul_ps(Vch,Vch);) ENABLE_AVX_IMPLEMENTATION(Vtmp2=_mm256_mul_ps(Vch,Vch);) +ENABLE_SCALAR_IMPLEMENTATION(Sc.f=Stmp2.f-Stmp1.f;) ENABLE_SSE_IMPLEMENTATION(Vc=_mm_sub_ps(Vtmp2,Vtmp1);) ENABLE_AVX_IMPLEMENTATION(Vc=_mm256_sub_ps(Vtmp2,Vtmp1);) +ENABLE_SCALAR_IMPLEMENTATION(Ss.f=Sch.f*Ssh.f;) ENABLE_SSE_IMPLEMENTATION(Vs=_mm_mul_ps(Vch,Vsh);) ENABLE_AVX_IMPLEMENTATION(Vs=_mm256_mul_ps(Vch,Vsh);) +ENABLE_SCALAR_IMPLEMENTATION(Ss.f=Ss.f+Ss.f;) ENABLE_SSE_IMPLEMENTATION(Vs=_mm_add_ps(Vs,Vs);) ENABLE_AVX_IMPLEMENTATION(Vs=_mm256_add_ps(Vs,Vs);) + +//########################################################### +// Perform the actual Givens conjugation +//########################################################### + +#ifndef USE_ACCURATE_RSQRT_IN_JACOBI_CONJUGATION +ENABLE_SCALAR_IMPLEMENTATION(Stmp3.f=Stmp1.f+Stmp2.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp3=_mm_add_ps(Vtmp1,Vtmp2);) ENABLE_AVX_IMPLEMENTATION(Vtmp3=_mm256_add_ps(Vtmp1,Vtmp2);) +ENABLE_SCALAR_IMPLEMENTATION(SS33.f=SS33.f*Stmp3.f;) ENABLE_SSE_IMPLEMENTATION(VS33=_mm_mul_ps(VS33,Vtmp3);) ENABLE_AVX_IMPLEMENTATION(VS33=_mm256_mul_ps(VS33,Vtmp3);) +ENABLE_SCALAR_IMPLEMENTATION(SS31.f=SS31.f*Stmp3.f;) ENABLE_SSE_IMPLEMENTATION(VS31=_mm_mul_ps(VS31,Vtmp3);) ENABLE_AVX_IMPLEMENTATION(VS31=_mm256_mul_ps(VS31,Vtmp3);) +ENABLE_SCALAR_IMPLEMENTATION(SS32.f=SS32.f*Stmp3.f;) ENABLE_SSE_IMPLEMENTATION(VS32=_mm_mul_ps(VS32,Vtmp3);) ENABLE_AVX_IMPLEMENTATION(VS32=_mm256_mul_ps(VS32,Vtmp3);) +ENABLE_SCALAR_IMPLEMENTATION(SS33.f=SS33.f*Stmp3.f;) ENABLE_SSE_IMPLEMENTATION(VS33=_mm_mul_ps(VS33,Vtmp3);) ENABLE_AVX_IMPLEMENTATION(VS33=_mm256_mul_ps(VS33,Vtmp3);) +#endif + +ENABLE_SCALAR_IMPLEMENTATION(Stmp1.f=Ss.f*SS31.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp1=_mm_mul_ps(Vs,VS31);) ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_mul_ps(Vs,VS31);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.f=Ss.f*SS32.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_mul_ps(Vs,VS32);) ENABLE_AVX_IMPLEMENTATION(Vtmp2=_mm256_mul_ps(Vs,VS32);) +ENABLE_SCALAR_IMPLEMENTATION(SS31.f=Sc.f*SS31.f;) ENABLE_SSE_IMPLEMENTATION(VS31=_mm_mul_ps(Vc,VS31);) ENABLE_AVX_IMPLEMENTATION(VS31=_mm256_mul_ps(Vc,VS31);) +ENABLE_SCALAR_IMPLEMENTATION(SS32.f=Sc.f*SS32.f;) ENABLE_SSE_IMPLEMENTATION(VS32=_mm_mul_ps(Vc,VS32);) ENABLE_AVX_IMPLEMENTATION(VS32=_mm256_mul_ps(Vc,VS32);) +ENABLE_SCALAR_IMPLEMENTATION(SS31.f=Stmp2.f+SS31.f;) ENABLE_SSE_IMPLEMENTATION(VS31=_mm_add_ps(Vtmp2,VS31);) ENABLE_AVX_IMPLEMENTATION(VS31=_mm256_add_ps(Vtmp2,VS31);) +ENABLE_SCALAR_IMPLEMENTATION(SS32.f=SS32.f-Stmp1.f;) ENABLE_SSE_IMPLEMENTATION(VS32=_mm_sub_ps(VS32,Vtmp1);) ENABLE_AVX_IMPLEMENTATION(VS32=_mm256_sub_ps(VS32,Vtmp1);) + +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.f=Ss.f*Ss.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_mul_ps(Vs,Vs);) ENABLE_AVX_IMPLEMENTATION(Vtmp2=_mm256_mul_ps(Vs,Vs);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp1.f=SS22.f*Stmp2.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp1=_mm_mul_ps(VS22,Vtmp2);) ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_mul_ps(VS22,Vtmp2);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp3.f=SS11.f*Stmp2.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp3=_mm_mul_ps(VS11,Vtmp2);) ENABLE_AVX_IMPLEMENTATION(Vtmp3=_mm256_mul_ps(VS11,Vtmp2);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp4.f=Sc.f*Sc.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp4=_mm_mul_ps(Vc,Vc);) ENABLE_AVX_IMPLEMENTATION(Vtmp4=_mm256_mul_ps(Vc,Vc);) +ENABLE_SCALAR_IMPLEMENTATION(SS11.f=SS11.f*Stmp4.f;) ENABLE_SSE_IMPLEMENTATION(VS11=_mm_mul_ps(VS11,Vtmp4);) ENABLE_AVX_IMPLEMENTATION(VS11=_mm256_mul_ps(VS11,Vtmp4);) +ENABLE_SCALAR_IMPLEMENTATION(SS22.f=SS22.f*Stmp4.f;) ENABLE_SSE_IMPLEMENTATION(VS22=_mm_mul_ps(VS22,Vtmp4);) ENABLE_AVX_IMPLEMENTATION(VS22=_mm256_mul_ps(VS22,Vtmp4);) +ENABLE_SCALAR_IMPLEMENTATION(SS11.f=SS11.f+Stmp1.f;) ENABLE_SSE_IMPLEMENTATION(VS11=_mm_add_ps(VS11,Vtmp1);) ENABLE_AVX_IMPLEMENTATION(VS11=_mm256_add_ps(VS11,Vtmp1);) +ENABLE_SCALAR_IMPLEMENTATION(SS22.f=SS22.f+Stmp3.f;) ENABLE_SSE_IMPLEMENTATION(VS22=_mm_add_ps(VS22,Vtmp3);) ENABLE_AVX_IMPLEMENTATION(VS22=_mm256_add_ps(VS22,Vtmp3);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp4.f=Stmp4.f-Stmp2.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp4=_mm_sub_ps(Vtmp4,Vtmp2);) ENABLE_AVX_IMPLEMENTATION(Vtmp4=_mm256_sub_ps(Vtmp4,Vtmp2);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.f=SS21.f+SS21.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_add_ps(VS21,VS21);) ENABLE_AVX_IMPLEMENTATION(Vtmp2=_mm256_add_ps(VS21,VS21);) +ENABLE_SCALAR_IMPLEMENTATION(SS21.f=SS21.f*Stmp4.f;) ENABLE_SSE_IMPLEMENTATION(VS21=_mm_mul_ps(VS21,Vtmp4);) ENABLE_AVX_IMPLEMENTATION(VS21=_mm256_mul_ps(VS21,Vtmp4);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp4.f=Sc.f*Ss.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp4=_mm_mul_ps(Vc,Vs);) ENABLE_AVX_IMPLEMENTATION(Vtmp4=_mm256_mul_ps(Vc,Vs);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.f=Stmp2.f*Stmp4.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_mul_ps(Vtmp2,Vtmp4);) ENABLE_AVX_IMPLEMENTATION(Vtmp2=_mm256_mul_ps(Vtmp2,Vtmp4);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp5.f=Stmp5.f*Stmp4.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp5=_mm_mul_ps(Vtmp5,Vtmp4);) ENABLE_AVX_IMPLEMENTATION(Vtmp5=_mm256_mul_ps(Vtmp5,Vtmp4);) +ENABLE_SCALAR_IMPLEMENTATION(SS11.f=SS11.f+Stmp2.f;) ENABLE_SSE_IMPLEMENTATION(VS11=_mm_add_ps(VS11,Vtmp2);) ENABLE_AVX_IMPLEMENTATION(VS11=_mm256_add_ps(VS11,Vtmp2);) +ENABLE_SCALAR_IMPLEMENTATION(SS21.f=SS21.f-Stmp5.f;) ENABLE_SSE_IMPLEMENTATION(VS21=_mm_sub_ps(VS21,Vtmp5);) ENABLE_AVX_IMPLEMENTATION(VS21=_mm256_sub_ps(VS21,Vtmp5);) +ENABLE_SCALAR_IMPLEMENTATION(SS22.f=SS22.f-Stmp2.f;) ENABLE_SSE_IMPLEMENTATION(VS22=_mm_sub_ps(VS22,Vtmp2);) ENABLE_AVX_IMPLEMENTATION(VS22=_mm256_sub_ps(VS22,Vtmp2);) + +//########################################################### +// Compute the cumulative rotation, in quaternion form +//########################################################### + +ENABLE_SCALAR_IMPLEMENTATION(Stmp1.f=Ssh.f*Sqvvx.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp1=_mm_mul_ps(Vsh,Vqvvx);) ENABLE_AVX_IMPLEMENTATION(Vtmp1=_mm256_mul_ps(Vsh,Vqvvx);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp2.f=Ssh.f*Sqvvy.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp2=_mm_mul_ps(Vsh,Vqvvy);) ENABLE_AVX_IMPLEMENTATION(Vtmp2=_mm256_mul_ps(Vsh,Vqvvy);) +ENABLE_SCALAR_IMPLEMENTATION(Stmp3.f=Ssh.f*Sqvvz.f;) ENABLE_SSE_IMPLEMENTATION(Vtmp3=_mm_mul_ps(Vsh,Vqvvz);) ENABLE_AVX_IMPLEMENTATION(Vtmp3=_mm256_mul_ps(Vsh,Vqvvz);) +ENABLE_SCALAR_IMPLEMENTATION(Ssh.f=Ssh.f*Sqvs.f;) ENABLE_SSE_IMPLEMENTATION(Vsh=_mm_mul_ps(Vsh,Vqvs);) ENABLE_AVX_IMPLEMENTATION(Vsh=_mm256_mul_ps(Vsh,Vqvs);) + +ENABLE_SCALAR_IMPLEMENTATION(Sqvs.f=Sch.f*Sqvs.f;) ENABLE_SSE_IMPLEMENTATION(Vqvs=_mm_mul_ps(Vch,Vqvs);) ENABLE_AVX_IMPLEMENTATION(Vqvs=_mm256_mul_ps(Vch,Vqvs);) +ENABLE_SCALAR_IMPLEMENTATION(Sqvvx.f=Sch.f*Sqvvx.f;) ENABLE_SSE_IMPLEMENTATION(Vqvvx=_mm_mul_ps(Vch,Vqvvx);) ENABLE_AVX_IMPLEMENTATION(Vqvvx=_mm256_mul_ps(Vch,Vqvvx);) +ENABLE_SCALAR_IMPLEMENTATION(Sqvvy.f=Sch.f*Sqvvy.f;) ENABLE_SSE_IMPLEMENTATION(Vqvvy=_mm_mul_ps(Vch,Vqvvy);) ENABLE_AVX_IMPLEMENTATION(Vqvvy=_mm256_mul_ps(Vch,Vqvvy);) +ENABLE_SCALAR_IMPLEMENTATION(Sqvvz.f=Sch.f*Sqvvz.f;) ENABLE_SSE_IMPLEMENTATION(Vqvvz=_mm_mul_ps(Vch,Vqvvz);) ENABLE_AVX_IMPLEMENTATION(Vqvvz=_mm256_mul_ps(Vch,Vqvvz);) + +ENABLE_SCALAR_IMPLEMENTATION(SQVVZ.f=SQVVZ.f+Ssh.f;) ENABLE_SSE_IMPLEMENTATION(VQVVZ=_mm_add_ps(VQVVZ,Vsh);) ENABLE_AVX_IMPLEMENTATION(VQVVZ=_mm256_add_ps(VQVVZ,Vsh);) +ENABLE_SCALAR_IMPLEMENTATION(Sqvs.f=Sqvs.f-STMP3.f;) ENABLE_SSE_IMPLEMENTATION(Vqvs=_mm_sub_ps(Vqvs,VTMP3);) ENABLE_AVX_IMPLEMENTATION(Vqvs=_mm256_sub_ps(Vqvs,VTMP3);) +ENABLE_SCALAR_IMPLEMENTATION(SQVVX.f=SQVVX.f+STMP2.f;) ENABLE_SSE_IMPLEMENTATION(VQVVX=_mm_add_ps(VQVVX,VTMP2);) ENABLE_AVX_IMPLEMENTATION(VQVVX=_mm256_add_ps(VQVVX,VTMP2);) +ENABLE_SCALAR_IMPLEMENTATION(SQVVY.f=SQVVY.f-STMP1.f;) ENABLE_SSE_IMPLEMENTATION(VQVVY=_mm_sub_ps(VQVVY,VTMP1);) ENABLE_AVX_IMPLEMENTATION(VQVVY=_mm256_sub_ps(VQVVY,VTMP1);) diff --git a/vendor/libigl/include/igl/SolverStatus.h b/vendor/libigl/include/igl/SolverStatus.h new file mode 100644 index 0000000000000000000000000000000000000000..d9151f5c051504ef2a27401e3af661acc66ba349 --- /dev/null +++ b/vendor/libigl/include/igl/SolverStatus.h @@ -0,0 +1,23 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_SOLVER_STATUS_H +#define IGL_SOLVER_STATUS_H +namespace igl +{ + enum SolverStatus + { + // Good + SOLVER_STATUS_CONVERGED = 0, + // OK + SOLVER_STATUS_MAX_ITER = 1, + // Bad + SOLVER_STATUS_ERROR = 2, + NUM_SOLVER_STATUSES = 3, + }; +}; +#endif diff --git a/vendor/libigl/include/igl/Viewport.h b/vendor/libigl/include/igl/Viewport.h new file mode 100644 index 0000000000000000000000000000000000000000..717d3f97bf4f43391d49cda2a2d649324b275a32 --- /dev/null +++ b/vendor/libigl/include/igl/Viewport.h @@ -0,0 +1,69 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_VIEWPORT_H +#define IGL_VIEWPORT_H + +namespace igl +{ + // Simple Viewport class for an opengl context. Handles reshaping and mouse. + struct Viewport + { + int x,y,width,height; + // Constructors + Viewport( + const int x=0, + const int y=0, + const int width=0, + const int height=0): + x(x), + y(y), + width(width), + height(height) + { + }; + virtual ~Viewport(){} + void reshape( + const int x, + const int y, + const int width, + const int height) + { + this->x = x; + this->y = y; + this->width = width; + this->height = height; + }; + // Given mouse_x,mouse_y on the entire window return mouse_x, mouse_y in + // this viewport. + // + // Inputs: + // my mouse y-coordinate + // wh window height + // Returns y-coordinate in viewport + int mouse_y(const int my,const int wh) + { + return my - (wh - height - y); + } + // Inputs: + // mx mouse x-coordinate + // Returns x-coordinate in viewport + int mouse_x(const int mx) + { + return mx - x; + } + // Returns whether point (mx,my) is in extend of Viewport + bool inside(const int mx, const int my) const + { + return + mx >= x && my >= y && + mx < x+width && my < y+height; + } + }; +} + +#endif diff --git a/vendor/libigl/include/igl/WindingNumberMethod.h b/vendor/libigl/include/igl/WindingNumberMethod.h new file mode 100644 index 0000000000000000000000000000000000000000..3bb9062b150d5dad700aecc591a02ca5bd9a7144 --- /dev/null +++ b/vendor/libigl/include/igl/WindingNumberMethod.h @@ -0,0 +1,23 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_WINDINGNUMBERMETHOD_H +#define IGL_WINDINGNUMBERMETHOD_H +namespace igl +{ + // EXACT_WINDING_NUMBER_METHOD exact hierarchical evaluation + // APPROX_SIMPLE_WINDING_NUMBER_METHOD poor approximation + // APPROX_CACHE_WINDING_NUMBER_METHOD another poor approximation + enum WindingNumberMethod + { + EXACT_WINDING_NUMBER_METHOD = 0, + APPROX_SIMPLE_WINDING_NUMBER_METHOD = 1, + APPROX_CACHE_WINDING_NUMBER_METHOD = 2, + NUM_WINDING_NUMBER_METHODS = 3 + }; +} +#endif diff --git a/vendor/libigl/include/igl/any.cpp b/vendor/libigl/include/igl/any.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0488c8ffb0f81fc6441b0fbe69618f9983d6b874 --- /dev/null +++ b/vendor/libigl/include/igl/any.cpp @@ -0,0 +1,26 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "any.h" +#include "redux.h" + + +template +IGL_INLINE void igl::any( + const Eigen::SparseMatrix & A, + const int dim, + Eigen::PlainObjectBase& B) +{ + typedef typename DerivedB::Scalar Scalar; + igl::redux(A,dim,[](Scalar a, Scalar b){ return a || b!=0;},B); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::any >(Eigen::SparseMatrix const&, int, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/arap.cpp b/vendor/libigl/include/igl/arap.cpp new file mode 100644 index 0000000000000000000000000000000000000000..03bd0d048c5e3e120b1b094824f99ad0dfda7a3d --- /dev/null +++ b/vendor/libigl/include/igl/arap.cpp @@ -0,0 +1,306 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "arap.h" +#include "colon.h" +#include "cotmatrix.h" +#include "massmatrix.h" +#include "group_sum_matrix.h" +#include "covariance_scatter_matrix.h" +#include "speye.h" +#include "mode.h" +#include "project_isometrically_to_plane.h" +#include "slice.h" +#include "arap_rhs.h" +#include "repdiag.h" +#include "columnize.h" +#include "fit_rotations.h" +#include +#include + +template +using MatrixXX = Eigen::Matrix; + +template < + typename DerivedV, + typename DerivedF, + typename Derivedb> +IGL_INLINE bool igl::arap_precomputation( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const int dim, + const Eigen::MatrixBase & b, + ARAPData & data) +{ + using namespace std; + using namespace Eigen; + typedef typename DerivedV::Scalar Scalar; + typedef typename DerivedF::Scalar Integer; + // number of vertices + const int n = V.rows(); + data.n = n; + assert((b.size() == 0 || b.maxCoeff() < n) && "b out of bounds"); + assert((b.size() == 0 || b.minCoeff() >=0) && "b out of bounds"); + // remember b + data.b = b; + //assert(F.cols() == 3 && "For now only triangles"); + // dimension + //const int dim = V.cols(); + assert((dim == 3 || dim ==2) && "dim should be 2 or 3"); + data.dim = dim; + //assert(dim == 3 && "Only 3d supported"); + // Defaults + data.f_ext = MatrixXd::Zero(n,data.dim); + + assert(data.dim <= V.cols() && "solve dim should be <= embedding"); + bool flat = (V.cols() - data.dim)==1; + + MatrixXX plane_V; + MatrixXX plane_F; + typedef SparseMatrix SparseMatrixS; + SparseMatrixS ref_map,ref_map_dim; + if(flat) + { + project_isometrically_to_plane(V,F,plane_V,plane_F,ref_map); + repdiag(ref_map,dim,ref_map_dim); + } + const MatrixXX& ref_V = (flat?plane_V:V); + const MatrixXX& ref_F = (flat?plane_F:F); + SparseMatrixS L; + cotmatrix(V,F,L); + + ARAPEnergyType eff_energy = data.energy; + if(eff_energy == ARAP_ENERGY_TYPE_DEFAULT) + { + switch(F.cols()) + { + case 3: + if(data.dim == 3) + { + eff_energy = ARAP_ENERGY_TYPE_SPOKES_AND_RIMS; + }else + { + eff_energy = ARAP_ENERGY_TYPE_ELEMENTS; + } + break; + case 4: + eff_energy = ARAP_ENERGY_TYPE_ELEMENTS; + break; + default: + assert(false); + } + } + + + // Get covariance scatter matrix, when applied collects the covariance + // matrices used to fit rotations to during optimization + covariance_scatter_matrix(ref_V,ref_F,eff_energy,data.CSM); + if(flat) + { + data.CSM = (data.CSM * ref_map_dim.transpose()).eval(); + } + assert(data.CSM.cols() == V.rows()*data.dim); + + // Get group sum scatter matrix, when applied sums all entries of the same + // group according to G + SparseMatrix G_sum; + if(data.G.size() == 0) + { + if(eff_energy == ARAP_ENERGY_TYPE_ELEMENTS) + { + speye(F.rows(),G_sum); + }else + { + speye(n,G_sum); + } + }else + { + // groups are defined per vertex, convert to per face using mode + if(eff_energy == ARAP_ENERGY_TYPE_ELEMENTS) + { + Eigen::Matrix GG; + MatrixXi GF(F.rows(),F.cols()); + for(int j = 0;j GFj; + slice(data.G,F.col(j),GFj); + GF.col(j) = GFj; + } + mode(GF,2,GG); + data.G=GG; + } + //printf("group_sum_matrix()\n"); + group_sum_matrix(data.G,G_sum); + } + SparseMatrix G_sum_dim; + repdiag(G_sum,data.dim,G_sum_dim); + assert(G_sum_dim.cols() == data.CSM.rows()); + data.CSM = (G_sum_dim * data.CSM).eval(); + + + arap_rhs(ref_V,ref_F,data.dim,eff_energy,data.K); + if(flat) + { + data.K = (ref_map_dim * data.K).eval(); + } + assert(data.K.rows() == data.n*data.dim); + + SparseMatrix Q = (-L).eval(); + + if(data.with_dynamics) + { + const double h = data.h; + assert(h != 0); + SparseMatrix M; + massmatrix(V,F,MASSMATRIX_TYPE_DEFAULT,data.M); + const double dw = (1./data.ym)*(h*h); + SparseMatrix DQ = dw * 1./(h*h)*data.M; + Q += DQ; + // Dummy external forces + data.f_ext = MatrixXd::Zero(n,data.dim); + data.vel = MatrixXd::Zero(n,data.dim); + } + + return min_quad_with_fixed_precompute( + Q,b,SparseMatrix(),true,data.solver_data); +} + +template < + typename Derivedbc, + typename DerivedU> +IGL_INLINE bool igl::arap_solve( + const Eigen::MatrixBase & bc, + ARAPData & data, + Eigen::MatrixBase & U) +{ + using namespace Eigen; + using namespace std; + assert(data.b.size() == bc.rows()); + assert(U.size() != 0 && "U cannot be empty"); + assert(U.cols() == data.dim && "U.cols() match data.dim"); + if (bc.size() > 0) { + assert(bc.cols() == data.dim && "bc.cols() match data.dim"); + } + const int n = data.n; + int iter = 0; + // changes each arap iteration + MatrixXd U_prev = U; + // doesn't change for fixed with_dynamics timestep + MatrixXd U0; + if(data.with_dynamics) + { + U0 = U_prev; + } + while(iter < data.max_iter) + { + U_prev = U; + // enforce boundary conditions exactly + for(int bi = 0;bi0) + { + bcc = bc.col(c); + } + min_quad_with_fixed_solve( + data.solver_data, + Bc,bcc,Beq, + Uc); + U.col(c) = Uc; + } + + iter++; + } + if(data.with_dynamics) + { + // Keep track of velocity for next time + data.vel = (U-U0)/data.h; + } + + return true; +} + +#ifdef IGL_STATIC_LIBRARY +template bool igl::arap_solve, Eigen::Matrix >(Eigen::MatrixBase > const&, igl::ARAPData&, Eigen::MatrixBase >&); +template bool igl::arap_precomputation, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, Eigen::MatrixBase > const&, igl::ARAPData&); +#endif diff --git a/vendor/libigl/include/igl/arap.h b/vendor/libigl/include/igl/arap.h new file mode 100644 index 0000000000000000000000000000000000000000..d345f371990fc92a53be7d16ac2f3f8c30adffe7 --- /dev/null +++ b/vendor/libigl/include/igl/arap.h @@ -0,0 +1,112 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_ARAP_H +#define IGL_ARAP_H +#include "igl_inline.h" +#include "min_quad_with_fixed.h" +#include "ARAPEnergyType.h" +#include +#include + +namespace igl +{ + struct ARAPData + { + // n #V + // G #V list of group indices (1 to k) for each vertex, such that vertex i + // is assigned to group G(i) + // energy type of energy to use + // with_dynamics whether using dynamics (need to call arap_precomputation + // after changing) + // f_ext #V by dim list of external forces + // vel #V by dim list of velocities + // h dynamics time step + // ym ~Young's modulus smaller is softer, larger is more rigid/stiff + // max_iter maximum inner iterations + // K rhs pre-multiplier + // M mass matrix + // solver_data quadratic solver data + // b list of boundary indices into V + // dim dimension being used for solving + int n; + Eigen::VectorXi G; + ARAPEnergyType energy; + bool with_dynamics; + Eigen::MatrixXd f_ext,vel; + double h; + double ym; + int max_iter; + Eigen::SparseMatrix K,M; + Eigen::SparseMatrix CSM; + min_quad_with_fixed_data solver_data; + Eigen::VectorXi b; + int dim; + ARAPData(): + n(0), + G(), + energy(ARAP_ENERGY_TYPE_DEFAULT), + with_dynamics(false), + f_ext(), + h(1), + ym(1), + max_iter(10), + K(), + CSM(), + solver_data(), + b(), + dim(-1) // force this to be set by _precomputation + { + }; + }; + + // Compute necessary information to start using an ARAP deformation + // + // Inputs: + // V #V by dim list of mesh positions + // F #F by simplex-size list of triangle|tet indices into V + // dim dimension being used at solve time. For deformation usually dim = + // V.cols(), for surface parameterization V.cols() = 3 and dim = 2 + // b #b list of "boundary" fixed vertex indices into V + // Outputs: + // data struct containing necessary precomputation + template < + typename DerivedV, + typename DerivedF, + typename Derivedb> + IGL_INLINE bool arap_precomputation( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const int dim, + const Eigen::MatrixBase & b, + ARAPData & data); + // Inputs: + // bc #b by dim list of boundary conditions + // data struct containing necessary precomputation and parameters + // U #V by dim initial guess + // + // NOTE: While the libigl guidelines require outputs to be of type + // PlainObjectBase so that the user does not need to worry about allocating + // memory for the output, in this case, the user is required to give an initial + // guess and hence fix the size of the problem domain. + // Taking a reference to MatrixBase in this case thus allows the user to provide e.g. + // a map to the position data, allowing seamless interoperability with user-defined + // datastructures without requiring a copy. + template < + typename Derivedbc, + typename DerivedU> + IGL_INLINE bool arap_solve( + const Eigen::MatrixBase & bc, + ARAPData & data, + Eigen::MatrixBase & U); +}; + +#ifndef IGL_STATIC_LIBRARY +#include "arap.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/arap_linear_block.cpp b/vendor/libigl/include/igl/arap_linear_block.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7501721b6ec70b9e67a3075320939dc196c250dd --- /dev/null +++ b/vendor/libigl/include/igl/arap_linear_block.cpp @@ -0,0 +1,259 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "arap_linear_block.h" +#include "verbose.h" +#include "cotmatrix_entries.h" +#include + +template +IGL_INLINE void igl::arap_linear_block( + const MatV & V, + const MatF & F, + const int d, + const igl::ARAPEnergyType energy, + MatK & Kd) +{ + switch(energy) + { + case ARAP_ENERGY_TYPE_SPOKES: + return igl::arap_linear_block_spokes(V,F,d,Kd); + break; + case ARAP_ENERGY_TYPE_SPOKES_AND_RIMS: + return igl::arap_linear_block_spokes_and_rims(V,F,d,Kd); + break; + case ARAP_ENERGY_TYPE_ELEMENTS: + return igl::arap_linear_block_elements(V,F,d,Kd); + break; + default: + verbose("Unsupported energy type: %d\n",energy); + assert(false); + } +} + + +template +IGL_INLINE void igl::arap_linear_block_spokes( + const MatV & V, + const MatF & F, + const int d, + MatK & Kd) +{ + typedef typename MatK::Scalar Scalar; + + using namespace std; + using namespace Eigen; + // simplex size (3: triangles, 4: tetrahedra) + int simplex_size = F.cols(); + // Number of elements + int m = F.rows(); + // Temporary output + Matrix edges; + Kd.resize(V.rows(), V.rows()); + vector > Kd_IJV; + if(simplex_size == 3) + { + // triangles + Kd.reserve(7*V.rows()); + Kd_IJV.reserve(7*V.rows()); + edges.resize(3,2); + edges << + 1,2, + 2,0, + 0,1; + }else if(simplex_size == 4) + { + // tets + Kd.reserve(17*V.rows()); + Kd_IJV.reserve(17*V.rows()); + edges.resize(6,2); + edges << + 1,2, + 2,0, + 0,1, + 3,0, + 3,1, + 3,2; + } + // gather cotangent weights + Matrix C; + cotmatrix_entries(V,F,C); + // should have weights for each edge + assert(C.cols() == edges.rows()); + // loop over elements + for(int i = 0;i(source,dest,v)); + Kd_IJV.push_back(Triplet(dest,source,-v)); + Kd_IJV.push_back(Triplet(source,source,v)); + Kd_IJV.push_back(Triplet(dest,dest,-v)); + } + } + Kd.setFromTriplets(Kd_IJV.begin(),Kd_IJV.end()); + Kd.makeCompressed(); +} + +template +IGL_INLINE void igl::arap_linear_block_spokes_and_rims( + const MatV & V, + const MatF & F, + const int d, + MatK & Kd) +{ + typedef typename MatK::Scalar Scalar; + + using namespace std; + using namespace Eigen; + // simplex size (3: triangles, 4: tetrahedra) + int simplex_size = F.cols(); + // Number of elements + int m = F.rows(); + // Temporary output + Kd.resize(V.rows(), V.rows()); + vector > Kd_IJV; + Matrix edges; + if(simplex_size == 3) + { + // triangles + Kd.reserve(7*V.rows()); + Kd_IJV.reserve(7*V.rows()); + edges.resize(3,2); + edges << + 1,2, + 2,0, + 0,1; + }else if(simplex_size == 4) + { + // tets + Kd.reserve(17*V.rows()); + Kd_IJV.reserve(17*V.rows()); + edges.resize(6,2); + edges << + 1,2, + 2,0, + 0,1, + 3,0, + 3,1, + 3,2; + // Not implemented yet for tets + assert(false); + } + // gather cotangent weights + Matrix C; + cotmatrix_entries(V,F,C); + // should have weights for each edge + assert(C.cols() == edges.rows()); + // loop over elements + for(int i = 0;i(Rs,Rd,v)); + Kd_IJV.push_back(Triplet(Rd,Rs,-v)); + }else if(Rd == source) + { + Kd_IJV.push_back(Triplet(Rd,Rs,v)); + }else if(Rs == dest) + { + Kd_IJV.push_back(Triplet(Rs,Rd,-v)); + } + } + Kd_IJV.push_back(Triplet(source,source,v)); + Kd_IJV.push_back(Triplet(dest,dest,-v)); + } + } + Kd.setFromTriplets(Kd_IJV.begin(),Kd_IJV.end()); + Kd.makeCompressed(); +} + +template +IGL_INLINE void igl::arap_linear_block_elements( + const MatV & V, + const MatF & F, + const int d, + MatK & Kd) +{ + typedef typename MatK::Scalar Scalar; + using namespace std; + using namespace Eigen; + // simplex size (3: triangles, 4: tetrahedra) + int simplex_size = F.cols(); + // Number of elements + int m = F.rows(); + // Temporary output + Kd.resize(V.rows(), F.rows()); + vector > Kd_IJV; + Matrix edges; + if(simplex_size == 3) + { + // triangles + Kd.reserve(7*V.rows()); + Kd_IJV.reserve(7*V.rows()); + edges.resize(3,2); + edges << + 1,2, + 2,0, + 0,1; + }else if(simplex_size == 4) + { + // tets + Kd.reserve(17*V.rows()); + Kd_IJV.reserve(17*V.rows()); + edges.resize(6,2); + edges << + 1,2, + 2,0, + 0,1, + 3,0, + 3,1, + 3,2; + } + // gather cotangent weights + Matrix C; + cotmatrix_entries(V,F,C); + // should have weights for each edge + assert(C.cols() == edges.rows()); + // loop over elements + for(int i = 0;i(source,i,v)); + Kd_IJV.push_back(Triplet(dest,i,-v)); + } + } + Kd.setFromTriplets(Kd_IJV.begin(),Kd_IJV.end()); + Kd.makeCompressed(); +} + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::arap_linear_block >, Eigen::MatrixBase >, Eigen::SparseMatrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, igl::ARAPEnergyType, Eigen::SparseMatrix&); +template void igl::arap_linear_block, Eigen::Matrix, Eigen::SparseMatrix >(Eigen::Matrix const&, Eigen::Matrix const&, int, igl::ARAPEnergyType, Eigen::SparseMatrix&); +#endif diff --git a/vendor/libigl/include/igl/arap_rhs.cpp b/vendor/libigl/include/igl/arap_rhs.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0a794e5f0c9258e1885deb1f4fb06a156a2ea1e9 --- /dev/null +++ b/vendor/libigl/include/igl/arap_rhs.cpp @@ -0,0 +1,95 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "arap_rhs.h" +#include "arap_linear_block.h" +#include "verbose.h" +#include "repdiag.h" +#include "cat.h" +#include + +template +IGL_INLINE void igl::arap_rhs( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const int dim, + const igl::ARAPEnergyType energy, + Eigen::SparseCompressedBase& K) +{ + using namespace std; + using namespace Eigen; + // Number of dimensions + int Vdim = V.cols(); + //// Number of mesh vertices + //int n = V.rows(); + //// Number of mesh elements + //int m = F.rows(); + //// number of rotations + //int nr; + switch(energy) + { + case ARAP_ENERGY_TYPE_SPOKES: + //nr = n; + break; + case ARAP_ENERGY_TYPE_SPOKES_AND_RIMS: + //nr = n; + break; + case ARAP_ENERGY_TYPE_ELEMENTS: + //nr = m; + break; + default: + fprintf( + stderr, + "arap_rhs.h: Error: Unsupported arap energy %d\n", + energy); + return; + } + + DerivedK KX,KY,KZ; + arap_linear_block(V,F,0,energy,KX); + arap_linear_block(V,F,1,energy,KY); + if(Vdim == 2) + { + K = cat(2,repdiag(KX,dim),repdiag(KY,dim)); + }else if(Vdim == 3) + { + arap_linear_block(V,F,2,energy,KZ); + if(dim == 3) + { + K = cat(2,cat(2,repdiag(KX,dim),repdiag(KY,dim)),repdiag(KZ,dim)); + }else if(dim ==2) + { + DerivedK ZZ(KX.rows()*2,KX.cols()); + K = cat(2,cat(2, + cat(2,repdiag(KX,dim),ZZ), + cat(2,repdiag(KY,dim),ZZ)), + cat(2,repdiag(KZ,dim),ZZ)); + }else + { + assert(false); + fprintf( + stderr, + "arap_rhs.h: Error: Unsupported dimension %d\n", + dim); + } + }else + { + assert(false); + fprintf( + stderr, + "arap_rhs.h: Error: Unsupported dimension %d\n", + Vdim); + return; + } + +} + + + +#ifdef IGL_STATIC_LIBRARY +template void igl::arap_rhs(const Eigen::MatrixBase & V, const Eigen::MatrixBase & F,const int dim, const igl::ARAPEnergyType energy,Eigen::SparseCompressedBase>& K); +#endif \ No newline at end of file diff --git a/vendor/libigl/include/igl/arap_rhs.h b/vendor/libigl/include/igl/arap_rhs.h new file mode 100644 index 0000000000000000000000000000000000000000..2d456f6bcfa0837638b3c3319afbe88a7b2109a3 --- /dev/null +++ b/vendor/libigl/include/igl/arap_rhs.h @@ -0,0 +1,43 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_ARAP_RHS_H +#define IGL_ARAP_RHS_H +#include "igl_inline.h" + +#include +#include +#include + +namespace igl +{ + // ARAP_RHS build right-hand side constructor of global poisson solve for + // various Arap energies + // Inputs: + // V #V by Vdim list of initial domain positions + // F #F by 3 list of triangle indices into V + // dim dimension being used at solve time. For deformation usually dim = + // V.cols(), for surface parameterization V.cols() = 3 and dim = 2 + // energy igl::ARAPEnergyType enum value defining which energy is being + // used. See igl::ARAPEnergyType.h for valid options and explanations. + // Outputs: + // K #V*dim by #(F|V)*dim*dim matrix such that: + // b = K * reshape(permute(R,[3 1 2]),size(V|F,1)*size(V,2)*size(V,2),1); + // + // See also: arap_linear_block + template + IGL_INLINE void arap_rhs( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const int dim, + const igl::ARAPEnergyType energy, + Eigen::SparseCompressedBase& K); +} +#ifndef IGL_STATIC_LIBRARY +#include "arap_rhs.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/average_from_edges_onto_vertices.h b/vendor/libigl/include/igl/average_from_edges_onto_vertices.h new file mode 100644 index 0000000000000000000000000000000000000000..fb290f8b5679d1cf51ec4d345b9c5670409925f7 --- /dev/null +++ b/vendor/libigl/include/igl/average_from_edges_onto_vertices.h @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Oded Stein +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_AVERAGE_FROM_EDGES_ONTO_VERTICES_H +#define IGL_AVERAGE_FROM_EDGES_ONTO_VERTICES_H +#include "igl_inline.h" + +#include +namespace igl +{ + // Move a scalar field defined on edges to vertices by averaging + // + // Input: + // F: triangle mesh connectivity + // E, oE: mapping from halfedges to edges and orientation as generated by + // orient_halfedges + // uE: scalar field defined on edges, one per edge + // + // Output: + // uV: scalar field defined on vertices + template + IGL_INLINE void average_from_edges_onto_vertices( + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &E, + const Eigen::MatrixBase &oE, + const Eigen::MatrixBase &uE, + Eigen::PlainObjectBase &uV); +} + +#ifndef IGL_STATIC_LIBRARY +# include "average_from_edges_onto_vertices.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/average_onto_faces.cpp b/vendor/libigl/include/igl/average_onto_faces.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b62c5e81aeb0d827cc4b35336225288ecddbc177 --- /dev/null +++ b/vendor/libigl/include/igl/average_onto_faces.cpp @@ -0,0 +1,27 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "average_onto_faces.h" + +template +IGL_INLINE void igl::average_onto_faces( + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & S, + Eigen::PlainObjectBase & SF) +{ + SF.setConstant(F.rows(),S.cols(),0); + for (int i = 0; i , Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/avg_edge_length.cpp b/vendor/libigl/include/igl/avg_edge_length.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b06d9ce5e06c3928818f9caff85aeca3c72c2897 --- /dev/null +++ b/vendor/libigl/include/igl/avg_edge_length.cpp @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "avg_edge_length.h" +#include "edges.h" + +#include + +template +IGL_INLINE double igl::avg_edge_length( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F) +{ + typedef typename DerivedF::Scalar Index; + Eigen::Matrix E; + + igl::edges(F, E); + + double avg = 0; + + for (unsigned i=0;i, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +template double igl::avg_edge_length, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +#endif diff --git a/vendor/libigl/include/igl/barycenter.cpp b/vendor/libigl/include/igl/barycenter.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55ac5e18b036443cc1cb459620ef437ba9fbcbda --- /dev/null +++ b/vendor/libigl/include/igl/barycenter.cpp @@ -0,0 +1,56 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "barycenter.h" + +template < + typename DerivedV, + typename DerivedF, + typename DerivedBC> +IGL_INLINE void igl::barycenter( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & BC) +{ + BC.setZero(F.rows(),V.cols()); + // Loop over faces + for(int i = 0;i, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::barycenter, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/basename.h b/vendor/libigl/include/igl/basename.h new file mode 100644 index 0000000000000000000000000000000000000000..fb333b5c421c87e08770eb05e8b53dbd6256d381 --- /dev/null +++ b/vendor/libigl/include/igl/basename.h @@ -0,0 +1,29 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_BASENAME_H +#define IGL_BASENAME_H +#include "igl_inline.h" + +#include + +namespace igl +{ + // Function like PHP's basename: /etc/sudoers.d --> sudoers.d + // Input: + // path string containing input path + // Returns string containing basename (see php's basename) + // + // See also: dirname, pathinfo + IGL_INLINE std::string basename(const std::string & path); +} + +#ifndef IGL_STATIC_LIBRARY +# include "basename.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/bbw.h b/vendor/libigl/include/igl/bbw.h new file mode 100644 index 0000000000000000000000000000000000000000..bec20bb98467d098a57631a8f403d5d913ba956b --- /dev/null +++ b/vendor/libigl/include/igl/bbw.h @@ -0,0 +1,77 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_BBW_H +#define IGL_BBW_H +#include "igl_inline.h" + +#include +#include + +namespace igl +{ + // Container for BBW computation related data and flags + class BBWData + { + public: + // Enforce partition of unity during optimization (optimize all weight + // simultaneously) + bool partition_unity; + // Initial guess + Eigen::MatrixXd W0; + igl::active_set_params active_set_params; + // Verbosity level + // 0: quiet + // 1: loud + // 2: louder + int verbosity; + public: + IGL_INLINE BBWData(); + // Print current state of object + IGL_INLINE void print(); + }; + + // Compute Bounded Biharmonic Weights on a given domain (V,Ele) with a given + // set of boundary conditions + // + // Templates + // DerivedV derived type of eigen matrix for V (e.g. MatrixXd) + // DerivedF derived type of eigen matrix for F (e.g. MatrixXi) + // Derivedb derived type of eigen matrix for b (e.g. VectorXi) + // Derivedbc derived type of eigen matrix for bc (e.g. MatrixXd) + // DerivedW derived type of eigen matrix for W (e.g. MatrixXd) + // Inputs: + // V #V by dim vertex positions + // Ele #Elements by simplex-size list of element indices + // b #b boundary indices into V + // bc #b by #W list of boundary values + // data object containing options, initial guess --> solution and results + // Outputs: + // W #V by #W list of *unnormalized* weights to normalize use + // igl::normalize_row_sums(W,W); + // Returns true on success, false on failure + template < + typename DerivedV, + typename DerivedEle, + typename Derivedb, + typename Derivedbc, + typename DerivedW> + IGL_INLINE bool bbw( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & Ele, + const Eigen::PlainObjectBase & b, + const Eigen::PlainObjectBase & bc, + BBWData & data, + Eigen::PlainObjectBase & W); +} + +#ifndef IGL_STATIC_LIBRARY +# include "bbw.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/bezier.cpp b/vendor/libigl/include/igl/bezier.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9cca6cbff5718a921c17dd424c8c68a67fdf3643 --- /dev/null +++ b/vendor/libigl/include/igl/bezier.cpp @@ -0,0 +1,74 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "bezier.h" +#include + +// Adapted from main.c accompanying +// An Algorithm for Automatically Fitting Digitized Curves +// by Philip J. Schneider +// from "Graphics Gems", Academic Press, 1990 +template +IGL_INLINE void igl::bezier( + const Eigen::MatrixBase & V, + const typename DerivedV::Scalar t, + Eigen::PlainObjectBase & P) +{ + // working local copy + DerivedV Vtemp = V; + int degree = Vtemp.rows()-1; + /* Triangle computation */ + for (int i = 1; i <= degree; i++) + { + for (int j = 0; j <= degree-i; j++) + { + Vtemp.row(j) = ((1.0 - t) * Vtemp.row(j) + t * Vtemp.row(j+1)).eval(); + } + } + P = Vtemp.row(0); +} + +template +IGL_INLINE void igl::bezier( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & T, + Eigen::PlainObjectBase & P) +{ + P.resize(T.size(),V.cols()); + for(int i = 0;i Pi; + bezier(V,T(i),Pi); + P.row(i) = Pi; + } +} + +template +IGL_INLINE void igl::bezier( + const std::vector & spline, + const Eigen::MatrixBase & T, + Eigen::PlainObjectBase & P) +{ + if(spline.size() == 0) return; + const int m = T.rows(); + const int dim = spline[0].cols(); + P.resize(m*spline.size(),dim); + for(int c = 0;c, Eigen::Matrix, Eigen::Matrix >(std::vector, std::allocator > > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::bezier, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::bezier, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::Matrix::Scalar, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/bfs_orient.h b/vendor/libigl/include/igl/bfs_orient.h new file mode 100644 index 0000000000000000000000000000000000000000..6c08592ca4630d46d6d5fdf29a3c203a2bc18b62 --- /dev/null +++ b/vendor/libigl/include/igl/bfs_orient.h @@ -0,0 +1,36 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_BFS_ORIENT_H +#define IGL_BFS_ORIENT_H +#include +#include + +namespace igl +{ + // Consistently orient faces in orientable patches using BFS + // + // F = bfs_orient(F,V); + // + // Inputs: + // F #F by 3 list of faces + // Outputs: + // FF #F by 3 list of faces (OK if same as F) + // C #F list of component ids + // + // + template + IGL_INLINE void bfs_orient( + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & C); +} +#ifndef IGL_STATIC_LIBRARY +# include "bfs_orient.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/bone_parents.cpp b/vendor/libigl/include/igl/bone_parents.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8434683e7f01cc2bd6a24f5ad659c258aced0721 --- /dev/null +++ b/vendor/libigl/include/igl/bone_parents.cpp @@ -0,0 +1,32 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "bone_parents.h" + +template +IGL_INLINE void igl::bone_parents( + const Eigen::MatrixBase& BE, + Eigen::PlainObjectBase& P) +{ + P.resize(BE.rows(),1); + // Stupid O(n²) version + for(int e = 0;e, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/boundary_conditions.h b/vendor/libigl/include/igl/boundary_conditions.h new file mode 100644 index 0000000000000000000000000000000000000000..643dbe7c1da6a37a9e56e3ffc3d0b50533a50952 --- /dev/null +++ b/vendor/libigl/include/igl/boundary_conditions.h @@ -0,0 +1,55 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_BOUNDARY_CONDITIONS_H +#define IGL_BOUNDARY_CONDITIONS_H +#include "igl_inline.h" +#include + +namespace igl +{ + + // Compute boundary conditions for automatic weights computation. This + // function expects that the given mesh (V,Ele) has sufficient samples + // (vertices) exactly at point handle locations and exactly along bone and + // cage edges. + // + // Inputs: + // V #V by dim list of domain vertices + // Ele #Ele by simplex-size list of simplex indices + // C #C by dim list of handle positions + // P #P by 1 list of point handle indices into C + // BE #BE by 2 list of bone edge indices into C + // CE #CE by 2 list of cage edge indices into *P* + // Outputs: + // b #b list of boundary indices (indices into V of vertices which have + // known, fixed values) + // bc #b by #weights list of known/fixed values for boundary vertices + // (notice the #b != #weights in general because #b will include all the + // intermediary samples along each bone, etc.. The ordering of the + // weights corresponds to [P;BE] + // Returns false if boundary conditions are suspicious: + // P and BE are empty + // bc is empty + // some column of bc doesn't have a 0 (assuming bc has >1 columns) + // some column of bc doesn't have a 1 (assuming bc has >1 columns) + IGL_INLINE bool boundary_conditions( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & Ele, + const Eigen::MatrixXd & C, + const Eigen::VectorXi & P, + const Eigen::MatrixXi & BE, + const Eigen::MatrixXi & CE, + Eigen::VectorXi & b, + Eigen::MatrixXd & bc); +} + +#ifndef IGL_STATIC_LIBRARY +# include "boundary_conditions.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/boundary_facets.h b/vendor/libigl/include/igl/boundary_facets.h new file mode 100644 index 0000000000000000000000000000000000000000..9258db69b373021e2b87171589eb9a0b9d177b69 --- /dev/null +++ b/vendor/libigl/include/igl/boundary_facets.h @@ -0,0 +1,57 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_BOUNDARY_FACETS_H +#define IGL_BOUNDARY_FACETS_H +#include "igl_inline.h" + +#include + +#include + +namespace igl +{ + // BOUNDARY_FACETS Determine boundary faces (edges) of tetrahedra (triangles) + // stored in T (analogous to qptoolbox's `outline` and `boundary_faces`). + // + // Input: + // T tetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra + // Output: + // F list of boundary faces, n by 3 (2), where n is the number of boundary faces + // J list of indices into T, n by 1 + // K list of indices revealing across from which vertex is this facet + // + // + template < + typename DerivedT, + typename DerivedF, + typename DerivedJ, + typename DerivedK> + IGL_INLINE void boundary_facets( + const Eigen::MatrixBase& T, + Eigen::PlainObjectBase& F, + Eigen::PlainObjectBase& J, + Eigen::PlainObjectBase& K); + template + IGL_INLINE void boundary_facets( + const Eigen::MatrixBase& T, + Eigen::PlainObjectBase& F); + // Same as above but returns F + template + Ret boundary_facets( + const Eigen::MatrixBase& T); + template + IGL_INLINE void boundary_facets( + const std::vector > & T, + std::vector > & F); +} + +#ifndef IGL_STATIC_LIBRARY +# include "boundary_facets.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/boundary_loop.cpp b/vendor/libigl/include/igl/boundary_loop.cpp new file mode 100644 index 0000000000000000000000000000000000000000..537a23d1c96e854f3ae889a025bd853bc1989fb5 --- /dev/null +++ b/vendor/libigl/include/igl/boundary_loop.cpp @@ -0,0 +1,154 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Stefan Brugger +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "boundary_loop.h" +#include "slice.h" +#include "triangle_triangle_adjacency.h" +#include "vertex_triangle_adjacency.h" +#include "is_border_vertex.h" +#include + +template +IGL_INLINE void igl::boundary_loop( + const Eigen::MatrixBase & F, + std::vector >& L) +{ + using namespace std; + using namespace Eigen; + + if(F.rows() == 0) + return; + + VectorXd Vdummy(F.maxCoeff()+1,1); + Eigen::Matrix TT,TTi; + vector > VF, VFi; + triangle_triangle_adjacency(F,TT,TTi); + vertex_triangle_adjacency(Vdummy,F,VF,VFi); + + vector unvisited = is_border_vertex(F); + set unseen; + for (size_t i = 0; i < unvisited.size(); ++i) + { + if (unvisited[i]) + unseen.insert(unseen.end(),i); + } + + while (!unseen.empty()) + { + vector l; + + // Get first vertex of loop + int start = *unseen.begin(); + unseen.erase(unseen.begin()); + unvisited[start] = false; + l.push_back(start); + + bool done = false; + while (!done) + { + // Find next vertex + bool newBndEdge = false; + int v = l[l.size()-1]; + int next; + for (int i = 0; i < (int)VF[v].size() && !newBndEdge; i++) + { + int fid = VF[v][i]; + + if (TT.row(fid).minCoeff() < 0.) // Face contains boundary edge + { + int vLoc = -1; + if (F(fid,0) == v) vLoc = 0; + if (F(fid,1) == v) vLoc = 1; + if (F(fid,2) == v) vLoc = 2; + + int vNext = F(fid,(vLoc + 1) % F.cols()); + + newBndEdge = false; + if (unvisited[vNext] && TT(fid,vLoc) < 0) + { + next = vNext; + newBndEdge = true; + } + } + } + + if (newBndEdge) + { + l.push_back(next); + unseen.erase(next); + unvisited[next] = false; + } + else + done = true; + } + L.push_back(l); + } +} + +template +IGL_INLINE void igl::boundary_loop( + const Eigen::MatrixBase& F, + std::vector& L) +{ + using namespace Eigen; + using namespace std; + + if(F.rows() == 0) + return; + + vector > Lall; + boundary_loop(F,Lall); + + int idxMax = -1; + size_t maxLen = 0; + for (size_t i = 0; i < Lall.size(); ++i) + { + if (Lall[i].size() > maxLen) + { + maxLen = Lall[i].size(); + idxMax = i; + } + } + + //Check for meshes without boundary + if (idxMax == -1) + { + L.clear(); + return; + } + + L.resize(Lall[idxMax].size()); + for (size_t i = 0; i < Lall[idxMax].size(); ++i) + { + L[i] = Lall[idxMax][i]; + } +} + +template +IGL_INLINE void igl::boundary_loop( + const Eigen::MatrixBase& F, + Eigen::PlainObjectBase& L) +{ + using namespace Eigen; + using namespace std; + + if(F.rows() == 0) + return; + + vector Lvec; + boundary_loop(F,Lvec); + + L.resize(Lvec.size(), 1); + for (size_t i = 0; i < Lvec.size(); ++i) + L(i) = Lvec[i]; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::boundary_loop, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::boundary_loop, int>(Eigen::MatrixBase > const&, std::vector >, std::allocator > > >&); +#endif diff --git a/vendor/libigl/include/igl/bounding_box.cpp b/vendor/libigl/include/igl/bounding_box.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4777d2511e0952fbec9dc74722e2372df4d5e169 --- /dev/null +++ b/vendor/libigl/include/igl/bounding_box.cpp @@ -0,0 +1,105 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "bounding_box.h" +#include + +template +IGL_INLINE void igl::bounding_box( + const Eigen::MatrixBase& V, + Eigen::PlainObjectBase& BV, + Eigen::PlainObjectBase& BF) +{ + return bounding_box(V,0.,BV,BF); +} + +template +IGL_INLINE void igl::bounding_box( + const Eigen::MatrixBase& V, + const typename DerivedV::Scalar pad, + Eigen::PlainObjectBase& BV, + Eigen::PlainObjectBase& BF) +{ + using namespace std; + + const int dim = V.cols(); + const auto & minV = V.colwise().minCoeff().array()-pad; + const auto & maxV = V.colwise().maxCoeff().array()+pad; + // 2^n vertices + BV.resize((1ull< combos = + [&BV,&minV,&maxV,&combos]( + const int dim, + const int i, + int * X, + const int pre_index) + { + for(X[i] = 0;X[i]<2;X[i]++) + { + int index = pre_index*2+X[i]; + if((i+1), Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::bounding_box, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::bounding_box, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::Matrix::Scalar, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::bounding_box, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::bounding_box, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::bounding_box, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/canonical_quaternions.cpp b/vendor/libigl/include/igl/canonical_quaternions.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55d68da86063f2657ec56956f62f8f348f2b991f --- /dev/null +++ b/vendor/libigl/include/igl/canonical_quaternions.cpp @@ -0,0 +1,21 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "canonical_quaternions.h" + +template <> IGL_INLINE float igl::CANONICAL_VIEW_QUAT(int i, int j) +{ + return (float)igl::CANONICAL_VIEW_QUAT_F[i][j]; +} +template <> IGL_INLINE double igl::CANONICAL_VIEW_QUAT(int i, int j) +{ + return (double)igl::CANONICAL_VIEW_QUAT_D[i][j]; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/circulation.cpp b/vendor/libigl/include/igl/circulation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b1bee7f0e5577d759f3b80ea49e2ba7a2444f1d0 --- /dev/null +++ b/vendor/libigl/include/igl/circulation.cpp @@ -0,0 +1,143 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "circulation.h" +#include "list_to_matrix.h" +#include + +IGL_INLINE std::vector igl::circulation( + const int e, + const bool ccw, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI) +{ + // prepare output + std::vector N; + N.reserve(6); + const int m = EMAP.size()/3; + assert(m*3 == EMAP.size()); + const auto & step = [&]( + const int e, + const int ff, + int & ne, + int & nf) + { + assert((EF(e,1) == ff || EF(e,0) == ff) && "e should touch ff"); + //const int fside = EF(e,1)==ff?1:0; + const int nside = EF(e,0)==ff?1:0; + const int nv = EI(e,nside); + // get next face + nf = EF(e,nside); + // get next edge + const int dir = ccw?-1:1; + ne = EMAP(nf+m*((nv+dir+3)%3)); + }; + // Always start with first face (ccw in step will be sure to turn right + // direction) + const int f0 = EF(e,0); + int fi = f0; + int ei = e; + while(true) + { + step(ei,fi,ei,fi); + N.push_back(fi); + // back to start? + if(fi == f0) + { + assert(ei == e); + break; + } + } + return N; +} + +IGL_INLINE void igl::circulation( + const int e, + const bool ccw, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI, + Eigen::VectorXi & vN) +{ + std::vector N = circulation(e,ccw,EMAP,EF,EI); + igl::list_to_matrix(N,vN); +} + +IGL_INLINE void igl::circulation( + const int e, + const bool ccw, + const Eigen::MatrixXi & F, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI, + /*std::vector & Ne,*/ + std::vector & Nv, + std::vector & Nf) +{ + // + // for e --> (bf) and ccw=true + // + // c---d + // / \ / \ + // a---b-e-f + // \ / \ / + // g---h + // + // // (might start with {bhf} depending on edge) + // Ne = […] -> [fd db dc cb ca ab ag gb gh hb hf fb] + // {upto cylic order} + // Nf = […] -> [{bfd}, {bdc}, {bca}, {bag}, {bgh}, {bhf}] + // Nv = [d c a g h f] + // + // prepare output + //Ne.clear();Ne.reserve(2*10); + Nv.clear();Nv.reserve(10); + Nf.clear();Nf.reserve(10); + const int m = EMAP.size()/3; + assert(m*3 == EMAP.size()); + const auto & step = [&]( + const int e, + const int ff, + int & ne, + //int & re, + int & rv, + int & nf) + { + assert((EF(e,1) == ff || EF(e,0) == ff) && "e should touch ff"); + //const int fside = EF(e,1)==ff?1:0; + const int nside = EF(e,0)==ff?1:0; + const int nv = EI(e,nside); + // get next face + nf = EF(e,nside); + // get next edge + const int dir = ccw?-1:1; + rv = F(nf,nv); + ne = EMAP(nf+m*((nv+dir+3)%3)); + //re = EMAP(nf+m*((nv+2*dir+3)%3)); + }; + // Always start with first face (ccw in step will be sure to turn right + // direction) + const int f0 = EF(e,0); + int fi = f0; + int ei = e; + while(true) + { + int re,rv; + step(ei,fi,ei/*,re*/,rv,fi); + Nf.push_back(fi); + //Ne.push_back(re); + //Ne.push_back(ei); + Nv.push_back(rv); + // back to start? + if(fi == f0) + { + assert(ei == e); + break; + } + } +} diff --git a/vendor/libigl/include/igl/circulation.h b/vendor/libigl/include/igl/circulation.h new file mode 100644 index 0000000000000000000000000000000000000000..ccd0eeacc5a6c86a9e79b77090b0d36313a4f5bf --- /dev/null +++ b/vendor/libigl/include/igl/circulation.h @@ -0,0 +1,65 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_CIRCULATION_H +#define IGL_CIRCULATION_H +#include "igl_inline.h" +#include +#include + +namespace igl +{ + // Return list of faces around the end point of an edge. Assumes + // data-structures are built from an edge-manifold **closed** mesh. + // + // Inputs: + // e index into E of edge to circulate + // ccw whether to _continue_ in ccw direction of edge (circulate around + // E(e,1)) + // EMAP #F*3 list of indices into E, mapping each directed edge to unique + // unique edge in E + // EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of + // F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " + // e=(j->i) + // EI #E by 2 list of edge flap corners (see above). + // Returns list of faces touched by circulation (in cyclically order). + // + // See also: edge_flaps + IGL_INLINE std::vector circulation( + const int e, + const bool ccw, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI); + // Wrapper with VectorXi output. + IGL_INLINE void circulation( + const int e, + const bool ccw, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI, + Eigen::VectorXi & vN); + // Outputs: + //// Ne 2*#Nf list of indices into E of "next" rim-spoke-rim-spoke-... + // Nv #Nv list of "next" vertex indices + // Nf #Nf list of face indices + IGL_INLINE void circulation( + const int e, + const bool ccw, + const Eigen::MatrixXi & F, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI, + /*std::vector & Ne,*/ + std::vector & Nv, + std::vector & Nf); +} + +#ifndef IGL_STATIC_LIBRARY +# include "circulation.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/collapse_edge.h b/vendor/libigl/include/igl/collapse_edge.h new file mode 100644 index 0000000000000000000000000000000000000000..bdb76c186e907c34c590756f694ed14ff351636c --- /dev/null +++ b/vendor/libigl/include/igl/collapse_edge.h @@ -0,0 +1,161 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COLLAPSE_EDGE_H +#define IGL_COLLAPSE_EDGE_H +#include "igl_inline.h" +#include "min_heap.h" +#include "decimate_callback_types.h" +#include +#include +#include +namespace igl +{ + // Assumes (V,F) is a closed manifold mesh (except for previously collapsed + // faces which should be set to: + // [IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL]. + // Collapses exactly two faces and exactly 3 edges from E (e and one side of + // each face gets collapsed to the other). This is implemented in a way that + // it can be repeatedly called until satisfaction and then the garbage in F + // can be collected by removing NULL faces. + // + // Inputs: + // e index into E of edge to try to collapse. E(e,:) = [s d] or [d s] so + // that sj) is the edge of + // F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " + // e=(j->i) + // EI #E by 2 list of edge flap corners (see above). + // e1 index into E of edge collpased on left + // e2 index into E of edge collpased on right + // f1 index into F of face collpased on left + // f2 index into F of face collpased on right + // Returns true if edge was collapsed + #define IGL_COLLAPSE_EDGE_NULL 0 + IGL_INLINE bool collapse_edge( + const int e, + const Eigen::RowVectorXd & p, + Eigen::MatrixXd & V, + Eigen::MatrixXi & F, + Eigen::MatrixXi & E, + Eigen::VectorXi & EMAP, + Eigen::MatrixXi & EF, + Eigen::MatrixXi & EI, + int & e1, + int & e2, + int & f1, + int & f2); + // Inputs: + IGL_INLINE bool collapse_edge( + const int e, + const Eigen::RowVectorXd & p, + /*const*/ std::vector & Nsv, + const std::vector & Nsf, + /*const*/ std::vector & Ndv, + const std::vector & Ndf, + Eigen::MatrixXd & V, + Eigen::MatrixXi & F, + Eigen::MatrixXi & E, + Eigen::VectorXi & EMAP, + Eigen::MatrixXi & EF, + Eigen::MatrixXi & EI, + int & e1, + int & e2, + int & f1, + int & f2); + IGL_INLINE bool collapse_edge( + const int e, + const Eigen::RowVectorXd & p, + Eigen::MatrixXd & V, + Eigen::MatrixXi & F, + Eigen::MatrixXi & E, + Eigen::VectorXi & EMAP, + Eigen::MatrixXi & EF, + Eigen::MatrixXi & EI); + // Collapse least-cost edge from a priority queue and update queue + // + // Inputs/Outputs: + // cost_and_placement function computing cost of collapsing an edge and 3d + // position where it should be placed: + // cost_and_placement(V,F,E,EMAP,EF,EI,cost,placement); + // **If the edges is collapsed** then this function will be called on all + // edges of all faces previously incident on the endpoints of the + // collapsed edge. + // Q queue containing pairs of costs and edge indices and insertion "time" + // EQ #E list of "time" of last time pushed into Q + // C #E by dim list of stored placements + IGL_INLINE bool collapse_edge( + const decimate_cost_and_placement_callback & cost_and_placement, + Eigen::MatrixXd & V, + Eigen::MatrixXi & F, + Eigen::MatrixXi & E, + Eigen::VectorXi & EMAP, + Eigen::MatrixXi & EF, + Eigen::MatrixXi & EI, + igl::min_heap< std::tuple > & Q, + Eigen::VectorXi & EQ, + Eigen::MatrixXd & C); + // Inputs: + // pre_collapse callback called with index of edge whose collapse is about + // to be attempted. This function should return whether to **proceed** + // with the collapse: returning true means "yes, try to collapse", + // returning false means "No, consider this edge 'uncollapsable', behave + // as if collapse_edge(e) returned false. + // post_collapse callback called with index of edge whose collapse was + // just attempted and a flag revealing whether this was successful. + IGL_INLINE bool collapse_edge( + const decimate_cost_and_placement_callback & cost_and_placement, + const decimate_pre_collapse_callback & pre_collapse, + const decimate_post_collapse_callback & post_collapse, + Eigen::MatrixXd & V, + Eigen::MatrixXi & F, + Eigen::MatrixXi & E, + Eigen::VectorXi & EMAP, + Eigen::MatrixXi & EF, + Eigen::MatrixXi & EI, + igl::min_heap< std::tuple > & Q, + Eigen::VectorXi & EQ, + Eigen::MatrixXd & C); + // Outputs: + // e index into E of attempted collapsed edge. Set to -1 if Q is empty or + // contains only infinite cost edges. + // e1 index into E of edge collpased on left. + // e2 index into E of edge collpased on right. + // f1 index into F of face collpased on left. + // f2 index into F of face collpased on right. + IGL_INLINE bool collapse_edge( + const decimate_cost_and_placement_callback & cost_and_placement, + const decimate_pre_collapse_callback & pre_collapse, + const decimate_post_collapse_callback & post_collapse, + Eigen::MatrixXd & V, + Eigen::MatrixXi & F, + Eigen::MatrixXi & E, + Eigen::VectorXi & EMAP, + Eigen::MatrixXi & EF, + Eigen::MatrixXi & EI, + igl::min_heap< std::tuple > & Q, + Eigen::VectorXi & EQ, + Eigen::MatrixXd & C, + int & e, + int & e1, + int & e2, + int & f1, + int & f2); +} + +#ifndef IGL_STATIC_LIBRARY +# include "collapse_edge.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/collapse_small_triangles.h b/vendor/libigl/include/igl/collapse_small_triangles.h new file mode 100644 index 0000000000000000000000000000000000000000..dacf8695349c54381488a3fccd473189cd3d296a --- /dev/null +++ b/vendor/libigl/include/igl/collapse_small_triangles.h @@ -0,0 +1,40 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COLLAPSE_SMALL_TRIANGLES_H +#define IGL_COLLAPSE_SMALL_TRIANGLES_H +#include +namespace igl +{ + // Given a triangle mesh (V,F) compute a new mesh (VV,FF) which contains the + // original faces and vertices of (V,F) except any small triangles have been + // removed via collapse. + // + // We are *not* following the rules in "Mesh Optimization" [Hoppe et al] + // Section 4.2. But for our purposes we don't care about this criteria. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // eps epsilon for smallest allowed area treated as fraction of squared bounding box + // diagonal + // Outputs: + // FF #FF by 3 list of triangle indices into V + // + // + void collapse_small_triangles( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const double eps, + Eigen::MatrixXi & FF); +} + +#ifndef IGL_STATIC_LIBRARY +# include "collapse_small_triangles.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/column_to_quats.cpp b/vendor/libigl/include/igl/column_to_quats.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f87adab06b4d26898a30f7a1106c1a0aaf8fc2ea --- /dev/null +++ b/vendor/libigl/include/igl/column_to_quats.cpp @@ -0,0 +1,27 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "column_to_quats.h" +IGL_INLINE bool igl::column_to_quats( + const Eigen::VectorXd & Q, + std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & vQ) +{ + using namespace Eigen; + if(Q.size() % 4 != 0) + { + return false; + } + const int nQ = Q.size()/4; + vQ.resize(nQ); + for(int q=0;q, Olga Diamanti +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "comb_cross_field.h" + +#include +#include +#include +#include "per_face_normals.h" +#include "is_border_vertex.h" +#include "rotation_matrix_from_directions.h" + +#include "triangle_triangle_adjacency.h" + +namespace igl { + template + class Comb + { + public: + + const Eigen::MatrixBase &V; + const Eigen::MatrixBase &F; + const Eigen::MatrixBase &PD1; + const Eigen::MatrixBase &PD2; + DerivedV N; + + private: + // internal + DerivedF TT; + DerivedF TTi; + + + private: + + + static inline double Sign(double a){return (double)((a>0)?+1:-1);} + + + private: + + // returns the 90 deg rotation of a (around n) most similar to target b + /// a and b should be in the same plane orthogonal to N + static inline Eigen::Matrix K_PI_new(const Eigen::Matrix& a, + const Eigen::Matrix& b, + const Eigen::Matrix& n) + { + Eigen::Matrix c = (a.cross(n)).normalized(); + typename DerivedV::Scalar scorea = a.dot(b); + typename DerivedV::Scalar scorec = c.dot(b); + if (fabs(scorea)>=fabs(scorec)) + return a*Sign(scorea); + else + return c*Sign(scorec); + } + + + + public: + inline Comb(const Eigen::MatrixBase &_V, + const Eigen::MatrixBase &_F, + const Eigen::MatrixBase &_PD1, + const Eigen::MatrixBase &_PD2 + ): + V(_V), + F(_F), + PD1(_PD1), + PD2(_PD2) + { + igl::per_face_normals(V,F,N); + igl::triangle_triangle_adjacency(F,TT,TTi); + } + inline void comb(Eigen::PlainObjectBase &PD1out, + Eigen::PlainObjectBase &PD2out) + { +// PD1out = PD1; +// PD2out = PD2; + PD1out.setZero(F.rows(),3);PD1out< d; + + while (!mark.all()) // Stop until all vertices are marked + { + int unmarked = 0; + while (mark(unmarked)) + unmarked++; + + d.push_back(unmarked); + mark(unmarked) = true; + + while (!d.empty()) + { + int f0 = d.at(0); + d.pop_front(); + for (int k=0; k<3; k++) + { + int f1 = TT(f0,k); + if (f1==-1) continue; + if (mark(f1)) continue; + + Eigen::Matrix dir0 = PD1out.row(f0); + Eigen::Matrix dir1 = PD1out.row(f1); + Eigen::Matrix n0 = N.row(f0); + Eigen::Matrix n1 = N.row(f1); + + + Eigen::Matrix dir0Rot = igl::rotation_matrix_from_directions(n0, n1)*dir0; + dir0Rot.normalize(); + Eigen::Matrix targD = K_PI_new(dir1,dir0Rot,n1); + + PD1out.row(f1) = targD; + PD2out.row(f1) = n1.cross(targD).normalized(); + + mark(f1) = true; + d.push_back(f1); + + } + } + } + + // everything should be marked + for (int i=0; i +IGL_INLINE void igl::comb_cross_field(const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &PD1, + const Eigen::MatrixBase &PD2, + Eigen::PlainObjectBase &PD1out, + Eigen::PlainObjectBase &PD2out) +{ + igl::Comb cmb(V, F, PD1, PD2); + cmb.comb(PD1out, PD2out); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::comb_cross_field, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::comb_cross_field, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/comb_frame_field.cpp b/vendor/libigl/include/igl/comb_frame_field.cpp new file mode 100644 index 0000000000000000000000000000000000000000..85672c303470dec917d7973d4fd579f4932cae4a --- /dev/null +++ b/vendor/libigl/include/igl/comb_frame_field.cpp @@ -0,0 +1,78 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo , Olga Diamanti +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifdef WIN32 + #define _USE_MATH_DEFINES +#endif +#include + +#include "comb_frame_field.h" +#include "local_basis.h" +#include "PI.h" + +template +IGL_INLINE void igl::comb_frame_field(const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &PD1, + const Eigen::MatrixBase &PD2, + const Eigen::MatrixBase &BIS1_combed, + const Eigen::MatrixBase &BIS2_combed, + Eigen::PlainObjectBase &PD1_combed, + Eigen::PlainObjectBase &PD2_combed) +{ + DerivedV B1, B2, B3; + igl::local_basis(V,F,B1,B2,B3); + + PD1_combed.resize(BIS1_combed.rows(),3); + PD2_combed.resize(BIS2_combed.rows(),3); + + for (unsigned i=0; i DIRs; + DIRs << + PD1.row(i), + -PD1.row(i), + PD2.row(i), + -PD2.row(i); + + std::vector a(4); + + + double a_combed = atan2(B2.row(i).dot(BIS1_combed.row(i)),B1.row(i).dot(BIS1_combed.row(i))); + + // center on the combed sector center + for (unsigned j=0;j<4;++j) + { + a[j] = atan2(B2.row(i).dot(DIRs.row(j)),B1.row(i).dot(DIRs.row(j))) - a_combed; + //make it positive by adding some multiple of 2pi + a[j] += std::ceil (std::max(0., -a[j]) / (igl::PI*2.)) * (igl::PI*2.); + //take modulo 2pi + a[j] = fmod(a[j], (igl::PI*2.)); + } + // now the max is u and the min is v + + int m = std::min_element(a.begin(),a.end())-a.begin(); + int M = std::max_element(a.begin(),a.end())-a.begin(); + + assert( + ((m>=0 && m<=1) && (M>=2 && M<=3)) + || + ((m>=2 && m<=3) && (M>=0 && M<=1)) + ); + + PD1_combed.row(i) = DIRs.row(m); + PD2_combed.row(i) = DIRs.row(M); + + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::comb_frame_field, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::comb_frame_field, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/README.md b/vendor/libigl/include/igl/copyleft/README.md new file mode 100644 index 0000000000000000000000000000000000000000..78454affc613841801066b875136c6ea15fbea22 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/README.md @@ -0,0 +1,14 @@ +## IGL copyleft subdirectory + +Functions in the `include/igl/copyleft/` subdirectory are in the +`igl::copyleft::` namespace to indicate that they are under a more aggressive +[copyleft](https://en.wikipedia.org/wiki/Copyleft) than +[MPL2](https://en.wikipedia.org/wiki/Mozilla_Public_License) used for the main +`include/igl` directory and `igl::` namespace. Most notably, this subdirectory +includes code that is under +[GPL](https://en.wikipedia.org/wiki/GNU_General_Public_License). + +Typically a company planning on developing software without releasing its +source code will avoid or purchase licenses for such dependencies. If you do +obtain such a license for the dependencies employed here, you are free to use +the libigl functions here as per their MPL2 license. diff --git a/vendor/libigl/include/igl/copyleft/cgal/BinaryWindingNumberOperations.h b/vendor/libigl/include/igl/copyleft/cgal/BinaryWindingNumberOperations.h new file mode 100644 index 0000000000000000000000000000000000000000..9bae0b7bb9d35567a1d49be56d86288285b4ea30 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/BinaryWindingNumberOperations.h @@ -0,0 +1,167 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLEFT_CGAL_BINARY_WINDING_NUMBER_OPERATIONS_H +#define IGL_COPYLEFT_CGAL_BINARY_WINDING_NUMBER_OPERATIONS_H + +#include +#include "../../igl_inline.h" +#include "../../MeshBooleanType.h" +#include + +// TODO: This is not written according to libigl style. These should be +// function handles. +// +// Why is this templated on DerivedW +// +// These are all generalized to n-ary operations +namespace igl +{ + namespace copyleft + { + namespace cgal + { + template + class BinaryWindingNumberOperations { + public: + template + typename DerivedW::Scalar operator()( + const Eigen::PlainObjectBase& /*win_nums*/) const { + throw (std::runtime_error("not implemented!")); + } + }; + + // A ∪ B ∪ ... ∪ Z + template <> + class BinaryWindingNumberOperations { + public: + template + typename DerivedW::Scalar operator()( + const Eigen::PlainObjectBase& win_nums) const + { + for(int i = 0;i 0) return true; + } + return false; + } + }; + + // A ∩ B ∩ ... ∩ Z + template <> + class BinaryWindingNumberOperations { + public: + template + typename DerivedW::Scalar operator()( + const Eigen::PlainObjectBase& win_nums) const + { + for(int i = 0;i + class BinaryWindingNumberOperations { + public: + template + typename DerivedW::Scalar operator()( + const Eigen::PlainObjectBase& win_nums) const + { + assert(win_nums.size()>1); + // Union of objects 1 through n-1 + bool union_rest = false; + for(int i = 1;i 0; + if(union_rest) break; + } + // Must be in object 0 and not in union of objects 1 through n-1 + return win_nums(0) > 0 && !union_rest; + } + }; + + // A ∆ B ∆ ... ∆ Z (equivalent to set inside odd number of objects) + template <> + class BinaryWindingNumberOperations { + public: + template + typename DerivedW::Scalar operator()( + const Eigen::PlainObjectBase& win_nums) const + { + // If inside an odd number of objects + int count = 0; + for(int i = 0;i 0) count++; + } + return count % 2 == 1; + } + }; + + template <> + class BinaryWindingNumberOperations { + public: + template + typename DerivedW::Scalar operator()( + const Eigen::PlainObjectBase& /*win_nums*/) const { + return true; + } + }; + + typedef BinaryWindingNumberOperations BinaryUnion; + typedef BinaryWindingNumberOperations BinaryIntersect; + typedef BinaryWindingNumberOperations BinaryMinus; + typedef BinaryWindingNumberOperations BinaryXor; + typedef BinaryWindingNumberOperations BinaryResolve; + + enum KeeperType { + KEEP_INSIDE, + KEEP_ALL + }; + + template + class WindingNumberFilter { + public: + template + short operator()( + const Eigen::PlainObjectBase& /*win_nums*/) const { + throw std::runtime_error("Not implemented"); + } + }; + + template<> + class WindingNumberFilter { + public: + template + short operator()(T out_w, T in_w) const { + if (in_w > 0 && out_w <= 0) return 1; + else if (in_w <= 0 && out_w > 0) return -1; + else return 0; + } + }; + + template<> + class WindingNumberFilter { + public: + template + short operator()(T /*out_w*/, T /*in_w*/) const { + return 1; + } + }; + + typedef WindingNumberFilter KeepInside; + typedef WindingNumberFilter KeepAll; + } + } +} + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/CGAL_includes.hpp b/vendor/libigl/include/igl/copyleft/cgal/CGAL_includes.hpp new file mode 100644 index 0000000000000000000000000000000000000000..38d2fc7497c87872c687ef8084801e076d24a7c4 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/CGAL_includes.hpp @@ -0,0 +1,50 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_CGAL_INCLUDES_H +#define IGL_CGAL_INCLUDES_H + +// This causes unknown bugs during intersection meshing: +//// http://www.alecjacobson.com/weblog/?p=4291 +//#define CGAL_INTERSECTION_VERSION 1 +// Use this instead to mute errors resulting from bad CGAL assertions +#define CGAL_KERNEL_NO_ASSERTIONS +// Triangle triangle intersection +#include +// THIS CANNOT BE INCLUDED IN THE SAME FILE AS +// #include + +// Constrained Delaunay Triangulation types +#include +#include + +// Axis-align boxes for all-pairs self-intersection detection +#include +#include +#include +#include +#include +#include +#include + +// Axis-aligned bounding box tree for tet tri intersection +#include +#include +#include + +// Boolean operations +#include +// Is this actually used? +//#include + +// Delaunay Triangulation in 3D +#include + +#include +#include + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/CSGTree.h b/vendor/libigl/include/igl/copyleft/cgal/CSGTree.h new file mode 100644 index 0000000000000000000000000000000000000000..599572d3f685956cdcfd361dc3cf385a04b47cba --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/CSGTree.h @@ -0,0 +1,189 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_CSG_TREE_H +#define IGL_COPYLEFT_CGAL_CSG_TREE_H + +#include "../../MeshBooleanType.h" +#include "string_to_mesh_boolean_type.h" +#include "mesh_boolean.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Class for defining and computing a constructive solid geometry result + // out of a tree of boolean operations on "solid" triangle meshes. + // + //template + class CSGTree + { + public: + typedef CGAL::Epeck::FT ExactScalar; + //typedef Eigen::PlainObjectBase POBF; + typedef Eigen::MatrixXi POBF; + typedef POBF::Index FIndex; + typedef Eigen::Matrix MatrixX3E; + typedef Eigen::Matrix VectorJ; + private: + // Resulting mesh + MatrixX3E m_V; + POBF m_F; + VectorJ m_J; + // Number of birth faces in A + those in B. I.e. sum of original "leaf" + // faces involved in result. + size_t m_number_of_birth_faces; + public: + CSGTree() + { + } + //typedef Eigen::MatrixXd MatrixX3E; + //typedef Eigen::MatrixXi POBF; + // http://stackoverflow.com/a/3279550/148668 + CSGTree(const CSGTree & other) + : + // copy things + m_V(other.m_V), + // This is an issue if m_F is templated + // https://forum.kde.org/viewtopic.php?f=74&t=128414 + m_F(other.m_F), + m_J(other.m_J), + m_number_of_birth_faces(other.m_number_of_birth_faces) + { + } + // copy-swap idiom + friend void swap(CSGTree& first, CSGTree& second) + { + using std::swap; + // swap things + swap(first.m_V,second.m_V); + // This is an issue if m_F is templated, similar to + // https://forum.kde.org/viewtopic.php?f=74&t=128414 + swap(first.m_F,second.m_F); + swap(first.m_J,second.m_J); + swap(first.m_number_of_birth_faces,second.m_number_of_birth_faces); + } + // Pass-by-value (aka copy) + CSGTree& operator=(CSGTree other) + { + swap(*this,other); + return *this; + } + CSGTree(CSGTree&& other): + // initialize via default constructor + CSGTree() + { + swap(*this,other); + } + // Construct and compute a boolean operation on existing CSGTree nodes. + // + // Inputs: + // A Solid result of previous CSG operation (or identity, see below) + // B Solid result of previous CSG operation (or identity, see below) + // type type of mesh boolean to compute + CSGTree( + const CSGTree & A, + const CSGTree & B, + const MeshBooleanType & type) + { + // conduct boolean operation + mesh_boolean(A.V(),A.F(),B.V(),B.F(),type,m_V,m_F,m_J); + // reindex m_J + std::for_each(m_J.data(),m_J.data()+m_J.size(), + [&](typename VectorJ::Scalar & j) -> void + { + if(j < A.F().rows()) + { + j = A.J()(j); + }else + { + assert(j<(A.F().rows()+B.F().rows())); + j = A.number_of_birth_faces()+(B.J()(j-A.F().rows())); + } + }); + m_number_of_birth_faces = + A.number_of_birth_faces() + B.number_of_birth_faces(); + } + // Overload using string for type + CSGTree( + const CSGTree & A, + const CSGTree & B, + const std::string & s): + CSGTree(A,B,string_to_mesh_boolean_type(s)) + { + // do nothing (all done in constructor). + } + // "Leaf" node with identity operation on assumed "solid" mesh (V,F) + // + // Inputs: + // V #V by 3 list of mesh vertices (in any precision, will be + // converted to exact) + // F #F by 3 list of mesh face indices into V + template + CSGTree(const Eigen::PlainObjectBase & V, const POBF & F)//: + // Possible Eigen bug: + // https://forum.kde.org/viewtopic.php?f=74&t=128414 + //m_V(V.template cast()),m_F(F) + { + m_V = V.template cast(); + m_F = F; + // number of faces + m_number_of_birth_faces = m_F.rows(); + // identity birth index + m_J = VectorJ::LinSpaced( + m_number_of_birth_faces,0,m_number_of_birth_faces-1); + } + // Returns reference to resulting mesh vertices m_V in exact scalar + // representation + const MatrixX3E & V() const + { + return m_V; + } + // Returns mesh vertices in the desired output type, casting when + // appropriate to floating precision. + template + DerivedV cast_V() const + { + DerivedV dV; + dV.resize(m_V.rows(),m_V.cols()); + for(int i = 0;i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_REMESH_SELF_INTERSECTIONS_PARAM_H +#define IGL_COPYLEFT_CGAL_REMESH_SELF_INTERSECTIONS_PARAM_H + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Optional Parameters + // DetectOnly Only compute IF, leave VV and FF alone + struct RemeshSelfIntersectionsParam + { + bool detect_only; + bool first_only; + bool stitch_all; + inline RemeshSelfIntersectionsParam( + bool _detect_only=false, + bool _first_only=false, + bool _stitch_all=false): + detect_only(_detect_only), + first_only(_first_only), + stitch_all(_stitch_all){}; + }; + } + } +} + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/SelfIntersectMesh.h b/vendor/libigl/include/igl/copyleft/cgal/SelfIntersectMesh.h new file mode 100644 index 0000000000000000000000000000000000000000..f46df028afe897eaebbd0a8bf15c9db018bae6d4 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/SelfIntersectMesh.h @@ -0,0 +1,933 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_SELFINTERSECTMESH_H +#define IGL_COPYLEFT_CGAL_SELFINTERSECTMESH_H + +#include "CGAL_includes.hpp" +#include "RemeshSelfIntersectionsParam.h" +#include "../../unique.h" +#include "../../default_num_threads.h" + +#include +#include +#include +#include +#include +#include + +//#define IGL_SELFINTERSECTMESH_DEBUG +#ifndef IGL_FIRST_HIT_EXCEPTION +#define IGL_FIRST_HIT_EXCEPTION 10 +#endif + +// The easiest way to keep track of everything is to use a class + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Kernel is a CGAL kernel like: + // CGAL::Exact_predicates_inexact_constructions_kernel + // or + // CGAL::Exact_predicates_exact_constructions_kernel + + template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> + class SelfIntersectMesh + { + typedef + SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM> Self; + public: + // 3D Primitives + typedef CGAL::Point_3 Point_3; + typedef CGAL::Segment_3 Segment_3; + typedef CGAL::Triangle_3 Triangle_3; + typedef CGAL::Plane_3 Plane_3; + typedef CGAL::Tetrahedron_3 Tetrahedron_3; + // 2D Primitives + typedef CGAL::Point_2 Point_2; + typedef CGAL::Segment_2 Segment_2; + typedef CGAL::Triangle_2 Triangle_2; + // 2D Constrained Delaunay Triangulation types + typedef CGAL::Exact_intersections_tag Itag; + // Axis-align boxes for all-pairs self-intersection detection + typedef std::vector Triangles; + typedef typename Triangles::iterator TrianglesIterator; + typedef typename Triangles::const_iterator TrianglesConstIterator; + typedef + CGAL::Box_intersection_d::Box_with_handle_d + Box; + + // Input mesh + const Eigen::MatrixBase & V; + const Eigen::MatrixBase & F; + // Number of self-intersecting triangle pairs + typedef typename DerivedF::Index Index; + Index count; + typedef std::vector> ObjectList; + // Using a vector here makes this **not** output sensitive + Triangles T; + typedef std::vector IndexList; + IndexList lIF; + // #F-long list of faces with intersections mapping to the order in + // which they were first found + std::map offending; + // Make a short name for the edge map's key + typedef std::pair EMK; + // Make a short name for the type stored at each edge, the edge map's + // value + typedef std::vector EMV; + // Make a short name for the edge map + typedef std::map EdgeMap; + // Maps edges of offending faces to all incident offending faces + std::vector > + candidate_triangle_pairs; + + public: + RemeshSelfIntersectionsParam params; + public: + // Constructs (VV,FF) a new mesh with self-intersections of (V,F) + // subdivided + // + // See also: remesh_self_intersections.h + inline SelfIntersectMesh( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const RemeshSelfIntersectionsParam & params, + Eigen::PlainObjectBase & VV, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & IF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM); + private: + // Helper function to mark a face as offensive + // + // Inputs: + // f index of face in F + inline void mark_offensive(const Index f); + // Helper function to count intersections between faces + // + // Input: + // fa index of face A in F + // fb index of face B in F + inline void count_intersection( const Index fa, const Index fb); + // Helper function for box_intersect. Intersect two triangles A and B, + // append the intersection object (point,segment,triangle) to a running + // list for A and B + // + // Inputs: + // A triangle in 3D + // B triangle in 3D + // fa index of A in F (and key into offending) + // fb index of B in F (and key into offending) + // Returns true only if A intersects B + // + inline bool intersect( + const Triangle_3 & A, + const Triangle_3 & B, + const Index fa, + const Index fb); + // Helper function for box_intersect. In the case where A and B have + // already been identified to share a vertex, then we only want to + // add possible segment intersections. Assumes truly duplicate + // triangles are not given as input + // + // Inputs: + // A triangle in 3D + // B triangle in 3D + // fa index of A in F (and key into offending) + // fb index of B in F (and key into offending) + // va index of shared vertex in A (and key into offending) + // vb index of shared vertex in B (and key into offending) + // Returns true if intersection (besides shared point) + // + inline bool single_shared_vertex( + const Triangle_3 & A, + const Triangle_3 & B, + const Index fa, + const Index fb, + const Index va, + const Index vb); + // Helper handling one direction + inline bool single_shared_vertex( + const Triangle_3 & A, + const Triangle_3 & B, + const Index fa, + const Index fb, + const Index va); + // Helper function for box_intersect. In the case where A and B have + // already been identified to share two vertices, then we only want + // to add a possible coplanar (Triangle) intersection. Assumes truly + // degenerate facets are not givin as input. + inline bool double_shared_vertex( + const Triangle_3 & A, + const Triangle_3 & B, + const Index fa, + const Index fb, + const std::vector > shared); + + public: + // Callback function called during box self intersections test. Means + // boxes a and b intersect. This method then checks if the triangles + // in each box intersect and if so, then processes the intersections + // + // Inputs: + // a box containing a triangle + // b box containing a triangle + inline void box_intersect(const Box& a, const Box& b); + inline void process_intersecting_boxes(); + public: + // Getters: + //const IndexList& get_lIF() const{ return lIF;} + static inline void box_intersect_static( + SelfIntersectMesh * SIM, + const Box &a, + const Box &b); + private: + std::mutex m_offending_lock; + }; + } + } +} + +// Implementation + +#include "mesh_to_cgal_triangle_list.h" +#include "remesh_intersections.h" + +#include "../../REDRUM.h" +#include "../../get_seconds.h" +#include "../../C_STR.h" + + +#include +#include +#include +#include +#include + +// References: +// http://minregret.googlecode.com/svn/trunk/skyline/src/extern/CGAL-3.3.1/examples/Polyhedron/polyhedron_self_intersection.cpp +// http://www.cgal.org/Manual/3.9/examples/Boolean_set_operations_2/do_intersect.cpp + +// Q: Should we be using CGAL::Polyhedron_3? +// A: No! Input is just a list of unoriented triangles. Polyhedron_3 requires +// a 2-manifold. +// A: But! It seems we could use CGAL::Triangulation_3. Though it won't be easy +// to take advantage of functions like insert_in_facet because we want to +// constrain segments. Hmmm. Actually Triangulation_3 doesn't look right... + +// CGAL's box_self_intersection_d uses C-style function callbacks without +// userdata. This is a leapfrog method for calling a member function. It should +// be bound as if the prototype was: +// static void box_intersect(const Box &a, const Box &b) +// using boost: +// boost::function cb +// = boost::bind(&::box_intersect, this, _1,_2); +// +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline void igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::box_intersect_static( + Self * SIM, + const typename Self::Box &a, + const typename Self::Box &b) +{ + SIM->box_intersect(a,b); +} + +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::SelfIntersectMesh( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const RemeshSelfIntersectionsParam & params, + Eigen::PlainObjectBase & VV, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & IF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM): + V(V), + F(F), + count(0), + T(), + lIF(), + offending(), + params(params) +{ + using namespace std; + using namespace Eigen; + +#ifdef IGL_SELFINTERSECTMESH_DEBUG + const auto & tictoc = []() -> double + { + static double t_start = igl::get_seconds(); + double diff = igl::get_seconds()-t_start; + t_start += diff; + return diff; + }; + const auto log_time = [&](const std::string& label) -> void{ + std::cout << "SelfIntersectMesh." << label << ": " + << tictoc() << std::endl; + }; + tictoc(); +#endif + + // Compute and process self intersections + mesh_to_cgal_triangle_list(V,F,T); +#ifdef IGL_SELFINTERSECTMESH_DEBUG + log_time("convert_to_triangle_list"); +#endif + // http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Box_intersection_d/Chapter_main.html#Section_63.5 + // Create the corresponding vector of bounding boxes + std::vector boxes; + boxes.reserve(T.size()); + for ( + TrianglesIterator tit = T.begin(); + tit != T.end(); + ++tit) + { + if (!tit->is_degenerate()) + { + boxes.push_back(Box(tit->bbox(), tit)); + } + } + // Leapfrog callback + std::function cb = + std::bind(&box_intersect_static, this, + // Explicitly use std namespace to avoid confusion with boost (who puts + // _1 etc. in global namespace) + std::placeholders::_1, + std::placeholders::_2); +#ifdef IGL_SELFINTERSECTMESH_DEBUG + log_time("box_and_bind"); +#endif + // Run the self intersection algorithm with all defaults + CGAL::box_self_intersection_d(boxes.begin(), boxes.end(),cb); +#ifdef IGL_SELFINTERSECTMESH_DEBUG + log_time("box_intersection_d"); +#endif + try{ + process_intersecting_boxes(); + }catch(int e) + { + // Rethrow if not IGL_FIRST_HIT_EXCEPTION + if(e != IGL_FIRST_HIT_EXCEPTION) + { + throw e; + } + // Otherwise just fall through + } +#ifdef IGL_SELFINTERSECTMESH_DEBUG + log_time("resolve_intersection"); +#endif + + // Convert lIF to Eigen matrix + assert(lIF.size()%2 == 0); + IF.resize(lIF.size()/2,2); + { + Index i=0; + for( + typename IndexList::const_iterator ifit = lIF.begin(); + ifit!=lIF.end(); + ) + { + IF(i,0) = (*ifit); + ifit++; + IF(i,1) = (*ifit); + ifit++; + i++; + } + } +#ifdef IGL_SELFINTERSECTMESH_DEBUG + log_time("store_intersecting_face_pairs"); +#endif + + if(params.detect_only) + { + return; + } + + remesh_intersections( + V,F,T,offending,params.stitch_all,VV,FF,J,IM); + +#ifdef IGL_SELFINTERSECTMESH_DEBUG + log_time("remesh_intersection"); +#endif +} + + +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline void igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::mark_offensive(const Index f) +{ + using namespace std; + lIF.push_back(f); + if(offending.count(f) == 0) + { + // first time marking, initialize with new id and empty list + offending[f] = {}; + } +} + +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline void igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::count_intersection( + const Index fa, + const Index fb) +{ + std::lock_guard guard(m_offending_lock); + mark_offensive(fa); + mark_offensive(fb); + this->count++; + // We found the first intersection + if(params.first_only && this->count >= 1) + { + throw IGL_FIRST_HIT_EXCEPTION; + } + +} + +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline bool igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::intersect( + const Triangle_3 & A, + const Triangle_3 & B, + const Index fa, + const Index fb) +{ + // Determine whether there is an intersection + if(!CGAL::do_intersect(A,B)) + { + return false; + } + count_intersection(fa,fb); + if(!params.detect_only) + { + // Construct intersection + CGAL::Object result = CGAL::intersection(A,B); + std::lock_guard guard(m_offending_lock); + offending[fa].push_back({fb, result}); + offending[fb].push_back({fa, result}); + } + return true; +} + +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline bool igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::single_shared_vertex( + const Triangle_3 & A, + const Triangle_3 & B, + const Index fa, + const Index fb, + const Index va, + const Index vb) +{ + if(single_shared_vertex(A,B,fa,fb,va)) + { + return true; + } + return single_shared_vertex(B,A,fb,fa,vb); +} + +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline bool igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::single_shared_vertex( + const Triangle_3 & A, + const Triangle_3 & B, + const Index fa, + const Index fb, + const Index va) +{ + // This was not a good idea. It will not handle coplanar triangles well. + using namespace std; + Segment_3 sa( + A.vertex((va+1)%3), + A.vertex((va+2)%3)); + + if(CGAL::do_intersect(sa,B)) + { + // can't put count_intersection(fa,fb) here since we use intersect below + // and then it will be counted twice. + if(params.detect_only) + { + count_intersection(fa,fb); + return true; + } + CGAL::Object result = CGAL::intersection(sa,B); + if(const Point_3 * p = CGAL::object_cast(&result)) + { + // Single intersection --> segment from shared point to intersection + CGAL::Object seg = CGAL::make_object(Segment_3( + A.vertex(va), + *p)); + count_intersection(fa,fb); + std::lock_guard guard(m_offending_lock); + offending[fa].push_back({fb, seg}); + offending[fb].push_back({fa, seg}); + return true; + }else if(CGAL::object_cast(&result)) + { + // Need to do full test. Intersection could be a general poly. + bool test = intersect(A,B,fa,fb); + ((void)test); + assert(test && "intersect should agree with do_intersect"); + return true; + }else + { + cerr< +inline bool igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::double_shared_vertex( + const Triangle_3 & A, + const Triangle_3 & B, + const Index fa, + const Index fb, + const std::vector > shared) +{ + using namespace std; + + // must be co-planar + if( + A.supporting_plane() != B.supporting_plane() && + A.supporting_plane() != B.supporting_plane().opposite()) + { + return false; + } + // Since A and B are non-degenerate the intersection must be a polygon + // (triangle). Either + // - the vertex of A (B) opposite the shared edge of lies on B (A), or + // - an edge of A intersects and edge of B without sharing a vertex + // + // Determine if the vertex opposite edge (a0,a1) in triangle A lies in + // (intersects) triangle B + const auto & opposite_point_inside = []( + const Triangle_3 & A, const Index a0, const Index a1, const Triangle_3 & B) + -> bool + { + // get opposite index + Index a2 = -1; + for(int c = 0;c<3;c++) + { + if(c != a0 && c != a1) + { + a2 = c; + break; + } + } + assert(a2 != -1); + bool ret = CGAL::do_intersect(A.vertex(a2),B); + return ret; + }; + + // Determine if edge opposite vertex va in triangle A intersects edge + // opposite vertex vb in triangle B. + const auto & opposite_edges_intersect = []( + const Triangle_3 & A, const Index va, + const Triangle_3 & B, const Index vb) -> bool + { + Segment_3 sa( A.vertex((va+1)%3), A.vertex((va+2)%3)); + Segment_3 sb( B.vertex((vb+1)%3), B.vertex((vb+2)%3)); + bool ret = CGAL::do_intersect(sa,sb); + return ret; + }; + + if( + !opposite_point_inside(A,shared[0].first,shared[1].first,B) && + !opposite_point_inside(B,shared[0].second,shared[1].second,A) && + !opposite_edges_intersect(A,shared[0].first,B,shared[1].second) && + !opposite_edges_intersect(A,shared[1].first,B,shared[0].second)) + { + return false; + } + + // there is an intersection indeed + count_intersection(fa,fb); + if(params.detect_only) + { + return true; + } + // Construct intersection + try + { + // This can fail for Epick but not Epeck + CGAL::Object result = CGAL::intersection(A,B); + if(!result.empty()) + { + if(CGAL::object_cast(&result)) + { + // not coplanar + assert(false && + "Co-planar non-degenerate triangles should intersect over triangle"); + return false; + } else if(CGAL::object_cast(&result)) + { + // this "shouldn't" happen but does for inexact + assert(false && + "Co-planar non-degenerate triangles should intersect over triangle"); + return false; + } else + { + // Triangle object + std::lock_guard guard(m_offending_lock); + offending[fa].push_back({fb, result}); + offending[fb].push_back({fa, result}); + return true; + } + }else + { + // CGAL::intersection is disagreeing with do_intersect + assert(false && "CGAL::intersection should agree with predicate tests"); + return false; + } + }catch(...) + { + // This catches some cgal assertion: + // CGAL error: assertion violation! + // Expression : is_finite(d) + // File : /opt/local/include/CGAL/GMP/Gmpq_type.h + // Line : 132 + // Explanation: + // But only if NDEBUG is not defined, otherwise there's an uncaught + // "Floating point exception: 8" SIGFPE + return false; + } + // No intersection. + return false; +} + +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline void igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::box_intersect( + const Box& a, + const Box& b) +{ + candidate_triangle_pairs.push_back({a.handle(), b.handle()}); +} + +template < + typename Kernel, + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +inline void igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM>::process_intersecting_boxes() +{ + std::vector triangle_locks(T.size()); + std::vector vertex_locks(V.rows()); + std::mutex index_lock; + std::mutex exception_mutex; + bool exception_fired = false; + int exception = -1; + auto process_chunk = + [&]( + const size_t first, + const size_t last) -> void + { + try + { + assert(last >= first); + + for (size_t i=first; i guard(index_lock); + const auto& tri_pair = candidate_triangle_pairs[i]; + fa = tri_pair.first - T.begin(); + fb = tri_pair.second - T.begin(); + } + assert(fa < T.size()); + assert(fb < T.size()); + + // Lock triangles + std::lock_guard guard_A(triangle_locks[fa]); + std::lock_guard guard_B(triangle_locks[fb]); + + // Lock vertices + std::list > guard_vertices; + { + std::vector unique_vertices; + std::vector tmp1, tmp2; + igl::unique({F(fa,0), F(fa,1), F(fa,2), F(fb,0), F(fb,1), F(fb,2)}, + unique_vertices, tmp1, tmp2); + std::for_each(unique_vertices.begin(), unique_vertices.end(), + [&](const typename DerivedF::Scalar& vi) { + guard_vertices.emplace_back(vertex_locks[vi]); + }); + } + if(exception_fired) return; + + const Triangle_3& A = T[fa]; + const Triangle_3& B = T[fb]; + + // Number of combinatorially shared vertices + Index comb_shared_vertices = 0; + // Number of geometrically shared vertices (*not* including + // combinatorially shared) + Index geo_shared_vertices = 0; + // Keep track of shared vertex indices + std::vector > shared; + Index ea,eb; + for(ea=0;ea<3;ea++) + { + for(eb=0;eb<3;eb++) + { + if(F(fa,ea) == F(fb,eb)) + { + comb_shared_vertices++; + shared.emplace_back(ea,eb); + }else if(A.vertex(ea) == B.vertex(eb)) + { + geo_shared_vertices++; + shared.emplace_back(ea,eb); + } + } + } + const Index total_shared_vertices = + comb_shared_vertices + geo_shared_vertices; + if(exception_fired) return; + + if(comb_shared_vertices== 3) + { + assert(shared.size() == 3); + // Combinatorially duplicate face, these should be removed by + // preprocessing + continue; + } + if(total_shared_vertices== 3) + { + assert(shared.size() == 3); + // Geometrically duplicate face, these should be removed by + // preprocessing + continue; + } + if(total_shared_vertices == 2) + { + assert(shared.size() == 2); + // Q: What about coplanar? + // + // o o + // |\ /| + // | \/ | + // | /\ | + // |/ \| + // o----o + double_shared_vertex(A,B,fa,fb,shared); + continue; + } + assert(total_shared_vertices<=1); + if(total_shared_vertices==1) + { + single_shared_vertex(A,B,fa,fb,shared[0].first,shared[0].second); + }else + { + intersect(A,B,fa,fb); + } + } + }catch(int e) + { + std::lock_guard exception_lock(exception_mutex); + exception_fired = true; + exception = e; + } + }; + const size_t num_threads = default_num_threads(); + assert(num_threads > 0); + const size_t num_pairs = candidate_triangle_pairs.size(); + const size_t chunk_size = num_pairs / num_threads; + std::vector threads; + for (size_t i=0; i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "assign.h" +#include "assign_scalar.h" + +template +IGL_INLINE void igl::copyleft::cgal::assign( + const Eigen::MatrixBase & C, + Eigen::PlainObjectBase & D) +{ + D.resizeLike(C); + for(int i = 0;i +IGL_INLINE +Eigen::Matrix< + ReturnScalar, + DerivedC::RowsAtCompileTime, + DerivedC::ColsAtCompileTime, + 1, + DerivedC::MaxRowsAtCompileTime, + DerivedC::MaxColsAtCompileTime> +igl::copyleft::cgal::assign( + const Eigen::MatrixBase & C) +{ + Eigen::Matrix< + ReturnScalar, + DerivedC::RowsAtCompileTime, + DerivedC::ColsAtCompileTime, + 1, + DerivedC::MaxRowsAtCompileTime, + DerivedC::MaxColsAtCompileTime> D; + assign(C,D); + return D; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, Eigen::Matrix, 1, 3, 1, 1, 3> >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase, 1, 3, 1, 1, 3> >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, -1, -1, 0, -1, -1>, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, -1, -1, 1, -1, -1>, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, Eigen::Matrix, -1, -1, 1, -1, -1> >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, Eigen::Matrix, -1, -1, 1, -1, -1> >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, -1, 3, 0, -1, 3>, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, -1, -1, 1, -1, -1>, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, -1, -1, 1, -1, -1>, Eigen::Matrix, -1, -1, 0, -1, -1> >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, -1, -1, 1, -1, -1>, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::assign, -1, -1, 1, -1, -1>, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::assign, -1, -1, 0, -1, -1>, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::assign, -1, -1, 0, -1, -1>, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); +template void igl::copyleft::cgal::assign, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::assign, Eigen::Matrix, -1, -1, 0, -1, -1> >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&); +template void igl::copyleft::cgal::assign, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::assign, Eigen::Matrix, -1, -1, 0, -1, -1> >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&); +template void igl::copyleft::cgal::assign, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::assign, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); +template void igl::copyleft::cgal::assign, -1, -1, 0, -1, -1>, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::assign, -1, 3, 0, -1, 3>, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); +template void igl::copyleft::cgal::assign, -1, 3, 0, -1, 3>, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::assign, 8, 3, 0, 8, 3>, Eigen::Matrix, 8, 3, 0, 8, 3> >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::PlainObjectBase, 8, 3, 0, 8, 3> >&); +template void igl::copyleft::cgal::assign, 8, 3, 0, 8, 3>, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/assign.h b/vendor/libigl/include/igl/copyleft/cgal/assign.h new file mode 100644 index 0000000000000000000000000000000000000000..db9081f236549aed8f08ecb97f37292d6e731ceb --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/assign.h @@ -0,0 +1,42 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_ASSIGN_H +#define IGL_COPYLEFT_CGAL_ASSIGN_H +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + template + IGL_INLINE void assign( + const Eigen::MatrixBase & C, + Eigen::PlainObjectBase & D); + template + IGL_INLINE + Eigen::Matrix< + ReturnScalar, + DerivedC::RowsAtCompileTime, + DerivedC::ColsAtCompileTime, + 1, + DerivedC::MaxRowsAtCompileTime, + DerivedC::MaxColsAtCompileTime> + assign( + const Eigen::MatrixBase & C); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "assign.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/assign_scalar.cpp b/vendor/libigl/include/igl/copyleft/cgal/assign_scalar.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c38ee03a15aeea132f8432a2a2869df9a34dfbb0 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/assign_scalar.cpp @@ -0,0 +1,136 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "assign_scalar.h" + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Epeck::FT & cgal, + CGAL::Epeck::FT & d) +{ + d = cgal; +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Epeck::FT & _cgal, + double & d) +{ + // FORCE evaluation of the exact type otherwise interval might be huge. + const CGAL::Epeck::FT cgal = _cgal.exact(); + const auto interval = CGAL::to_interval(cgal); + d = interval.first; + do { + const double next = nextafter(d, interval.second); + if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break; + d = next; + } while (d < interval.second); +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Epeck::FT & _cgal, + float& d) +{ + // FORCE evaluation of the exact type otherwise interval might be huge. + const CGAL::Epeck::FT cgal = _cgal.exact(); + const auto interval = CGAL::to_interval(cgal); + d = interval.first; + do { + const float next = nextafter(d, float(interval.second)); + if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break; + d = next; + } while (d < float(interval.second)); +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const double & c, + double & d) +{ + d = c; +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const float& c, + float& d) +{ + d = c; +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const float& c, + double& d) +{ + d = c; +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal, + CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & d) +{ + d = cgal; +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal, + double & d) +{ + const auto interval = CGAL::to_interval(cgal); + d = interval.first; + do { + const double next = nextafter(d, interval.second); + if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break; + d = next; + } while (d < interval.second); +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal, + float& d) +{ + const auto interval = CGAL::to_interval(cgal); + d = interval.first; + do { + const float next = nextafter(d, float(interval.second)); + if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break; + d = next; + } while (d < float(interval.second)); +} + +#ifndef WIN32 + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Simple_cartesian::FT & cgal, + CGAL::Simple_cartesian::FT & d) +{ + d = cgal; +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Simple_cartesian::FT & cgal, + double & d) +{ + const auto interval = CGAL::to_interval(cgal); + d = interval.first; + do { + const double next = nextafter(d, interval.second); + if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break; + d = next; + } while (d < interval.second); +} + +IGL_INLINE void igl::copyleft::cgal::assign_scalar( + const CGAL::Simple_cartesian::FT & cgal, + float& d) +{ + const auto interval = CGAL::to_interval(cgal); + d = interval.first; + do { + const float next = nextafter(d, float(interval.second)); + if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break; + d = next; + } while (d < float(interval.second)); +} + +#endif // WIN32 diff --git a/vendor/libigl/include/igl/copyleft/cgal/assign_scalar.h b/vendor/libigl/include/igl/copyleft/cgal/assign_scalar.h new file mode 100644 index 0000000000000000000000000000000000000000..feec928d5fcd4596302b1c0cc382fdfb432f93e1 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/assign_scalar.h @@ -0,0 +1,74 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_ASSIGN_SCALAR_H +#define IGL_COPYLEFT_CGAL_ASSIGN_SCALAR_H +#include "../../igl_inline.h" +#include +#include +#ifndef WIN32 +#include +#endif + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Inputs: + // cgal cgal scalar + // Outputs: + // d output scalar + IGL_INLINE void assign_scalar( + const CGAL::Epeck::FT & cgal, + CGAL::Epeck::FT & d); + IGL_INLINE void assign_scalar( + const CGAL::Epeck::FT & cgal, + double & d); + IGL_INLINE void assign_scalar( + const CGAL::Epeck::FT & cgal, + float& d); + IGL_INLINE void assign_scalar( + const double & c, + double & d); + IGL_INLINE void assign_scalar( + const float& c, + float & d); + IGL_INLINE void assign_scalar( + const float& c, + double& d); + + IGL_INLINE void assign_scalar( + const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal, + CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & d); + IGL_INLINE void assign_scalar( + const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal, + double & d); + IGL_INLINE void assign_scalar( + const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal, + float& d); + +#ifndef WIN32 + IGL_INLINE void assign_scalar( + const CGAL::Simple_cartesian::FT & cgal, + CGAL::Simple_cartesian::FT & d); + IGL_INLINE void assign_scalar( + const CGAL::Simple_cartesian::FT & cgal, + double & d); + IGL_INLINE void assign_scalar( + const CGAL::Simple_cartesian::FT & cgal, + float& d); +#endif // WIN32 + + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "assign_scalar.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/barycenter.cpp b/vendor/libigl/include/igl/copyleft/cgal/barycenter.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b3ed8aeaf29f58dce3b6d71b04b577e67e220612 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/barycenter.cpp @@ -0,0 +1,15 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "../../barycenter.h" +#include +#include +#ifdef IGL_STATIC_LIBRARY +#undef IGL_STATIC_LIBRARY +#include "../../barycenter.cpp" +template void igl::barycenter, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1> >(Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/cell_adjacency.cpp b/vendor/libigl/include/igl/copyleft/cgal/cell_adjacency.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1824a37c8b02175075567a54452222b5b92bf66c --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/cell_adjacency.cpp @@ -0,0 +1,34 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// + +#include "cell_adjacency.h" + +template +IGL_INLINE void igl::copyleft::cgal::cell_adjacency( + const Eigen::PlainObjectBase& per_patch_cells, + const size_t num_cells, + std::vector > >& + adjacency_list) { + + const size_t num_patches = per_patch_cells.rows(); + adjacency_list.resize(num_cells); + for (size_t i=0; i >(Eigen::PlainObjectBase > const&, unsigned long, std::vector::Scalar, bool, unsigned long>, std::less::Scalar, bool, unsigned long> >, std::allocator::Scalar, bool, unsigned long> > >, std::allocator::Scalar, bool, unsigned long>, std::less::Scalar, bool, unsigned long> >, std::allocator::Scalar, bool, unsigned long> > > > >&); +#ifdef WIN32 +template void igl::copyleft::cgal::cell_adjacency>(class Eigen::PlainObjectBase> const &, unsigned __int64, class std::vector, struct std::less>, class std::allocator>>, class std::allocator, struct std::less>, class std::allocator>>>> &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/cell_adjacency.h b/vendor/libigl/include/igl/copyleft/cgal/cell_adjacency.h new file mode 100644 index 0000000000000000000000000000000000000000..2244d3c4acffc74680c0e4a4f1ec02e2cfe77505 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/cell_adjacency.h @@ -0,0 +1,50 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLEFT_CGAL_CELL_ADJACENCY_H +#define IGL_COPYLEFT_CGAL_CELL_ADJACENCY_H +#include "../../igl_inline.h" +#include +#include +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Inputs: + // per_patch_cells #P by 2 list of cell labels on each side of each + // patch. Cell labels are assumed to be continuous + // from 0 to #C. + // num_cells number of cells. + // + // Outputs: + // adjacency_list #C array of list of adjcent cell information. If + // cell i and cell j are adjacent via patch x, where i + // is on the positive side of x, and j is on the + // negative side. Then, + // adjacency_list[i] will contain the entry {j, false, x} + // and + // adjacency_list[j] will contain the entry {i, true, x} + template < typename DerivedC > + IGL_INLINE void cell_adjacency( + const Eigen::PlainObjectBase& per_patch_cells, + const size_t num_cells, + std::vector > >& + adjacency_list); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "cell_adjacency.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/closest_facet.cpp b/vendor/libigl/include/igl/copyleft/cgal/closest_facet.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0b08dd4bc78d86f90d3da9600ee63fa0e602205a --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/closest_facet.cpp @@ -0,0 +1,504 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#include "closest_facet.h" + +#include +#include +#include + +#include "order_facets_around_edge.h" +#include "submesh_aabb_tree.h" +#include "../../vertex_triangle_adjacency.h" +#include "../../LinSpaced.h" +//#include "../../writePLY.h" + +template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename DerivedP, + typename uE2EType, + typename DerivedEMAP, + typename DerivedR, + typename DerivedS > +IGL_INLINE void igl::copyleft::cgal::closest_facet( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Eigen::PlainObjectBase& P, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& R, + Eigen::PlainObjectBase& S) +{ + + typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; + typedef Kernel::Point_3 Point_3; + typedef Kernel::Plane_3 Plane_3; + typedef Kernel::Segment_3 Segment_3; + typedef Kernel::Triangle_3 Triangle; + typedef std::vector::iterator Iterator; + typedef CGAL::AABB_triangle_primitive Primitive; + typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_tree Tree; + + if (F.rows() <= 0 || I.rows() <= 0) { + throw std::runtime_error( + "Closest facet cannot be computed on empty mesh."); + } + + std::vector > VF, VFi; + igl::vertex_triangle_adjacency(V.rows(), F, VF, VFi); + std::vector in_I; + std::vector triangles; + Tree tree; + submesh_aabb_tree(V,F,I,tree,triangles,in_I); + + return closest_facet( + V,F,I,P,uE2E,EMAP,VF,VFi,tree,triangles,in_I,R,S); +} + +template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename DerivedP, + typename uE2EType, + typename DerivedEMAP, + typename Kernel, + typename DerivedR, + typename DerivedS > +IGL_INLINE void igl::copyleft::cgal::closest_facet( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Eigen::PlainObjectBase& P, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + const std::vector > & VF, + const std::vector > & VFi, + const CGAL::AABB_tree< + CGAL::AABB_traits< + Kernel, + CGAL::AABB_triangle_primitive< + Kernel, typename std::vector< + typename Kernel::Triangle_3 >::iterator > > > & tree, + const std::vector & triangles, + const std::vector & in_I, + Eigen::PlainObjectBase& R, + Eigen::PlainObjectBase& S) +{ + typedef typename Kernel::Point_3 Point_3; + typedef typename Kernel::Plane_3 Plane_3; + typedef typename Kernel::Segment_3 Segment_3; + typedef typename Kernel::Triangle_3 Triangle; + typedef typename std::vector::iterator Iterator; + typedef typename CGAL::AABB_triangle_primitive Primitive; + typedef typename CGAL::AABB_traits AABB_triangle_traits; + typedef typename CGAL::AABB_tree Tree; + + const size_t num_faces = I.rows(); + if (F.rows() <= 0 || I.rows() <= 0) { + throw std::runtime_error( + "Closest facet cannot be computed on empty mesh."); + } + + auto on_the_positive_side = [&](size_t fid, const Point_3& p) -> bool + { + const auto& f = F.row(fid).eval(); + Point_3 v0(V(f[0], 0), V(f[0], 1), V(f[0], 2)); + Point_3 v1(V(f[1], 0), V(f[1], 1), V(f[1], 2)); + Point_3 v2(V(f[2], 0), V(f[2], 1), V(f[2], 2)); + auto ori = CGAL::orientation(v0, v1, v2, p); + switch (ori) { + case CGAL::POSITIVE: + return true; + case CGAL::NEGATIVE: + return false; + case CGAL::COPLANAR: + // Warning: + // This can only happen if fid contains a boundary edge. + // Categorized this ambiguous case as negative side. + return false; + default: + throw std::runtime_error("Unknown CGAL state."); + } + return false; + }; + + auto get_orientation = [&](size_t fid, size_t s, size_t d) -> bool + { + const auto& f = F.row(fid); + if ((size_t)f[0] == s && (size_t)f[1] == d) return false; + else if ((size_t)f[1] == s && (size_t)f[2] == d) return false; + else if ((size_t)f[2] == s && (size_t)f[0] == d) return false; + else if ((size_t)f[0] == d && (size_t)f[1] == s) return true; + else if ((size_t)f[1] == d && (size_t)f[2] == s) return true; + else if ((size_t)f[2] == d && (size_t)f[0] == s) return true; + else { + throw std::runtime_error( + "Cannot compute orientation due to incorrect connectivity"); + return false; + } + }; + auto index_to_signed_index = [&](size_t index, bool ori) -> int{ + return (index+1) * (ori? 1:-1); + }; + //auto signed_index_to_index = [&](int signed_index) -> size_t { + // return abs(signed_index) - 1; + //}; + + enum ElementType { VERTEX, EDGE, FACE }; + auto determine_element_type = [&](const Point_3& p, const size_t fid, + size_t& element_index) -> ElementType { + const auto& tri = triangles[fid]; + const Point_3 p0 = tri[0]; + const Point_3 p1 = tri[1]; + const Point_3 p2 = tri[2]; + + if (p == p0) { element_index = 0; return VERTEX; } + if (p == p1) { element_index = 1; return VERTEX; } + if (p == p2) { element_index = 2; return VERTEX; } + if (CGAL::collinear(p0, p1, p)) { element_index = 2; return EDGE; } + if (CGAL::collinear(p1, p2, p)) { element_index = 0; return EDGE; } + if (CGAL::collinear(p2, p0, p)) { element_index = 1; return EDGE; } + + element_index = 0; + return FACE; + }; + + auto process_edge_case = [&]( + size_t query_idx, + const size_t s, const size_t d, + size_t preferred_facet, + bool& orientation) -> size_t + { + Point_3 query_point( + P(query_idx, 0), + P(query_idx, 1), + P(query_idx, 2)); + + size_t corner_idx = std::numeric_limits::max(); + if ((s == F(preferred_facet, 0) && d == F(preferred_facet, 1)) || + (s == F(preferred_facet, 1) && d == F(preferred_facet, 0))) + { + corner_idx = 2; + } else if ((s == F(preferred_facet, 0) && d == F(preferred_facet, 2)) || + (s == F(preferred_facet, 2) && d == F(preferred_facet, 0))) + { + corner_idx = 1; + } else if ((s == F(preferred_facet, 1) && d == F(preferred_facet, 2)) || + (s == F(preferred_facet, 2) && d == F(preferred_facet, 1))) + { + corner_idx = 0; + } else + { + std::cerr << "s: " << s << "\t d:" << d << std::endl; + std::cerr << F.row(preferred_facet) << std::endl; + throw std::runtime_error( + "Invalid connectivity, edge does not belong to facet"); + } + + auto ueid = EMAP(preferred_facet + corner_idx * F.rows()); + auto eids = uE2E[ueid]; + std::vector intersected_face_indices; + for (auto eid : eids) + { + const size_t fid = eid % F.rows(); + if (in_I[fid]) + { + intersected_face_indices.push_back(fid); + } + } + + const size_t num_intersected_faces = intersected_face_indices.size(); + std::vector intersected_face_signed_indices(num_intersected_faces); + std::transform( + intersected_face_indices.begin(), + intersected_face_indices.end(), + intersected_face_signed_indices.begin(), + [&](size_t index) { + return index_to_signed_index( + index, get_orientation(index, s,d)); + }); + + assert(num_intersected_faces >= 1); + if (num_intersected_faces == 1) + { + // The edge must be a boundary edge. Thus, the orientation can be + // simply determined by checking if the query point is on the + // positive side of the facet. + const size_t fid = intersected_face_indices[0]; + orientation = on_the_positive_side(fid, query_point); + return fid; + } + + Eigen::VectorXi order; + DerivedP pivot = P.row(query_idx).eval(); + igl::copyleft::cgal::order_facets_around_edge(V, F, s, d, + intersected_face_signed_indices, + pivot, order); + + // Although first and last are equivalent, make the choice based on + // preferred_facet. + const size_t first = order[0]; + const size_t last = order[num_intersected_faces-1]; + if (intersected_face_indices[first] == preferred_facet) { + orientation = intersected_face_signed_indices[first] < 0; + return intersected_face_indices[first]; + } else if (intersected_face_indices[last] == preferred_facet) { + orientation = intersected_face_signed_indices[last] > 0; + return intersected_face_indices[last]; + } else { + orientation = intersected_face_signed_indices[order[0]] < 0; + return intersected_face_indices[order[0]]; + } + }; + + auto process_face_case = [&]( + const size_t query_idx, const Point_3& closest_point, + const size_t fid, bool& orientation) -> size_t { + const auto& f = F.row(I(fid, 0)); + return process_edge_case(query_idx, f[0], f[1], I(fid, 0), orientation); + }; + + // Given that the closest point to query point P(query_idx,:) on (V,F(I,:)) + // is the vertex at V(s,:) which is incident at least on triangle + // F(preferred_facet,:), determine a facet incident on V(s,:) that is + // _exposed_ to the query point and determine whether that facet is facing + // _toward_ or _away_ from the query point. + // + // Inputs: + // query_idx index into P of query point + // s index into V of closest point at vertex + // preferred_facet facet incident on s + // Outputs: + // orientation whether returned face is facing toward or away from + // query (parity unclear) + // Returns face guaranteed to be "exposed" to P(query_idx,:) + auto process_vertex_case = [&]( + const size_t query_idx, + size_t s, + size_t preferred_facet, + bool& orientation) -> size_t + { + const Point_3 query_point( + P(query_idx, 0), P(query_idx, 1), P(query_idx, 2)); + const Point_3 closest_point(V(s, 0), V(s, 1), V(s, 2)); + std::vector adj_faces; + std::vector adj_face_corners; + { + // Gather adj faces to s within I. + const auto& all_adj_faces = VF[s]; + const auto& all_adj_face_corners = VFi[s]; + const size_t num_all_adj_faces = all_adj_faces.size(); + for (size_t i=0; i 0); + + std::set adj_vertices_set; + std::unordered_multimap v2f; + for (size_t i=0; i adj_vertices(num_adj_vertices); + std::copy(adj_vertices_set.begin(), adj_vertices_set.end(), + adj_vertices.begin()); + + std::vector adj_points; + for (size_t vid : adj_vertices) + { + adj_points.emplace_back(V(vid,0), V(vid,1), V(vid,2)); + } + + // A plane is on the exterior if all adj_points lies on or to + // one side of the plane. + auto is_on_exterior = [&](const Plane_3& separator) -> bool{ + size_t positive=0; + size_t negative=0; + size_t coplanar=0; + for (const auto& point : adj_points) { + switch(separator.oriented_side(point)) { + case CGAL::ON_POSITIVE_SIDE: + positive++; + break; + case CGAL::ON_NEGATIVE_SIDE: + negative++; + break; + case CGAL::ON_ORIENTED_BOUNDARY: + coplanar++; + break; + default: + throw "Unknown plane-point orientation"; + } + } + auto query_orientation = separator.oriented_side(query_point); + if (query_orientation == CGAL::ON_ORIENTED_BOUNDARY && + (positive == 0 && negative == 0)) { + // All adj vertices and query point are coplanar. + // In this case, all separators are equally valid. + return true; + } else { + bool r = (positive == 0 && query_orientation == CGAL::POSITIVE) + || (negative == 0 && query_orientation == CGAL::NEGATIVE); + return r; + } + }; + + size_t d = std::numeric_limits::max(); + for (size_t i=0; i::max()) { + Eigen::MatrixXd tmp_vertices(V.rows(), V.cols()); + for (size_t i=0; isecond, orientation); + }; + + const size_t num_queries = P.rows(); + R.resize(num_queries, 1); + S.resize(num_queries, 1); + for (size_t i=0; i intersected_faces; + tree.all_intersected_primitives(Segment_3(closest_point, query), + std::back_inserter(intersected_faces)); + const size_t num_intersected_faces = intersected_faces.size(); + std::vector intersected_face_indices(num_intersected_faces); + std::transform(intersected_faces.begin(), + intersected_faces.end(), + intersected_face_indices.begin(), + [&](const typename Tree::Primitive_id& itr) -> size_t + { return I(itr-triangles.begin(), 0); }); + + size_t element_index; + auto element_type = determine_element_type(closest_point, fid, + element_index); + switch(element_type) { + case VERTEX: + { + const auto& f = F.row(I(fid, 0)); + const size_t s = f[element_index]; + fid = process_vertex_case(i, s, I(fid, 0), fid_ori); + } + break; + case EDGE: + { + const auto& f = F.row(I(fid, 0)); + const size_t s = f[(element_index+1)%3]; + const size_t d = f[(element_index+2)%3]; + fid = process_edge_case(i, s, d, I(fid, 0), fid_ori); + } + break; + case FACE: + { + fid = process_face_case(i, closest_point, fid, fid_ori); + } + break; + default: + throw std::runtime_error("Unknown element type."); + } + + + R(i,0) = fid; + S(i,0) = fid_ori; + } +} + +template< + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename uE2EType, + typename DerivedEMAP, + typename DerivedR, + typename DerivedS > +IGL_INLINE void igl::copyleft::cgal::closest_facet( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& P, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& R, + Eigen::PlainObjectBase& S) { + const size_t num_faces = F.rows(); + Eigen::VectorXi I = igl::LinSpaced(num_faces, 0, num_faces-1); + igl::copyleft::cgal::closest_facet(V, F, I, P, uE2E, EMAP, R, S); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::closest_facet, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, unsigned long, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > > const&, std::vector > const&, std::vector > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::closest_facet, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, unsigned long, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > > const&, std::vector > const&, std::vector > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::closest_facet, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, unsigned long, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template void igl::copyleft::cgal::closest_facet, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, -1, -1, 0, -1, -1>, unsigned __int64, class Eigen::Matrix, class CGAL::Epeck, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class std::vector>, class std::allocator>>> const &, class Eigen::PlainObjectBase> const &, class std::vector>, class std::allocator>>> const &, class std::vector>, class std::allocator>>> const &, class CGAL::AABB_tree>>>, struct CGAL::Boolean_tag<0>>>> const &, class std::vector, class std::allocator>> const &, class std::vector> const &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::closest_facet, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, -1, -1, 1, -1, -1>, unsigned __int64, class Eigen::Matrix, class CGAL::Epeck, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class std::vector>, class std::allocator>>> const &, class Eigen::PlainObjectBase> const &, class std::vector>, class std::allocator>>> const &, class std::vector>, class std::allocator>>> const &, class CGAL::AABB_tree>>>, struct CGAL::Boolean_tag<0>>>> const &, class std::vector, class std::allocator>> const &, class std::vector> const &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::closest_facet, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, -1, -1, 1, -1, -1>, unsigned __int64, class Eigen::Matrix, class CGAL::Epeck, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class std::vector>, class std::allocator>>> const &, class Eigen::PlainObjectBase> const &, class std::vector>, class std::allocator>>> const &, class std::vector>, class std::allocator>>> const &, class CGAL::AABB_tree>>>, struct CGAL::Boolean_tag<0>>>> const &, class std::vector, class std::allocator>> const &, class std::vector> const &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/closest_facet.h b/vendor/libigl/include/igl/copyleft/cgal/closest_facet.h new file mode 100644 index 0000000000000000000000000000000000000000..737ca2e22a5afa2d545879fcff9d964d726b1c0b --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/closest_facet.h @@ -0,0 +1,110 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLET_CGAL_CLOSEST_FACET_H +#define IGL_COPYLET_CGAL_CLOSEST_FACET_H + +#include "../../igl_inline.h" +#include +#include + +#include +#include +#include +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Determine the closest facet for each of the input points. + // + // Inputs: + // V #V by 3 array of vertices. + // F #F by 3 array of faces. + // I #I list of triangle indices to consider. + // P #P by 3 array of query points. + // + // Outputs: + // R #P list of closest facet indices. + // S #P list of bools indicating on which side of the closest facet + // each query point lies. + template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename DerivedP, + typename uE2EType, + typename DerivedEMAP, + typename DerivedR, + typename DerivedS > + IGL_INLINE void closest_facet( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Eigen::PlainObjectBase& P, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& R, + Eigen::PlainObjectBase& S); + template< + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename uE2EType, + typename DerivedEMAP, + typename DerivedR, + typename DerivedS > + IGL_INLINE void closest_facet( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& P, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& R, + Eigen::PlainObjectBase& S); + template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename DerivedP, + typename uE2EType, + typename DerivedEMAP, + typename Kernel, + typename DerivedR, + typename DerivedS > + IGL_INLINE void closest_facet( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Eigen::PlainObjectBase& P, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + const std::vector > & VF, + const std::vector > & VFi, + const CGAL::AABB_tree< + CGAL::AABB_traits< + Kernel, + CGAL::AABB_triangle_primitive< + Kernel, typename std::vector< + typename Kernel::Triangle_3 >::iterator > > > & tree, + const std::vector & triangles, + const std::vector & in_I, + Eigen::PlainObjectBase& R, + Eigen::PlainObjectBase& S); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +#include "closest_facet.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/complex_to_mesh.cpp b/vendor/libigl/include/igl/copyleft/cgal/complex_to_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..74bf085ab04104e667ed641f06da013763938112 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/complex_to_mesh.cpp @@ -0,0 +1,152 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "complex_to_mesh.h" + +#include "../../centroid.h" +#include "../../remove_unreferenced.h" + +#include +#include +#include +#include + +template +IGL_INLINE bool igl::copyleft::cgal::complex_to_mesh( + const CGAL::Complex_2_in_triangulation_3 & c2t3, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F) +{ + using namespace Eigen; + // CGAL/IO/Complex_2_in_triangulation_3_file_writer.h + using CGAL::Surface_mesher::number_of_facets_on_surface; + + typedef typename CGAL::Complex_2_in_triangulation_3 C2t3; + typedef typename Tr::Finite_facets_iterator Finite_facets_iterator; + typedef typename Tr::Finite_vertices_iterator Finite_vertices_iterator; + typedef typename Tr::Facet Facet; + typedef typename Tr::Edge Edge; + typedef typename Tr::Vertex_handle Vertex_handle; + + // Header. + const Tr& tr = c2t3.triangulation(); + + bool success = true; + + const int n = tr.number_of_vertices(); + const int m = c2t3.number_of_facets(); + + assert(m == number_of_facets_on_surface(tr)); + + // Finite vertices coordinates. + std::map v2i; + V.resize(n,3); + { + int v = 0; + for(Finite_vertices_iterator vit = tr.finite_vertices_begin(); + vit != tr.finite_vertices_end(); + ++vit) + { + V(v,0) = vit->point().x(); + V(v,1) = vit->point().y(); + V(v,2) = vit->point().z(); + v2i[vit] = v++; + } + } + + { + Finite_facets_iterator fit = tr.finite_facets_begin(); + std::set oriented_set; + std::stack stack; + + while ((int)oriented_set.size() != m) + { + while ( fit->first->is_facet_on_surface(fit->second) == false || + oriented_set.find(*fit) != oriented_set.end() || + oriented_set.find(c2t3.opposite_facet(*fit)) != + oriented_set.end() ) + { + ++fit; + } + oriented_set.insert(*fit); + stack.push(*fit); + while(! stack.empty() ) + { + Facet f = stack.top(); + stack.pop(); + for(int ih = 0 ; ih < 3 ; ++ih) + { + const int i1 = tr.vertex_triple_index(f.second, tr. cw(ih)); + const int i2 = tr.vertex_triple_index(f.second, tr.ccw(ih)); + + const typename C2t3::Face_status face_status + = c2t3.face_status(Edge(f.first, i1, i2)); + if(face_status == C2t3::REGULAR) + { + Facet fn = c2t3.neighbor(f, ih); + if (oriented_set.find(fn) == oriented_set.end()) + { + if(oriented_set.find(c2t3.opposite_facet(fn)) == oriented_set.end()) + { + oriented_set.insert(fn); + stack.push(fn); + }else { + success = false; // non-orientable + } + } + }else if(face_status != C2t3::BOUNDARY) + { + success = false; // non manifold, thus non-orientable + } + } // end "for each neighbor of f" + } // end "stack non empty" + } // end "oriented_set not full" + + F.resize(m,3); + int f = 0; + for(typename std::set::const_iterator fit = + oriented_set.begin(); + fit != oriented_set.end(); + ++fit) + { + const typename Tr::Cell_handle cell = fit->first; + const int& index = fit->second; + const int index1 = v2i[cell->vertex(tr.vertex_triple_index(index, 0))]; + const int index2 = v2i[cell->vertex(tr.vertex_triple_index(index, 1))]; + const int index3 = v2i[cell->vertex(tr.vertex_triple_index(index, 2))]; + // This order is flipped + F(f,0) = index1; + F(f,1) = index2; + F(f,2) = index3; + f++; + } + assert(f == m); + } // end if(facets must be oriented) + + // This CGAL code seems to randomly assign the global orientation + // Flip based on the signed volume. + Eigen::Vector3d cen; + double vol; + igl::centroid(V,F,cen,vol); + if(vol < 0) + { + // Flip + F = F.rowwise().reverse().eval(); + } + + // CGAL code somehow can end up with unreferenced vertices + { + VectorXi _1; + remove_unreferenced( MatrixXd(V), MatrixXi(F), V,F,_1); + } + + return success; +} + +#ifdef IGL_STATIC_LIBRARY +template bool igl::copyleft::cgal::complex_to_mesh, CGAL::Triangulation_data_structure_3, CGAL::Triangulation_vertex_base_3, CGAL::Triangulation_ds_vertex_base_3 > >, CGAL::Delaunay_triangulation_cell_base_with_circumcenter_3, CGAL::Surface_mesh_cell_base_3, CGAL::Triangulation_cell_base_3, CGAL::Triangulation_ds_cell_base_3 > > >, CGAL::Sequential_tag>, CGAL::Default, CGAL::Default>, Eigen::Matrix, Eigen::Matrix >(CGAL::Complex_2_in_triangulation_3, CGAL::Triangulation_data_structure_3, CGAL::Triangulation_vertex_base_3, CGAL::Triangulation_ds_vertex_base_3 > >, CGAL::Delaunay_triangulation_cell_base_with_circumcenter_3, CGAL::Surface_mesh_cell_base_3, CGAL::Triangulation_cell_base_3, CGAL::Triangulation_ds_cell_base_3 > > >, CGAL::Sequential_tag>, CGAL::Default, CGAL::Default>, void> const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/complex_to_mesh.h b/vendor/libigl/include/igl/copyleft/cgal/complex_to_mesh.h new file mode 100644 index 0000000000000000000000000000000000000000..ed66064b760599f6073f32189c960a26f58bc551 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/complex_to_mesh.h @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_COMPLEX_TO_MESH_H +#define IGL_COPYLEFT_CGAL_COMPLEX_TO_MESH_H +#include "../../igl_inline.h" + +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Templates: + // Tr CGAL triangulation type, e.g. + // CGAL::Surface_mesh_default_triangulation_3 + // Inputs + // c2t3 2-complex (surface) living in a 3d triangulation (e.g. result of + // CGAL::make_surface_mesh) + // Outputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices + // Returns true iff conversion was successful, failure can ok if CGAL code + // can't figure out ordering. + // + template + IGL_INLINE bool complex_to_mesh( + const CGAL::Complex_2_in_triangulation_3 & c2t3, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "complex_to_mesh.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/component_inside_component.cpp b/vendor/libigl/include/igl/copyleft/cgal/component_inside_component.cpp new file mode 100644 index 0000000000000000000000000000000000000000..251e9194917309ccab374733f728ea6133ab797b --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/component_inside_component.cpp @@ -0,0 +1,83 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "component_inside_component.h" + +#include "order_facets_around_edge.h" +#include "../../LinSpaced.h" +#include "points_inside_component.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +template +IGL_INLINE bool igl::copyleft::cgal::component_inside_component( + const Eigen::PlainObjectBase& V1, + const Eigen::PlainObjectBase& F1, + const Eigen::PlainObjectBase& I1, + const Eigen::PlainObjectBase& V2, + const Eigen::PlainObjectBase& F2, + const Eigen::PlainObjectBase& I2) { + if (F1.rows() <= 0 || I1.rows() <= 0 || F2.rows() <= 0 || I2.rows() <= 0) { + throw "Component inside test cannot be done on empty component!"; + } + + const Eigen::Vector3i& f = F1.row(I1(0, 0)); + const Eigen::Matrix query( + (V1(f[0],0) + V1(f[1],0) + V1(f[2],0))/3.0, + (V1(f[0],1) + V1(f[1],1) + V1(f[2],1))/3.0, + (V1(f[0],2) + V1(f[1],2) + V1(f[2],2))/3.0); + Eigen::VectorXi inside; + igl::copyleft::cgal::points_inside_component(V2, F2, I2, query, inside); + assert(inside.size() == 1); + return inside[0]; +} + +template +IGL_INLINE bool igl::copyleft::cgal::component_inside_component( + const Eigen::PlainObjectBase& V1, + const Eigen::PlainObjectBase& F1, + const Eigen::PlainObjectBase& V2, + const Eigen::PlainObjectBase& F2) { + if (F1.rows() <= 0 || F2.rows() <= 0) { + throw "Component inside test cannot be done on empty component!"; + } + Eigen::VectorXi I1(F1.rows()), I2(F2.rows()); + I1 = igl::LinSpaced(F1.rows(), 0, F1.rows()-1); + I2 = igl::LinSpaced(F2.rows(), 0, F2.rows()-1); + return igl::copyleft::cgal::component_inside_component(V1, F1, I1, V2, F2, I2); +} + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template bool igl::copyleft::cgal::component_inside_component< +Eigen::Matrix, +Eigen::Matrix< int, -1, -1, 0, -1, -1>, +Eigen::Matrix< int, -1, -1, 0, -1, -1> > ( +Eigen::PlainObjectBase > const&, +Eigen::PlainObjectBase > const&, +Eigen::PlainObjectBase > const&, +Eigen::PlainObjectBase > const&, +Eigen::PlainObjectBase > const&, +Eigen::PlainObjectBase > const&); + +template bool igl::copyleft::cgal::component_inside_component< +Eigen::Matrix, +Eigen::Matrix< int, -1, -1, 0, -1, -1> > ( +Eigen::PlainObjectBase > const&, +Eigen::PlainObjectBase > const&, +Eigen::PlainObjectBase > const&, +Eigen::PlainObjectBase > const&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/component_inside_component.h b/vendor/libigl/include/igl/copyleft/cgal/component_inside_component.h new file mode 100644 index 0000000000000000000000000000000000000000..17fdd6255d5f21218a7a8fa4caae0e2bb2cfbe2c --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/component_inside_component.h @@ -0,0 +1,75 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_COMONENT_INSIDE_COMPONENT +#define IGL_COPYLEFT_CGAL_COMONENT_INSIDE_COMPONENT + +#include "../../igl_inline.h" +#include +#include + +namespace igl { + namespace copyleft + { + namespace cgal { + + // Determine if connected facet component (V1, F1, I1) is inside of + // connected facet component (V2, F2, I2). + // + // Precondition: + // Both components must represent closed, self-intersection free, + // non-degenerated surfaces that are the boundary of 3D volumes. In + // addition, (V1, F1, I1) must not intersect with (V2, F2, I2). + // + // Inputs: + // V1 #V1 by 3 list of vertex position of mesh 1 + // F1 #F1 by 3 list of triangles indices into V1 + // I1 #I1 list of indices into F1, indicate the facets of component + // V2 #V2 by 3 list of vertex position of mesh 2 + // F2 #F2 by 3 list of triangles indices into V2 + // I2 #I2 list of indices into F2, indicate the facets of component + // + // Outputs: + // return true iff (V1, F1, I1) is entirely inside of (V2, F2, I2). + template + IGL_INLINE bool component_inside_component( + const Eigen::PlainObjectBase& V1, + const Eigen::PlainObjectBase& F1, + const Eigen::PlainObjectBase& I1, + const Eigen::PlainObjectBase& V2, + const Eigen::PlainObjectBase& F2, + const Eigen::PlainObjectBase& I2); + + // Determine if mesh (V1, F1) is inside of mesh (V2, F2). + // + // Precondition: + // Both meshes must be closed, self-intersection free, non-degenerated + // surfaces that are the boundary of 3D volumes. They should not + // intersect each other. + // + // Inputs: + // V1 #V1 by 3 list of vertex position of mesh 1 + // F1 #F1 by 3 list of triangles indices into V1 + // V2 #V2 by 3 list of vertex position of mesh 2 + // F2 #F2 by 3 list of triangles indices into V2 + // + // Outputs: + // return true iff (V1, F1) is entirely inside of (V2, F2). + template + IGL_INLINE bool component_inside_component( + const Eigen::PlainObjectBase& V1, + const Eigen::PlainObjectBase& F1, + const Eigen::PlainObjectBase& V2, + const Eigen::PlainObjectBase& F2); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +#include "component_inside_component.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/convex_hull.cpp b/vendor/libigl/include/igl/copyleft/cgal/convex_hull.cpp new file mode 100644 index 0000000000000000000000000000000000000000..991b07dfc9389abb2784a4d00ef74d78e36a4c4c --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/convex_hull.cpp @@ -0,0 +1,104 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "convex_hull.h" +#include "../../ismember.h" +#include "polyhedron_to_mesh.h" +#include +#include +#include +#include +#include + +template < + typename DerivedV, + typename DerivedW, + typename DerivedG> +IGL_INLINE void igl::copyleft::cgal::convex_hull( + const Eigen::MatrixBase & V, + Eigen::PlainObjectBase & W, + Eigen::PlainObjectBase & G) +{ + typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + switch(V.cols()) + { + case 3: + { + typedef K::Point_3 Point_3; + //typedef CGAL::Delaunay_triangulation_3 Delaunay; + //typedef Delaunay::Vertex_handle Vertex_handle; + //typedef CGAL::Surface_mesh Surface_mesh; + typedef CGAL::Polyhedron_3 Polyhedron_3; + std::vector points(V.rows()); + for(int i = 0;i points(V.rows()); + std::vector result; + for(int i = 0;i +IGL_INLINE void igl::copyleft::cgal::convex_hull( + const Eigen::MatrixBase & V, + Eigen::PlainObjectBase & F) +{ + Eigen::Matrix W; + Eigen::Matrix G; + convex_hull(V,W,G); + // This is a lazy way to reindex into the original mesh + Eigen::Matrix I; + Eigen::VectorXi J; + igl::ismember_rows(W,V,I,J); + assert(I.all() && "Should find all W in V"); + F.resizeLike(G); + for(int f = 0;f, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::convex_hull, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::convex_hull, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::convex_hull, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/convex_hull.h b/vendor/libigl/include/igl/copyleft/cgal/convex_hull.h new file mode 100644 index 0000000000000000000000000000000000000000..ba04dd7cc84bab0aba253435abdb8e9e4bfe358d --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/convex_hull.h @@ -0,0 +1,56 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_CONVEX_HULL_H +#define IGL_COPYLEFT_CGAL_CONVEX_HULL_H +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given a set of points (V), compute the convex hull as a triangle mesh (W,G) + // + // Inputs: + // V #V by 3 list of input points + // Outputs: + // W #W by 3 list of convex hull points + // G #G by 3 list of triangle indices into W + template < + typename DerivedV, + typename DerivedW, + typename DerivedG> + IGL_INLINE void convex_hull( + const Eigen::MatrixBase & V, + Eigen::PlainObjectBase & W, + Eigen::PlainObjectBase & G); + // Given a set of points (V), compute the convex hull as a triangle mesh (F) + // over input vertex set (V) + // + // Inputs: + // V #V by 3 list of input points + // Outputs: + // F #F by 3 list of triangle indices into V + // + template < + typename DerivedV, + typename DerivedF> + IGL_INLINE void convex_hull( + const Eigen::MatrixBase & V, + Eigen::PlainObjectBase & F); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "convex_hull.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/coplanar.cpp b/vendor/libigl/include/igl/copyleft/cgal/coplanar.cpp new file mode 100644 index 0000000000000000000000000000000000000000..912ec1b59b9a75477c830dbedb6256bd6d58a0a0 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/coplanar.cpp @@ -0,0 +1,49 @@ +#include "coplanar.h" +#include "row_to_point.h" +#include +#include + +template +IGL_INLINE bool igl::copyleft::cgal::coplanar( + const Eigen::MatrixBase & V) +{ + // 3 points in 3D are always coplanar + if(V.rows() < 4){ return true; } + // spanning points found so far + std::vector > p; + for(int i = 0;i pi(V(i,0), V(i,1), V(i,2)); + switch(p.size()) + { + case 0: + p.push_back(pi); + break; + case 1: + if(p[0] != pi) + { + p.push_back(pi); + } + break; + case 2: + if(!CGAL::collinear(p[0],p[1],pi)) + { + p.push_back(pi); + } + break; + case 3: + if(!CGAL::coplanar(p[0],p[1],p[2],pi)) + { + return false; + } + break; + } + } + return true; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::coplanar >(Eigen::MatrixBase > const&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/coplanar.h b/vendor/libigl/include/igl/copyleft/cgal/coplanar.h new file mode 100644 index 0000000000000000000000000000000000000000..31e66d09255c1a32234eaef85242378f5e81eb18 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/coplanar.h @@ -0,0 +1,26 @@ +#ifndef IGL_COPYLEFT_CGAL_COPLANAR_H +#define IGL_COPYLEFT_CGAL_COPLANAR_H +#include "../../igl_inline.h" +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Test whether all points are on same plane. + // + // Inputs: + // V #V by 3 list of 3D vertex positions + // Returns true if all points lie on the same plane + template + IGL_INLINE bool coplanar( + const Eigen::MatrixBase & V); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "coplanar.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/delaunay_triangulation.cpp b/vendor/libigl/include/igl/copyleft/cgal/delaunay_triangulation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..73bfe8ecc059b3c0c9428c4c6abed424bc72e702 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/delaunay_triangulation.cpp @@ -0,0 +1,67 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Alec Jacobson +// Copyright (C) 2016 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "delaunay_triangulation.h" +#include "../../delaunay_triangulation.h" +#include "orient2D.h" +#include "incircle.h" + +template< + typename DerivedV, + typename DerivedF> +IGL_INLINE void igl::copyleft::cgal::delaunay_triangulation( + const Eigen::MatrixBase& V, + Eigen::PlainObjectBase& F) +{ + typedef typename DerivedV::Scalar Scalar; + igl::delaunay_triangulation(V, orient2D, incircle, F); + // This function really exists to test our igl::delaunay_triangulation + // + // It's currently much faster to call cgal's native Delaunay routine + // +//#include +//#include +//#include +//#include +// const auto delaunay = +// [&](const Eigen::MatrixXd & V,Eigen::MatrixXi & F) +// { +// typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +// typedef CGAL::Triangulation_vertex_base_with_info_2 Vb; +// typedef CGAL::Triangulation_data_structure_2 Tds; +// typedef CGAL::Delaunay_triangulation_2 Delaunay; +// typedef Kernel::Point_2 Point; +// std::vector< std::pair > points(V.rows()); +// for(int i = 0;ivertex(0)->info(); +// F(j,1) = face->vertex(1)->info(); +// F(j,2) = face->vertex(2)->info(); +// j++; +// } +// } +// }; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::delaunay_triangulation, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/delaunay_triangulation.h b/vendor/libigl/include/igl/copyleft/cgal/delaunay_triangulation.h new file mode 100644 index 0000000000000000000000000000000000000000..962c93312cf4bd7ad15a3171c04c146dfd25edaf --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/delaunay_triangulation.h @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_COPYLEFT_CGAL_DELAUNAY_TRIANGULATION_H +#define IGL_COPYLEFT_CGAL_DELAUNAY_TRIANGULATION_H + +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + + // Given a set of points in 2D, return a Delaunay triangulation of these + // points. + // + // Inputs: + // V #V by 2 list of vertex positions + // + // Outputs: + // F #F by 3 of faces in Delaunay triangulation. + template< + typename DerivedV, + typename DerivedF + > + IGL_INLINE void delaunay_triangulation( + const Eigen::MatrixBase& V, + Eigen::PlainObjectBase& F); + } + } +} + + + + +#ifndef IGL_STATIC_LIBRARY +# include "delaunay_triangulation.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/extract_cells.cpp b/vendor/libigl/include/igl/copyleft/cgal/extract_cells.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b11e8680bc7dbd8b81a7bd62cda8e4fcdd75817f --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/extract_cells.cpp @@ -0,0 +1,548 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#include "extract_cells.h" +#include "closest_facet.h" +#include "order_facets_around_edge.h" +#include "outer_facet.h" +#include "submesh_aabb_tree.h" +#include "../../extract_manifold_patches.h" +#include "../../facet_components.h" +#include "../../get_seconds.h" +#include "../../triangle_triangle_adjacency.h" +#include "../../unique_edge_map.h" +#include "../../vertex_triangle_adjacency.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +//#define EXTRACT_CELLS_DEBUG + +template< + typename DerivedV, + typename DerivedF, + typename DerivedC > +IGL_INLINE size_t igl::copyleft::cgal::extract_cells( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + Eigen::PlainObjectBase& cells) +{ + const size_t num_faces = F.rows(); + // Construct edge adjacency + Eigen::MatrixXi E, uE; + Eigen::VectorXi EMAP; + std::vector > uE2E; + igl::unique_edge_map(F, E, uE, EMAP, uE2E); + // Cluster into manifold patches + Eigen::VectorXi P; + igl::extract_manifold_patches(F, EMAP, uE2E, P); + // Extract cells + DerivedC per_patch_cells; + const size_t num_cells = + igl::copyleft::cgal::extract_cells(V,F,P,E,uE,uE2E,EMAP,per_patch_cells); + // Distribute per-patch cell information to each face + cells.resize(num_faces, 2); + for (size_t i=0; i +IGL_INLINE size_t igl::copyleft::cgal::extract_cells( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& P, + const Eigen::PlainObjectBase& E, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& cells) +{ + // Trivial base case + if(P.size() == 0) + { + assert(F.size() == 0); + cells.resize(0,2); + return 0; + } + + typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; + typedef Kernel::Point_3 Point_3; + typedef Kernel::Plane_3 Plane_3; + typedef Kernel::Segment_3 Segment_3; + typedef Kernel::Triangle_3 Triangle; + typedef std::vector::iterator Iterator; + typedef CGAL::AABB_triangle_primitive Primitive; + typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_tree Tree; + +#ifdef EXTRACT_CELLS_DEBUG + const auto & tictoc = []() -> double + { + static double t_start = igl::get_seconds(); + double diff = igl::get_seconds()-t_start; + t_start += diff; + return diff; + }; + const auto log_time = [&](const std::string& label) -> void { + std::cout << "extract_cells." << label << ": " + << tictoc() << std::endl; + }; + tictoc(); +#else + // no-op + const auto log_time = [](const std::string){}; +#endif + const size_t num_faces = F.rows(); + typedef typename DerivedF::Scalar Index; + assert(P.size() > 0); + const size_t num_patches = P.maxCoeff()+1; + + // Extract all cells... + DerivedC raw_cells; + const size_t num_raw_cells = + extract_cells_single_component(V,F,P,uE,uE2E,EMAP,raw_cells); + log_time("extract_single_component_cells"); + + // Compute triangle-triangle adjacency data-structure + std::vector > > TT,_1; + igl::triangle_triangle_adjacency(E, EMAP, uE2E, false, TT, _1); + log_time("compute_face_adjacency"); + + // Compute connected components of the mesh + Eigen::VectorXi C, counts; + igl::facet_components(TT, C, counts); + log_time("form_components"); + + const size_t num_components = counts.size(); + // components[c] --> list of face indices into F of faces in component c + std::vector > components(num_components); + // Loop over all faces + for (size_t i=0; i > VF,VFi; + igl::vertex_triangle_adjacency(V.rows(), F, VF, VFi); + std::vector Is(num_components); + std::vector< + CGAL::AABB_tree< + CGAL::AABB_traits< + Kernel, + CGAL::AABB_triangle_primitive< + Kernel, std::vector< + Kernel::Triangle_3 >::iterator > > > > trees(num_components); + std::vector< std::vector > + triangle_lists(num_components); + std::vector > in_Is(num_components); + + // Find outer facets, their orientations and cells for each component + Eigen::VectorXi outer_facets(num_components); + Eigen::VectorXi outer_facet_orientation(num_components); + Eigen::VectorXi outer_cells(num_components); + for (size_t i=0; i > nested_cells(num_raw_cells); + std::vector > ambient_cells(num_raw_cells); + std::vector > ambient_comps(num_components); + // Only bother if there's more than one component + if(num_components > 1) + { + // construct bounding boxes for each component + DerivedV bbox_min(num_components, 3); + DerivedV bbox_max(num_components, 3); + // Assuming our mesh (in exact numbers) fits in the range of double. + bbox_min.setConstant(std::numeric_limits::max()); + bbox_max.setConstant(std::numeric_limits::lowest()); + // Loop over faces + for (size_t i=0; i candidate_comps; + candidate_comps.reserve(num_components); + // Loop over components + for (size_t j=0; j component index inside component i, because the cell of the + // closest facet on i to component index is **not** the same as the + // "outer cell" of component i: component index is **not** outside of + // component i (therefore it's inside). + nested_cells[ambient_cell].push_back(outer_cells[index]); + ambient_cells[outer_cells[index]].push_back(ambient_cell); + ambient_comps[index].push_back(i); + } + } + } + } + +#ifdef EXTRACT_CELLS_DEBUG + log_time("nested_relationship"); +#endif + + const size_t INVALID = std::numeric_limits::max(); + const size_t INFINITE_CELL = num_raw_cells; + std::vector embedded_cells(num_raw_cells, INVALID); + for (size_t i=0; i 0) { + size_t embedded_comp = INVALID; + size_t embedded_cell = INVALID; + for (size_t j=0; j mapped_indices(num_raw_cells+1, INVALID); + // Always map infinite cell to index 0. + mapped_indices[INFINITE_CELL] = count; + count++; + + for (size_t i=0; i +IGL_INLINE size_t igl::copyleft::cgal::extract_cells_single_component( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& P, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& cells) +{ + const size_t num_faces = F.rows(); + // Input: + // index index into #F*3 list of undirect edges + // Returns index into face + const auto edge_index_to_face_index = [&num_faces](size_t index) + { + return index % num_faces; + }; + // Determine if a face (containing undirected edge {s,d} is consistently + // oriented with directed edge {s,d} (or otherwise it is with {d,s}) + // + // Inputs: + // fid face index into F + // s source index of edge + // d destination index of edge + // Returns true if face F(fid,:) is consistent with {s,d} + const auto is_consistent = + [&F](const size_t fid, const size_t s, const size_t d) -> bool + { + if ((size_t)F(fid, 0) == s && (size_t)F(fid, 1) == d) return false; + if ((size_t)F(fid, 1) == s && (size_t)F(fid, 2) == d) return false; + if ((size_t)F(fid, 2) == s && (size_t)F(fid, 0) == d) return false; + + if ((size_t)F(fid, 0) == d && (size_t)F(fid, 1) == s) return true; + if ((size_t)F(fid, 1) == d && (size_t)F(fid, 2) == s) return true; + if ((size_t)F(fid, 2) == d && (size_t)F(fid, 0) == s) return true; + throw "Invalid face!"; + return false; + }; + + const size_t num_unique_edges = uE.rows(); + const size_t num_patches = P.maxCoeff() + 1; + + // Build patch-patch adjacency list. + std::vector > patch_adj(num_patches); + for (size_t i=0; i 2) { + for (size_t j=0; j::max(); + std::vector cell_labels(num_patches * 2); + for (size_t i=0; i > equivalent_cells(num_patches*2); + std::vector processed(num_unique_edges, false); + + size_t label_count=0; + for (size_t i=0; i 2); + + const size_t s = uE(uei,0); + const size_t d = uE(uei,1); + + std::vector signed_adj_faces; + for (auto ej : adj_faces) + { + const size_t fid = edge_index_to_face_index(ej); + bool cons = is_consistent(fid, s, d); + signed_adj_faces.push_back((fid+1)*(cons ? 1:-1)); + } + { + // Sort adjacent faces cyclically around {s,d} + Eigen::VectorXi order; + // order[f] will reveal the order of face f in signed_adj_faces + order_facets_around_edge(V, F, s, d, signed_adj_faces, order); + for (size_t j=0; j 0; + const bool next_cons = signed_adj_faces[order[next_idx]] > 0; + const size_t curr_cell_idx = curr_patch_idx*2 + (curr_cons?0:1); + const size_t next_cell_idx = next_patch_idx*2 + (next_cons?1:0); + equivalent_cells[curr_cell_idx].insert(next_cell_idx); + equivalent_cells[next_cell_idx].insert(curr_cell_idx); + } + } + } + } + + size_t count=0; + cells.resize(num_patches, 2); + cells.setConstant(INVALID); + const auto extract_equivalent_cells = [&](size_t i) { + if (cells(i/2, i%2) != INVALID) return; + std::queue Q; + Q.push(i); + cells(i/2, i%2) = count; + while (!Q.empty()) { + const size_t index = Q.front(); + Q.pop(); + for (const auto j : equivalent_cells[index]) { + if (cells(j/2, j%2) == INVALID) { + cells(j/2, j%2) = count; + Q.push(j); + } + } + } + count++; + }; + for (size_t i=0; i, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, unsigned long, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template unsigned long igl::copyleft::cgal::extract_cells, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, unsigned long, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +#include +template unsigned long igl::copyleft::cgal::extract_cells, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, unsigned long, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template unsigned long igl::copyleft::cgal::extract_cells, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template unsigned __int64 igl::copyleft::cgal::extract_cells, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, unsigned __int64, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class std::vector>, class std::allocator>>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> &); +template unsigned __int64 igl::copyleft::cgal::extract_cells, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, unsigned __int64, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class std::vector>, class std::allocator>>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> &); +template unsigned __int64 igl::copyleft::cgal::extract_cells, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, unsigned __int64, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class std::vector>, class std::allocator>>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> &); +template unsigned __int64 igl::copyleft::cgal::extract_cells,-1,-1,0,-1,-1>,class Eigen::Matrix,class Eigen::Matrix >(class Eigen::PlainObjectBase,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/extract_cells.h b/vendor/libigl/include/igl/copyleft/cgal/extract_cells.h new file mode 100644 index 0000000000000000000000000000000000000000..9575ffbaed653496d0d6d4bc59e03148f8a58568 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/extract_cells.h @@ -0,0 +1,116 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLEFT_CGAL_EXTRACT_CELLS +#define IGL_COPYLEFT_CGAL_EXTRACT_CELLS + +#include "../../igl_inline.h" +#include +#include + +namespace igl { + namespace copyleft + { + namespace cgal + { + // Extract connected 3D space partitioned by mesh (V, F). + // + // Inputs: + // V #V by 3 array of vertices. + // F #F by 3 array of faces. + // + // Output: + // cells #F by 2 array of cell indices. cells(i,0) represents the + // cell index on the positive side of face i, and cells(i,1) + // represents cell index of the negqtive side. + // By convension cell with index 0 is the infinite cell. + // Returns the number of cells + template< + typename DerivedV, + typename DerivedF, + typename DerivedC > + IGL_INLINE size_t extract_cells( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + Eigen::PlainObjectBase& cells); + + // Extract connected 3D space partitioned by mesh (V, F). + // + // Inputs: + // V #V by 3 array of vertices. + // F #F by 3 array of faces. + // P #F list of patch indices. + // E #E by 2 array of vertex indices, one edge per row. + // uE #uE by 2 list of vertex_indices, represents undirected edges. + // uE2E #uE list of lists that maps uE to E. (a one-to-many map) + // EMAP #F*3 list of indices into uE. + // + // Output: + // cells #P by 2 array of cell indices. cells(i,0) represents the + // cell index on the positive side of patch i, and cells(i,1) + // represents cell index of the negqtive side. + // By convension cell with index 0 is the infinite cell. + template< + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DerivedE, + typename DeriveduE, + typename uE2EType, + typename DerivedEMAP, + typename DerivedC > + IGL_INLINE size_t extract_cells( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& P, + const Eigen::PlainObjectBase& E, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& cells); + + // Extract connected 3D space partitioned by mesh (V,F) composed of + // **possibly multiple components** (the name of this function is + // dubious). + // + // Inputs: + // V #V by 3 array of vertices. + // F #F by 3 array of faces. + // P #F list of patch indices. + // E #E by 2 array of vertex indices, one edge per row. + // uE #uE by 2 list of vertex_indices, represents undirected edges. + // uE2E #uE list of lists that maps uE to E. (a one-to-many map) + // EMAP #F*3 list of indices into uE. + // Output: + // cells #P by 2 array of cell indices. cells(i,0) represents the + // cell index on the positive side of patch i, and cells(i,1) + // represents cell index of the negative side. + template< + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DeriveduE, + typename uE2EType, + typename DerivedEMAP, + typename DerivedC > + IGL_INLINE size_t extract_cells_single_component( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& P, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + const Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& cells); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "extract_cells.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/extract_feature.cpp b/vendor/libigl/include/igl/copyleft/cgal/extract_feature.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e81dc4ab0d73899a19a42e259c78956258f306bc --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/extract_feature.cpp @@ -0,0 +1,124 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "extract_feature.h" +#include "../../unique_edge_map.h" +#include "../../PI.h" +#include +#include + +template< + typename DerivedV, + typename DerivedF, + typename DerivedE > +IGL_INLINE void igl::copyleft::cgal::extract_feature( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const double tol, + Eigen::PlainObjectBase& feature_edges) { + + using IndexType = typename DerivedE::Scalar; + DerivedE E, uE; + Eigen::VectorXi EMAP; + std::vector > uE2E; + igl::unique_edge_map(F, E, uE, EMAP, uE2E); + + igl::copyleft::cgal::extract_feature(V, F, tol, E, uE, uE2E, feature_edges); +} + +template< + typename DerivedV, + typename DerivedF, + typename DerivedE > +IGL_INLINE void igl::copyleft::cgal::extract_feature( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const double tol, + const Eigen::PlainObjectBase& E, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + Eigen::PlainObjectBase& feature_edges) { + + assert(V.cols() == 3); + assert(F.cols() == 3); + using Scalar = typename DerivedV::Scalar; + using IndexType = typename DerivedE::Scalar; + using Vertex = Eigen::Matrix; + using Kernel = typename CGAL::Exact_predicates_exact_constructions_kernel; + using Point = typename Kernel::Point_3; + + const size_t num_unique_edges = uE.rows(); + const size_t num_faces = F.rows(); + // NOTE: CGAL's definition of dihedral angle measures the angle between two + // facets instead of facet normals. + const double cos_tol = cos(igl::PI - tol); + std::vector result; // Indices into uE + + auto is_non_manifold = [&uE2E](size_t ei) -> bool { + return uE2E[ei].size() > 2; + }; + + auto is_boundary = [&uE2E](size_t ei) -> bool { + return uE2E[ei].size() == 1; + }; + + auto opposite_vertex = [&uE, &F](size_t ei, size_t fi) -> IndexType { + const size_t v0 = uE(ei, 0); + const size_t v1 = uE(ei, 1); + for (size_t i=0; i<3; i++) { + const size_t v = F(fi, i); + if (v != v0 && v != v1) { return v; } + } + throw "Input face must be topologically degenerate!"; + }; + + auto is_feature = [&V, &F, &uE, &uE2E, &opposite_vertex, num_faces]( + size_t ei, double cos_tol) -> bool { + auto adj_faces = uE2E[ei]; + assert(adj_faces.size() == 2); + const Vertex v0 = V.row(uE(ei, 0)); + const Vertex v1 = V.row(uE(ei, 1)); + const Vertex v2 = V.row(opposite_vertex(ei, adj_faces[0] % num_faces)); + const Vertex v3 = V.row(opposite_vertex(ei, adj_faces[1] % num_faces)); + const Point p0(v0[0], v0[1], v0[2]); + const Point p1(v1[0], v1[1], v1[2]); + const Point p2(v2[0], v2[1], v2[2]); + const Point p3(v3[0], v3[1], v3[2]); + const auto ori = CGAL::orientation(p0, p1, p2, p3); + switch (ori) { + case CGAL::POSITIVE: + return CGAL::compare_dihedral_angle(p0, p1, p2, p3, cos_tol) == + CGAL::SMALLER; + case CGAL::NEGATIVE: + return CGAL::compare_dihedral_angle(p0, p1, p3, p2, cos_tol) == + CGAL::SMALLER; + case CGAL::COPLANAR: + if (!CGAL::collinear(p0, p1, p2) && !CGAL::collinear(p0, p1, p3)) { + return CGAL::compare_dihedral_angle(p0, p1, p2, p3, cos_tol) == + CGAL::SMALLER; + } else { + throw "Dihedral angle (and feature edge) is not well defined for" + " degenerate triangles!"; + } + default: + throw "Unknown CGAL orientation"; + } + }; + + for (size_t i=0; i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_COPYLEFT_CGAL_EXTRACT_FEATURE_H +#define IGL_COPYLEFT_CGAL_EXTRACT_FEATURE_H +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Extract feature edges based on dihedral angle. + // Here, dihedral angle is defined as the angle between surface + // __normals__ as described in + // http://mathworld.wolfram.com/DihedralAngle.html + // + // Non-manifold and boundary edges are automatically considered as + // features. + // + // Inputs: + // V #V by 3 array of vertices. + // F #F by 3 array of faces. + // tol Edges with dihedral angle larger than this are considered + // as features. Angle is measured in radian. + // + // Output: + // feature_edges: #E by 2 array of edges. Each edge satisfies at + // least one of the following criteria: + // + // * Edge has dihedral angle larger than tol. + // * Edge is boundary. + // * Edge is non-manifold (i.e. it has more than 2 adjacent + // faces). + template < + typename DerivedV, + typename DerivedF, + typename DerivedE> + IGL_INLINE void extract_feature( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const double tol, + Eigen::PlainObjectBase& feature_edges); + + // Inputs: + // V #V by 3 array of vertices. + // F #F by 3 array of faces. + // tol Edges with dihedral angle larger than this are considered + // as features. Angle is measured in radian. + // E #E by 2 array of directed edges. + // uE #uE by 2 array of undirected edges. + // uE2E #uE list of lists mapping undirected edges to all corresponding + // directed edges. + // + // Output: + // feature_edges: #E by 2 array of edges. Each edge satisfies at + // least one of the following criteria: + // + // * Edge has dihedral angle larger than tol. + // * Edge is boundary. + // * Edge is non-manifold (i.e. it has more than 2 adjacent + // faces). + template < + typename DerivedV, + typename DerivedF, + typename DerivedE> + IGL_INLINE void extract_feature( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const double tol, + const Eigen::PlainObjectBase& E, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + Eigen::PlainObjectBase& feature_edges); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "extract_feature.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/fast_winding_number.cpp b/vendor/libigl/include/igl/copyleft/cgal/fast_winding_number.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4a70cd14010f51c8bb41529d544554091eca8ba9 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/fast_winding_number.cpp @@ -0,0 +1,65 @@ +#include "fast_winding_number.h" +#include "../../fast_winding_number.h" +#include "../../octree.h" +#include "../../knn.h" +#include "../../parallel_for.h" +#include "point_areas.h" +#include + +template < + typename DerivedP, + typename DerivedN, + typename DerivedQ, + typename BetaType, + typename DerivedWN> +IGL_INLINE void igl::copyleft::cgal::fast_winding_number( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& N, + const Eigen::MatrixBase& Q, + const int expansion_order, + const BetaType beta, + Eigen::PlainObjectBase& WN) +{ + typedef typename DerivedWN::Scalar real; + typedef typename Eigen::Matrix + RealMatrix; + + std::vector > point_indices; + Eigen::Matrix CH; + Eigen::Matrix CN; + Eigen::Matrix W; + Eigen::MatrixXi I; + Eigen::Matrix A; + + octree(P,point_indices,CH,CN,W); + knn(P,21,point_indices,CH,CN,W,I); + point_areas(P,I,N,A); + + Eigen::Matrix EC; + Eigen::Matrix CM; + Eigen::Matrix R; + + igl::fast_winding_number( + P,N,A,point_indices,CH,expansion_order,CM,R,EC); + igl::fast_winding_number( + P,N,A,point_indices,CH,CM,R,EC,Q,beta,WN); +} + +template < + typename DerivedP, + typename DerivedN, + typename DerivedQ, + typename DerivedWN> +IGL_INLINE void igl::copyleft::cgal::fast_winding_number( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& N, + const Eigen::MatrixBase& Q, + Eigen::PlainObjectBase& WN) +{ + fast_winding_number(P,N,Q,2,2.0,WN); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::copyleft::cgal::fast_winding_number, Eigen::Matrix, Eigen::Matrix, double, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, double, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/fast_winding_number.h b/vendor/libigl/include/igl/copyleft/cgal/fast_winding_number.h new file mode 100644 index 0000000000000000000000000000000000000000..f153b7353203357c32bb6ee3ed33147dce15e9a2 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/fast_winding_number.h @@ -0,0 +1,79 @@ +#ifndef IGL_COPYLEFT_CGAL_FAST_WINDING_NUMBER +#define IGL_COPYLEFT_CGAL_FAST_WINDING_NUMBER +#include "../../igl_inline.h" +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Evaluate the fast winding number for point data, without known areas. The + // areas are calculated using igl::knn and igl::copyleft::cgal::point_areas. + // + // This function performes the precomputation and evaluation all in one. + // If you need to acess the precomuptation for repeated evaluations, use the + // two functions designed for exposed precomputation, which are the first two + // functions see in igl/fast_winding_number.h + // + // Inputs: + // P #P by 3 list of point locations + // N #P by 3 list of point normals + // Q #Q by 3 list of query points for the winding number + // beta This is a Barnes-Hut style accuracy term that separates near feild + // from far field. The higher the beta, the more accurate and slower + // the evaluation. We reccommend using a beta value of 2. + // expansion_order the order of the taylor expansion. We support 0,1,2. + // Outputs: + // WN #Q by 1 list of windinng number values at each query point + // + template < + typename DerivedP, + typename DerivedN, + typename DerivedQ, + typename BetaType, + typename DerivedWN> + IGL_INLINE void fast_winding_number( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& N, + const Eigen::MatrixBase& Q, + const int expansion_order, + const BetaType beta, + Eigen::PlainObjectBase& WN); + + // Evaluate the fast winding number for point data, without known areas. The + // areas are calculated using igl::knn and + // igl::point_areas. This function uses the default expansion + // order and beta (both are set to 2). + // + // This function performes the precomputation and evaluation all in one. + // If you need to acess the precomuptation for repeated evaluations, use the + // two functions designed for exposed precomputation (described above). + + // Inputs: + // P #P by 3 list of point locations + // N #P by 3 list of point normals + // Q #Q by 3 list of query points for the winding number + // Outputs: + // WN #Q by 1 list of windinng number values at each query point + // + template < + typename DerivedP, + typename DerivedN, + typename DerivedQ, + typename DerivedWN> + IGL_INLINE void fast_winding_number( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& N, + const Eigen::MatrixBase& Q, + Eigen::PlainObjectBase& WN); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "fast_winding_number.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/half_space_box.cpp b/vendor/libigl/include/igl/copyleft/cgal/half_space_box.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1bfa8ea52a0c433687feebb679ed6108e5bb8a05 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/half_space_box.cpp @@ -0,0 +1,123 @@ +#include "half_space_box.h" +#include "assign_scalar.h" +#include +#include + +template +IGL_INLINE void igl::copyleft::cgal::half_space_box( + const CGAL::Plane_3 & P, + const Eigen::MatrixBase & V, + Eigen::Matrix & BV, + Eigen::Matrix & BF) +{ + typedef CGAL::Plane_3 Plane; + typedef CGAL::Point_3 Point; + typedef CGAL::Vector_3 Vector; + typedef CGAL::Epeck::FT EScalar; + Eigen::Matrix avg(0,0,0); + for(int v = 0;v vBV;vBV.reserve(8); + Vector v = CGAL::cross_product(u,n); + // Scale u,v,n to be longer than bbd + const auto & longer_than = [](const EScalar min_sqr, Vector & x) + { + assert(x.squared_length() > 0); + while(x.squared_length() < min_sqr) + { + x = 2.*x; + } + }; + longer_than(bbd*bbd,u); + longer_than(bbd*bbd,v); + longer_than(bbd*bbd,n); + vBV.emplace_back( o2 + u + v); + vBV.emplace_back( o2 - u + v); + vBV.emplace_back( o2 - u - v); + vBV.emplace_back( o2 + u - v); + vBV.emplace_back( o2 + u + v - n); + vBV.emplace_back( o2 - u + v - n); + vBV.emplace_back( o2 - u - v - n); + vBV.emplace_back( o2 + u - v - n); + BV.resize(8,3); + for(int b = 0;b<8;b++) + { + igl::copyleft::cgal::assign_scalar(vBV[b].x(),BV(b,0)); + igl::copyleft::cgal::assign_scalar(vBV[b].y(),BV(b,1)); + igl::copyleft::cgal::assign_scalar(vBV[b].z(),BV(b,2)); + } + BF.resize(12,3); + BF<< + 1,0,2, + 2,0,3, + 4,5,6, + 4,6,7, + 0,1,4, + 4,1,5, + 1,2,5, + 5,2,6, + 2,3,6, + 6,3,7, + 3,0,7, + 7,0,4; +} + +template +IGL_INLINE void igl::copyleft::cgal::half_space_box( + const Eigen::MatrixBase & p, + const Eigen::MatrixBase & n, + const Eigen::MatrixBase & V, + Eigen::Matrix & BV, + Eigen::Matrix & BF) +{ + typedef CGAL::Plane_3 Plane; + typedef CGAL::Point_3 Point; + typedef CGAL::Vector_3 Vector; + Plane P(Point(p(0),p(1),p(2)),Vector(n(0),n(1),n(2))); + return half_space_box(P,V,BV,BF); +} + +template +IGL_INLINE void igl::copyleft::cgal::half_space_box( + const Eigen::MatrixBase & equ, + const Eigen::MatrixBase & V, + Eigen::Matrix & BV, + Eigen::Matrix & BF) +{ + typedef CGAL::Plane_3 Plane; + Plane P(equ(0),equ(1),equ(2),equ(3)); + return half_space_box(P,V,BV,BF); +} +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::half_space_box >(CGAL::Plane_3 const&, Eigen::MatrixBase > const&, Eigen::Matrix, 8, 3, 0, 8, 3>&, Eigen::Matrix&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::half_space_box >(CGAL::Plane_3 const&, Eigen::MatrixBase > const&, Eigen::Matrix, 8, 3, 0, 8, 3>&, Eigen::Matrix&); +template void igl::copyleft::cgal::half_space_box, 1, 4, 1, 1, 4>, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::MatrixBase, 1, 4, 1, 1, 4> > const&, Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::Matrix, 8, 3, 0, 8, 3>&, Eigen::Matrix&); +template void igl::copyleft::cgal::half_space_box, 1, 4, 1, 1, 4>, Eigen::Matrix, -1, 4, 0, -1, 4> >(Eigen::MatrixBase, 1, 4, 1, 1, 4> > const&, Eigen::MatrixBase, -1, 4, 0, -1, 4> > const&, Eigen::Matrix, 8, 3, 0, 8, 3>&, Eigen::Matrix&); +template void igl::copyleft::cgal::half_space_box, 1, 4, 1, 1, 4>, Eigen::Matrix >(Eigen::MatrixBase, 1, 4, 1, 1, 4> > const&, Eigen::MatrixBase > const&, Eigen::Matrix, 8, 3, 0, 8, 3>&, Eigen::Matrix&); +template void igl::copyleft::cgal::half_space_box, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix, 8, 3, 0, 8, 3>&, Eigen::Matrix&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/half_space_box.h b/vendor/libigl/include/igl/copyleft/cgal/half_space_box.h new file mode 100644 index 0000000000000000000000000000000000000000..275502235cc90b0722331ee7d7206f81c0d8957b --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/half_space_box.h @@ -0,0 +1,63 @@ +#ifndef IGL_COPYLEFT_CGAL_HALF_SPACE_BOX_H +#define IGL_COPYLEFT_CGAL_HALF_SPACE_BOX_H +#include "../../igl_inline.h" +#include +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Construct a mesh of box (BV,BF) so that it contains the intersection of + // the half-space under the plane (P) and the bounding box of V, and does not + // contain any of the half-space above (P). + // + // Inputs: + // P plane so that normal points away from half-space + // V #V by 3 list of vertex positions + // Outputs: + // BV #BV by 3 list of box vertex positions + // BF #BF b3 list of box triangle indices into BV + template + IGL_INLINE void half_space_box( + const CGAL::Plane_3 & P, + const Eigen::MatrixBase & V, + Eigen::Matrix & BV, + Eigen::Matrix & BF); + // Inputs: + // p 3d point on plane + // n 3d vector of normal of plane pointing away from inside + // V #V by 3 list of vertex positions + // Outputs: + // BV #BV by 3 list of box vertex positions + // BF #BF b3 list of box triangle indices into BV + template + IGL_INLINE void half_space_box( + const Eigen::MatrixBase & p, + const Eigen::MatrixBase & n, + const Eigen::MatrixBase & V, + Eigen::Matrix & BV, + Eigen::Matrix & BF); + // Inputs: + // equ plane equation: a*x+b*y+c*z + d = 0 + // V #V by 3 list of vertex positions + // Outputs: + // BV #BV by 3 list of box vertex positions + // BF #BF b3 list of box triangle indices into BV + template + IGL_INLINE void half_space_box( + const Eigen::MatrixBase & equ, + const Eigen::MatrixBase & V, + Eigen::Matrix & BV, + Eigen::Matrix & BF); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "half_space_box.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/hausdorff.cpp b/vendor/libigl/include/igl/copyleft/cgal/hausdorff.cpp new file mode 100644 index 0000000000000000000000000000000000000000..270af20056467639d25ffdda7afb661bef506935 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/hausdorff.cpp @@ -0,0 +1,44 @@ +#include "hausdorff.h" +#include "../../hausdorff.h" +#include + +template < + typename DerivedV, + typename Kernel, + typename Scalar> +IGL_INLINE void igl::copyleft::cgal::hausdorff( + const Eigen::MatrixBase& V, + const CGAL::AABB_tree< + CGAL::AABB_traits >::iterator + > + > + > & treeB, + const std::vector > & /*TB*/, + Scalar & l, + Scalar & u) +{ + // Not sure why using `auto` here doesn't work with the `hausdorff` function + // parameter but explicitly naming the type does... + const std::function + dist_to_B = [&treeB]( + const double & x, const double & y, const double & z)->double + { + CGAL::Point_3 query(x,y,z); + typename CGAL::AABB_tree< + CGAL::AABB_traits >::iterator + > + > + >::Point_and_primitive_id pp = treeB.closest_point_and_primitive(query); + return std::sqrt((query-pp.first).squared_length()); + }; + return igl::hausdorff(V,dist_to_B,l,u); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::copyleft::cgal::hausdorff, CGAL::Simple_cartesian, double>(Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector >, std::allocator > > > const&, double&, double&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/hausdorff.h b/vendor/libigl/include/igl/copyleft/cgal/hausdorff.h new file mode 100644 index 0000000000000000000000000000000000000000..c377d4576c985778a81e795f809d3bdc81e5ed7a --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/hausdorff.h @@ -0,0 +1,62 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_HAUSDORFF_H +#define IGL_COPYLEFT_CGAL_HAUSDORFF_H +#include "../../igl_inline.h" + +#include +#include "CGAL_includes.hpp" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Compute lower and upper bounds (l,u) on the Hausdorff distance between a triangle + // (V) and a pointset (e.g., mesh, triangle soup) given by a distance function + // handle (dist_to_B). + // + // Inputs: + // V 3 by 3 list of corner positions so that V.row(i) is the position of the + // ith corner + // treeB CGAL's AABB tree containing triangle soup (VB,FB) + // TB list of CGAL triangles in order of FB (for determining which was found + // in computation) + // Outputs: + // l lower bound on Hausdorff distance + // u upper bound on Hausdorff distance + // + template < + typename DerivedV, + typename Kernel, + typename Scalar> + IGL_INLINE void hausdorff( + const Eigen::MatrixBase& V, + const CGAL::AABB_tree< + CGAL::AABB_traits >::iterator + > + > + > & treeB, + const std::vector > & TB, + Scalar & l, + Scalar & u); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "hausdorff.cpp" +#endif + +#endif + + diff --git a/vendor/libigl/include/igl/copyleft/cgal/incircle.cpp b/vendor/libigl/include/igl/copyleft/cgal/incircle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a0a5573b9436269c19703ce6f4f678f1ec1a1326 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/incircle.cpp @@ -0,0 +1,48 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "incircle.h" +#include +#include + +template +IGL_INLINE short igl::copyleft::cgal::incircle( + const Scalar *pa, + const Scalar *pb, + const Scalar *pc, + const Scalar *pd) +{ + typedef CGAL::Exact_predicates_exact_constructions_kernel Epeck; + typedef CGAL::Exact_predicates_inexact_constructions_kernel Epick; + typedef typename std::conditional::value, + Epeck, Epick>::type Kernel; + + switch(CGAL::side_of_oriented_circle( + typename Kernel::Point_2(pa[0], pa[1]), + typename Kernel::Point_2(pb[0], pb[1]), + typename Kernel::Point_2(pc[0], pc[1]), + typename Kernel::Point_2(pd[0], pd[1]))) { + case CGAL::ON_POSITIVE_SIDE: + return 1; + case CGAL::ON_NEGATIVE_SIDE: + return -1; + case CGAL::ON_ORIENTED_BOUNDARY: + return 0; + default: + throw "Invalid incircle result"; + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template short igl::copyleft::cgal::incircle(double const*, double const*, double const*, double const*); +#ifdef WIN32 +template short igl::copyleft::cgal::incircle(double const * const,double const * const,double const * const,double const * const); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/incircle.h b/vendor/libigl/include/igl/copyleft/cgal/incircle.h new file mode 100644 index 0000000000000000000000000000000000000000..3ee0fbcc947f5208a6999151c0ec6b9fbe33b227 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/incircle.h @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_COPYLEFT_CGAL_INCIRCLE_H +#define IGL_COPYLEFT_CGAL_INCIRCLE_H + +#include "../../igl_inline.h" + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Inputs: + // pa,pb,pc,pd 2D points. + // Output: + // 1 if pd is inside of the oriented circle formed by pa,pb,pc. + // 0 if pd is co-circular with pa,pb,pc. + // -1 if pd is outside of the oriented circle formed by pa,pb,pc. + template + IGL_INLINE short incircle( + const Scalar *pa, + const Scalar *pb, + const Scalar *pc, + const Scalar *pd); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "incircle.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/insert_into_cdt.cpp b/vendor/libigl/include/igl/copyleft/cgal/insert_into_cdt.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ea4e6de1601a77de47bebb6e450509d1fb39d84 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/insert_into_cdt.cpp @@ -0,0 +1,68 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "insert_into_cdt.h" +#include +#include +#include + +template +IGL_INLINE void igl::copyleft::cgal::insert_into_cdt( + const CGAL::Object & obj, + const CGAL::Plane_3 & P, + CGAL::Constrained_triangulation_plus_2< + CGAL::Constrained_Delaunay_triangulation_2< + Kernel, + CGAL::Triangulation_data_structure_2< + CGAL::Triangulation_vertex_base_2, + CGAL::Constrained_triangulation_face_base_2< Kernel> + >, + CGAL::Exact_intersections_tag + > + > + & cdt) +{ + typedef CGAL::Point_3 Point_3; + typedef CGAL::Segment_3 Segment_3; + typedef CGAL::Triangle_3 Triangle_3; + + if(const Segment_3 *iseg = CGAL::object_cast(&obj)) + { + // Add segment constraint + cdt.insert_constraint( P.to_2d(iseg->vertex(0)),P.to_2d(iseg->vertex(1))); + }else if(const Point_3 *ipoint = CGAL::object_cast(&obj)) + { + // Add point + cdt.insert(P.to_2d(*ipoint)); + } else if(const Triangle_3 *itri = CGAL::object_cast(&obj)) + { + // Add 3 segment constraints + cdt.insert_constraint( P.to_2d(itri->vertex(0)),P.to_2d(itri->vertex(1))); + cdt.insert_constraint( P.to_2d(itri->vertex(1)),P.to_2d(itri->vertex(2))); + cdt.insert_constraint( P.to_2d(itri->vertex(2)),P.to_2d(itri->vertex(0))); + } else if(const std::vector *polyp = + CGAL::object_cast< std::vector >(&obj)) + { + const std::vector & poly = *polyp; + const size_t m = poly.size(); + assert(m>=2); + for(size_t p = 0;p +template void igl::copyleft::cgal::insert_into_cdt(CGAL::Object const&, CGAL::Plane_3 const&, CGAL::Constrained_triangulation_plus_2 >, CGAL::Constrained_triangulation_face_base_2 > > >, CGAL::Exact_intersections_tag> >&); +template void igl::copyleft::cgal::insert_into_cdt(CGAL::Object const&, CGAL::Plane_3 const&, CGAL::Constrained_triangulation_plus_2 >, CGAL::Constrained_triangulation_face_base_2 > > >, CGAL::Exact_intersections_tag> >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/insert_into_cdt.h b/vendor/libigl/include/igl/copyleft/cgal/insert_into_cdt.h new file mode 100644 index 0000000000000000000000000000000000000000..afca0233f493ebb2c422382a07c361f0e3917c50 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/insert_into_cdt.h @@ -0,0 +1,60 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_INSERT_INTO_CDT_H +#define IGL_COPYLEFT_CGAL_INSERT_INTO_CDT_H +#include "../../igl_inline.h" + +#include // Workaround https://github.com/CGAL/cgal/issues/2182 with CGAL 4.10-1 +#include +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given a current 2D constrained Delaunay triangulation (cdt), insert a + // 3D "object" (e.g., resulting from intersecting two triangles) into the + // cdt, by projecting it via the given plane (P) and adding appropriate + // constraints. + // + // Inputs: + // obj CGAL::Object representing a vertex, segment, or (convex) + // polygon. All vertices should lie on the plane P. If not, then this + // adds the _projection_ of this object to the cdt and that might not + // be what you wanted to do. + // P plane obj lies on and upon which the cdt is being performed + // cdt current CDT, see output + // Outputs: + // cdt CDT updated to contain constraints for the given object + // + template + IGL_INLINE void insert_into_cdt( + const CGAL::Object & obj, + const CGAL::Plane_3 & P, + CGAL::Constrained_triangulation_plus_2< + CGAL::Constrained_Delaunay_triangulation_2< + Kernel, + CGAL::Triangulation_data_structure_2< + CGAL::Triangulation_vertex_base_2, + CGAL::Constrained_triangulation_face_base_2< Kernel> + >, + CGAL::Exact_intersections_tag + > + > + & cdt); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "insert_into_cdt.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/insphere.cpp b/vendor/libigl/include/igl/copyleft/cgal/insphere.cpp new file mode 100644 index 0000000000000000000000000000000000000000..db12fea33aad34f934e77fa3874b7ba5da20c1a1 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/insphere.cpp @@ -0,0 +1,41 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "insphere.h" +#include +#include + +template +IGL_INLINE short igl::copyleft::cgal::insphere( + const Scalar pa[3], + const Scalar pb[3], + const Scalar pc[3], + const Scalar pd[3], + const Scalar pe[3]) +{ + typedef CGAL::Exact_predicates_exact_constructions_kernel Epeck; + typedef CGAL::Exact_predicates_inexact_constructions_kernel Epick; + typedef typename std::conditional::value, + Epeck, Epick>::type Kernel; + + switch(CGAL::side_of_oriented_sphere( + typename Kernel::Point_3(pa[0], pa[1], pa[2]), + typename Kernel::Point_3(pb[0], pb[1], pb[2]), + typename Kernel::Point_3(pc[0], pc[1], pc[2]), + typename Kernel::Point_3(pd[0], pd[1], pd[2]), + typename Kernel::Point_3(pe[0], pe[1], pe[2]))) { + case CGAL::ON_POSITIVE_SIDE: + return 1; + case CGAL::ON_NEGATIVE_SIDE: + return -1; + case CGAL::ON_ORIENTED_BOUNDARY: + return 0; + default: + throw "Invalid incircle result"; + } +} diff --git a/vendor/libigl/include/igl/copyleft/cgal/insphere.h b/vendor/libigl/include/igl/copyleft/cgal/insphere.h new file mode 100644 index 0000000000000000000000000000000000000000..88a9266683a74d7d88cd31ee9679c990eba8c1d2 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/insphere.h @@ -0,0 +1,40 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_COPYLEFT_CGAL_INSPHERE_H +#define IGL_COPYLEFT_CGAL_INSPHERE_H + +#include "../../igl_inline.h" + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Inputs: + // pa,pb,pc,pd,pe 3D points. + // Output: + // 1 if pe is inside of the oriented sphere formed by pa,pb,pc,pd. + // 0 if pe is co-spherical with pa,pb,pc,pd. + // -1 if pe is outside of the oriented sphere formed by pa,pb,pc,pd. + template + IGL_INLINE short insphere( + const Scalar pa[3], + const Scalar pb[3], + const Scalar pc[3], + const Scalar pd[3], + const Scalar pe[3]); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "insphere.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/intersect_other.cpp b/vendor/libigl/include/igl/copyleft/cgal/intersect_other.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9f984f956a1b40087be6ba79335c411f7d2c5586 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/intersect_other.cpp @@ -0,0 +1,289 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "intersect_other.h" +#include "CGAL_includes.hpp" +#include "mesh_to_cgal_triangle_list.h" +#include "remesh_intersections.h" +#include "../../slice_mask.h" +#include "../../remove_unreferenced.h" + +#ifndef IGL_FIRST_HIT_EXCEPTION +#define IGL_FIRST_HIT_EXCEPTION 10 +#endif + +// Un-exposed helper functions +namespace igl +{ + namespace copyleft + { + namespace cgal + { + template + static IGL_INLINE void push_result( + const Eigen::PlainObjectBase & F, + const int f, + const int f_other, + const CGAL::Object & result, + std::map< + typename DerivedF::Index, + std::vector > > & + offending) + //std::map< + // std::pair, + // std::vector > & edge2faces) + { + typedef typename DerivedF::Index Index; + typedef std::pair EMK; + if(offending.count(f) == 0) + { + // first time marking, initialize with new id and empty list + offending[f] = {}; + for(Index e = 0; e<3;e++) + { + // append face to edge's list + Index i = F(f,(e+1)%3) < F(f,(e+2)%3) ? F(f,(e+1)%3) : F(f,(e+2)%3); + Index j = F(f,(e+1)%3) < F(f,(e+2)%3) ? F(f,(e+2)%3) : F(f,(e+1)%3); + //edge2faces[EMK(i,j)].push_back(f); + } + } + offending[f].push_back({f_other,result}); + } + template < + typename Kernel, + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedIF, + typename DerivedVVAB, + typename DerivedFFAB, + typename DerivedJAB, + typename DerivedIMAB> + static IGL_INLINE bool intersect_other_helper( + const Eigen::PlainObjectBase & VA, + const Eigen::PlainObjectBase & FA, + const Eigen::PlainObjectBase & VB, + const Eigen::PlainObjectBase & FB, + const RemeshSelfIntersectionsParam & params, + Eigen::PlainObjectBase & IF, + Eigen::PlainObjectBase & VVAB, + Eigen::PlainObjectBase & FFAB, + Eigen::PlainObjectBase & JAB, + Eigen::PlainObjectBase & IMAB) + { + + using namespace std; + using namespace Eigen; + + typedef typename DerivedFA::Index Index; + // 3D Primitives + typedef CGAL::Point_3 Point_3; + typedef CGAL::Segment_3 Segment_3; + typedef CGAL::Triangle_3 Triangle_3; + typedef CGAL::Plane_3 Plane_3; + typedef CGAL::Tetrahedron_3 Tetrahedron_3; + // 2D Primitives + typedef CGAL::Point_2 Point_2; + typedef CGAL::Segment_2 Segment_2; + typedef CGAL::Triangle_2 Triangle_2; + // 2D Constrained Delaunay Triangulation types + typedef CGAL::Triangulation_vertex_base_2 TVB_2; + typedef CGAL::Constrained_triangulation_face_base_2 CTAB_2; + typedef CGAL::Triangulation_data_structure_2 TDS_2; + typedef CGAL::Exact_intersections_tag Itag; + // Axis-align boxes for all-pairs self-intersection detection + typedef std::vector Triangles; + typedef typename Triangles::iterator TrianglesIterator; + typedef typename Triangles::const_iterator TrianglesConstIterator; + typedef + CGAL::Box_intersection_d::Box_with_handle_d + Box; + typedef + std::map > > + OffendingMap; + typedef std::map,std::vector > EdgeMap; + typedef std::pair EMK; + + Triangles TA,TB; + // Compute and process self intersections + mesh_to_cgal_triangle_list(VA,FA,TA); + mesh_to_cgal_triangle_list(VB,FB,TB); + // http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Box_intersection_d/Chapter_main.html#Section_63.5 + // Create the corresponding vector of bounding boxes + std::vector A_boxes,B_boxes; + const auto box_up = [](Triangles & T, std::vector & boxes) -> void + { + boxes.reserve(T.size()); + for ( + TrianglesIterator tit = T.begin(); + tit != T.end(); + ++tit) + { + boxes.push_back(Box(tit->bbox(), tit)); + } + }; + box_up(TA,A_boxes); + box_up(TB,B_boxes); + OffendingMap offendingA,offendingB; + //EdgeMap edge2facesA,edge2facesB; + + std::list lIF; + const auto cb = [&](const Box &a, const Box &b) -> void + { + using namespace std; + // index in F and T + int fa = a.handle()-TA.begin(); + int fb = b.handle()-TB.begin(); + const Triangle_3 & A = *a.handle(); + const Triangle_3 & B = *b.handle(); + if(CGAL::do_intersect(A,B)) + { + // There was an intersection + lIF.push_back(fa); + lIF.push_back(fb); + if(params.first_only) + { + throw IGL_FIRST_HIT_EXCEPTION; + } + if(!params.detect_only) + { + CGAL::Object result = CGAL::intersection(A,B); + + push_result(FA,fa,fb,result,offendingA); + push_result(FB,fb,fa,result,offendingB); + } + } + }; + try{ + CGAL::box_intersection_d( + A_boxes.begin(), A_boxes.end(), + B_boxes.begin(), B_boxes.end(), + cb); + }catch(int e) + { + // Rethrow if not FIRST_HIT_EXCEPTION + if(e != IGL_FIRST_HIT_EXCEPTION) + { + throw e; + } + // Otherwise just fall through + } + + // Convert lIF to Eigen matrix + assert(lIF.size()%2 == 0); + IF.resize(lIF.size()/2,2); + { + int i=0; + for( + list::const_iterator ifit = lIF.begin(); + ifit!=lIF.end(); + ) + { + IF(i,0) = (*ifit); + ifit++; + IF(i,1) = (*ifit); + ifit++; + i++; + } + } + if(!params.detect_only) + { + // Obsolete, now remesh_intersections expects a single mesh + // remesh_intersections(VA,FA,TA,offendingA,VVA,FFA,JA,IMA); + // remesh_intersections(VB,FB,TB,offendingB,VVB,FFB,JB,IMB); + // Combine mesh and offending maps + DerivedVA VAB(VA.rows()+VB.rows(),3); + VAB< 0; + } + } + } +} + +template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedIF, + typename DerivedVVAB, + typename DerivedFFAB, + typename DerivedJAB, + typename DerivedIMAB> +IGL_INLINE bool igl::copyleft::cgal::intersect_other( + const Eigen::PlainObjectBase & VA, + const Eigen::PlainObjectBase & FA, + const Eigen::PlainObjectBase & VB, + const Eigen::PlainObjectBase & FB, + const RemeshSelfIntersectionsParam & params, + Eigen::PlainObjectBase & IF, + Eigen::PlainObjectBase & VVAB, + Eigen::PlainObjectBase & FFAB, + Eigen::PlainObjectBase & JAB, + Eigen::PlainObjectBase & IMAB) +{ + if(params.detect_only) + { + return intersect_other_helper + (VA,FA,VB,FB,params,IF,VVAB,FFAB,JAB,IMAB); + }else + { + return intersect_other_helper + (VA,FA,VB,FB,params,IF,VVAB,FFAB,JAB,IMAB); + } +} + +IGL_INLINE bool igl::copyleft::cgal::intersect_other( + const Eigen::MatrixXd & VA, + const Eigen::MatrixXi & FA, + const Eigen::MatrixXd & VB, + const Eigen::MatrixXi & FB, + const bool first_only, + Eigen::MatrixXi & IF) +{ + Eigen::MatrixXd VVAB; + Eigen::MatrixXi FFAB; + Eigen::VectorXi JAB,IMAB; + return intersect_other( + VA,FA,VB,FB,{true,first_only},IF,VVAB,FFAB,JAB,IMAB); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::intersect_other, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::intersect_other, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/intersect_other.h b/vendor/libigl/include/igl/copyleft/cgal/intersect_other.h new file mode 100644 index 0000000000000000000000000000000000000000..c1afdf87dbcae960e6bae58500ca978e24803844 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/intersect_other.h @@ -0,0 +1,91 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_INTERSECT_OTHER_H +#define IGL_COPYLEFT_CGAL_INTERSECT_OTHER_H +#include "../../igl_inline.h" +#include "RemeshSelfIntersectionsParam.h" + +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // INTERSECT_OTHER Given a triangle mesh (VA,FA) and another mesh (VB,FB) + // find all pairs of intersecting faces. Note that self-intersections are + // ignored. + // + // Inputs: + // VA #V by 3 list of vertex positions + // FA #F by 3 list of triangle indices into VA + // VB #V by 3 list of vertex positions + // FB #F by 3 list of triangle indices into VB + // params whether to detect only and then whether to only find first + // intersection + // Outputs: + // IF #intersecting face pairs by 2 list of intersecting face pairs, + // indexing FA and FB + // VVAB #VVAB by 3 list of vertex positions + // FFAB #FFAB by 3 list of triangle indices into VVA + // JAB #FFAB list of indices into [FA;FB] denoting birth triangle + // IMAB #VVAB list of indices stitching duplicates (resulting from + // mesh intersections) together + template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedIF, + typename DerivedVVAB, + typename DerivedFFAB, + typename DerivedJAB, + typename DerivedIMAB> + IGL_INLINE bool intersect_other( + const Eigen::PlainObjectBase & VA, + const Eigen::PlainObjectBase & FA, + const Eigen::PlainObjectBase & VB, + const Eigen::PlainObjectBase & FB, + const RemeshSelfIntersectionsParam & params, + Eigen::PlainObjectBase & IF, + Eigen::PlainObjectBase & VVAB, + Eigen::PlainObjectBase & FFAB, + Eigen::PlainObjectBase & JAB, + Eigen::PlainObjectBase & IMAB); + // Legacy wrapper for detect only using common types. + // + // Inputs: + // VA #V by 3 list of vertex positions + // FA #F by 3 list of triangle indices into VA + // VB #V by 3 list of vertex positions + // FB #F by 3 list of triangle indices into VB + // first_only whether to only detect the first intersection. + // Outputs: + // IF #intersecting face pairs by 2 list of intersecting face pairs, + // indexing FA and FB + // Returns true if any intersections were found + // + // See also: remesh_self_intersections + IGL_INLINE bool intersect_other( + const Eigen::MatrixXd & VA, + const Eigen::MatrixXi & FA, + const Eigen::MatrixXd & VB, + const Eigen::MatrixXi & FB, + const bool first_only, + Eigen::MatrixXi & IF); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "intersect_other.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/intersect_with_half_space.cpp b/vendor/libigl/include/igl/copyleft/cgal/intersect_with_half_space.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c4ba4dbb8fc7d3c2d5e7814f961f1eba5dd97201 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/intersect_with_half_space.cpp @@ -0,0 +1,88 @@ +#include "intersect_with_half_space.h" +#include "mesh_boolean.h" +#include "half_space_box.h" + +template < + typename DerivedV, + typename DerivedF, + typename Derivedp, + typename Derivedn, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::intersect_with_half_space( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & p, + const Eigen::MatrixBase & n, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ + typedef CGAL::Plane_3 Plane; + typedef CGAL::Point_3 Point; + typedef CGAL::Vector_3 Vector; + Plane P(Point(p(0),p(1),p(2)),Vector(n(0),n(1),n(2))); + return intersect_with_half_space(V,F,P,VC,FC,J); +} + +template < + typename DerivedV, + typename DerivedF, + typename Derivedequ, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::intersect_with_half_space( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & equ, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ + typedef CGAL::Plane_3 Plane; + Plane P(equ(0),equ(1),equ(2),equ(3)); + return intersect_with_half_space(V,F,P,VC,FC,J); +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::intersect_with_half_space( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const CGAL::Plane_3 & P, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ + Eigen::Matrix BV; + Eigen::Matrix BF; + half_space_box(P,V,BV,BF); + // Disturbingly, (BV,BF) must be first argument + const bool ret = mesh_boolean(BV,BF,V,F,MESH_BOOLEAN_TYPE_INTERSECT,VC,FC,J); + // But now J is wrong... + std::for_each( + J.data(), + J.data()+J.size(), + [&BF,&F](typename DerivedJ::Scalar & j) + {j = (j, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::intersect_with_half_space, Eigen::Matrix, Eigen::Matrix, Eigen::CwiseUnaryOp, Eigen::Matrix const>, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, Eigen::Matrix const> > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::intersect_with_half_space, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::intersect_with_half_space, Eigen::Matrix, Eigen::Matrix, Eigen::CwiseUnaryOp, Eigen::Matrix const>, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, Eigen::Matrix const> > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/intersect_with_half_space.h b/vendor/libigl/include/igl/copyleft/cgal/intersect_with_half_space.h new file mode 100644 index 0000000000000000000000000000000000000000..9fdf9ae2bd9e6e896a68cdc6d06185337f1e5a22 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/intersect_with_half_space.h @@ -0,0 +1,96 @@ +#ifndef IGL_COPYLEFT_CGAL_INTERSECT_WITH_HALF_SPACE_H +#define IGL_COPYLEFT_CGAL_INTERSECT_WITH_HALF_SPACE_H +#include "../../igl_inline.h" +#include +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Intersect a PWN mesh with a half-space. Point on plane, normal pointing + // outward. + // + // Inputs: + // V #V by 3 list of mesh vertex positions + // p 3d point on plane + // n 3d vector of normal of plane pointing away from inside + // Outputs: + // VC #VC by 3 list of vertex positions of boolean result mesh + // FC #FC by 3 list of triangle indices into VC + // J #FC list of indices into [F;F.rows()+[1;2]] revealing "birth" + // facet + template < + typename DerivedV, + typename DerivedF, + typename Derivedp, + typename Derivedn, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool intersect_with_half_space( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & p, + const Eigen::MatrixBase & n, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + // Intersect a PWN mesh with a half-space. Plane equation. + // + // Inputs: + // V #V by 3 list of mesh vertex positions + // equ plane equation: P(x,y,z) = a*x+b*y+c*z + d = 0, P(x,y,z) < 0 is + // _inside_. + // Outputs: + // VC #VC by 3 list of vertex positions of boolean result mesh + // FC #FC by 3 list of triangle indices into VC + // J #FC list of indices into [F;F.rows()+[1;2]] revealing "birth" facet + template < + typename DerivedV, + typename DerivedF, + typename Derivedequ, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool intersect_with_half_space( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & equ, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + // Intersect a PWN mesh with a half-space. CGAL Plane. + // + // Inputs: + // V #V by 3 list of mesh vertex positions + // P plane + // Outputs: + // VC #VC by 3 list of vertex positions of boolean result mesh + // FC #FC by 3 list of triangle indices into VC + // J #FC list of indices into [F;F.rows()+[1;2]] revealing "birth" facet + template < + typename DerivedV, + typename DerivedF, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool intersect_with_half_space( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const CGAL::Plane_3 & P, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "intersect_with_half_space.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/lexicographic_triangulation.cpp b/vendor/libigl/include/igl/copyleft/cgal/lexicographic_triangulation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..719b50dbfa97dbbe1e72acfcb547ebaa8c6d125b --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/lexicographic_triangulation.cpp @@ -0,0 +1,24 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "lexicographic_triangulation.h" +#include "../../lexicographic_triangulation.h" +#include "orient2D.h" + +template< + typename DerivedP, + typename DerivedF + > +IGL_INLINE void igl::copyleft::cgal::lexicographic_triangulation( + const Eigen::PlainObjectBase& P, + Eigen::PlainObjectBase& F) +{ + typedef typename DerivedP::Scalar Scalar; + igl::lexicographic_triangulation(P, orient2D, F); +} diff --git a/vendor/libigl/include/igl/copyleft/cgal/lexicographic_triangulation.h b/vendor/libigl/include/igl/copyleft/cgal/lexicographic_triangulation.h new file mode 100644 index 0000000000000000000000000000000000000000..5773a39424070aa34fb9e4745e5c0890cf722f07 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/lexicographic_triangulation.h @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_COPYLEFT_CGAL_LEXICOGRAPHIC_TRIANGULATION_H +#define IGL_COPYLEFT_CGAL_LEXICOGRAPHIC_TRIANGULATION_H +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + + // Given a set of points in 2D, return a lexicographic triangulation of these + // points. + // + // Inputs: + // P #P by 2 list of vertex positions + // + // Outputs: + // F #F by 3 of faces in lexicographic triangulation. + template< + typename DerivedP, + typename DerivedF + > + IGL_INLINE void lexicographic_triangulation( + const Eigen::PlainObjectBase& P, + Eigen::PlainObjectBase& F); + } + } +} + + + + +#ifndef IGL_STATIC_LIBRARY +# include "lexicographic_triangulation.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/list_to_matrix.cpp b/vendor/libigl/include/igl/copyleft/cgal/list_to_matrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e94dde6b82472a65afbf261824710f46b591ebde --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/list_to_matrix.cpp @@ -0,0 +1,15 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "../../list_to_matrix.h" +#include +#include +#ifdef IGL_STATIC_LIBRARY +#undef IGL_STATIC_LIBRARY +#include "../../list_to_matrix.cpp" +template bool igl::list_to_matrix, Eigen::Matrix, -1, 3, 0, -1, 3> >(std::vector, std::allocator > >, std::allocator, std::allocator > > > > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean.cpp b/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4997c3573316c9e09e4b12b09ad17d9b501e66c4 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean.cpp @@ -0,0 +1,468 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#include "mesh_boolean.h" +#include "assign.h" +#include "extract_cells.h" +#include "mesh_boolean_type_to_funcs.h" +#include "propagate_winding_numbers.h" +#include "relabel_small_immersed_cells.h" +#include "remesh_self_intersections.h" +#include "string_to_mesh_boolean_type.h" +#include "../../combine.h" +#include "../../cumsum.h" +#include "../../extract_manifold_patches.h" +#include "../../get_seconds.h" +#include "../../remove_unreferenced.h" +#include "../../resolve_duplicated_faces.h" +#include "../../slice.h" +#include "../../unique_edge_map.h" +#include "../../unique_simplices.h" + +#include +#include + +//#define MESH_BOOLEAN_TIMING +//#define DOUBLE_CHECK_EXACT_OUTPUT +//#define SMALL_CELL_REMOVAL + +template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::mesh_boolean( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const MeshBooleanType & type, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ + std::function keep; + std::function) > wind_num_op; + mesh_boolean_type_to_funcs(type,wind_num_op,keep); + return mesh_boolean(VA,FA,VB,FB,wind_num_op,keep,VC,FC,J); +} +template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::mesh_boolean( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const std::string & type_str, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ + return mesh_boolean( + VA,FA,VB,FB,string_to_mesh_boolean_type(type_str),VC,FC,J); +} + +template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::mesh_boolean( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const std::function) >& wind_num_op, + const std::function & keep, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ + // Generate combined mesh (VA,FA,VB,FB) -> (V,F) + Eigen::Matrix sizes(FA.rows(),FB.rows()); + // TODO: This is a precision template **bug** that results in failure to + // compile. If DerivedVA::Scalar is double and DerivedVB::Scalar is + // CGAL::Epeck::FT then the following assignment will not compile. This + // implies that VA must have the trumping precision (and a valid assignment + // operator from VB's type). + Eigen::Matrix VV(VA.rows() + VB.rows(), 3); + DerivedFC FF(FA.rows() + FB.rows(), 3); + // Can't use comma initializer + for(int a = 0;a 0) + { + FF.block(FA.rows(), 0, FB.rows(), 3) = FB.array() + VA.rows(); + } + return mesh_boolean(VV,FF,sizes,wind_num_op,keep,VC,FC,J); +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::mesh_boolean( + const std::vector & Vlist, + const std::vector & Flist, + const std::function) >& wind_num_op, + const std::function & keep, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ + DerivedV VV; + DerivedF FF; + Eigen::Matrix Vsizes,Fsizes; + igl::combine(Vlist,Flist,VV,FF,Vsizes,Fsizes); + return mesh_boolean(VV,FF,Fsizes,wind_num_op,keep,VC,FC,J); +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::mesh_boolean( + const std::vector & Vlist, + const std::vector & Flist, + const MeshBooleanType & type, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ + DerivedV VV; + DerivedF FF; + Eigen::Matrix Vsizes,Fsizes; + igl::combine(Vlist,Flist,VV,FF,Vsizes,Fsizes); + std::function keep; + std::function) > wind_num_op; + mesh_boolean_type_to_funcs(type,wind_num_op,keep); + return mesh_boolean(VV,FF,Fsizes,wind_num_op,keep,VC,FC,J); +} + +template < + typename DerivedVV, + typename DerivedFF, + typename Derivedsizes, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> +IGL_INLINE bool igl::copyleft::cgal::mesh_boolean( + const Eigen::MatrixBase & VV, + const Eigen::MatrixBase & FF, + const Eigen::MatrixBase & sizes, + const std::function) >& wind_num_op, + const std::function & keep, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J) +{ +#ifdef MESH_BOOLEAN_TIMING + const auto & tictoc = []() -> double + { + static double t_start = igl::get_seconds(); + double diff = igl::get_seconds()-t_start; + t_start += diff; + return diff; + }; + const auto log_time = [&](const std::string& label) -> void { + std::cout << "mesh_boolean." << label << ": " + << tictoc() << std::endl; + }; + tictoc(); +#endif + typedef typename DerivedVC::Scalar Scalar; + typedef CGAL::Epeck Kernel; + typedef Kernel::FT ExactScalar; + typedef Eigen::Matrix MatrixX3S; + typedef Eigen::Matrix VectorXJ; + typedef Eigen::Matrix< + ExactScalar, + Eigen::Dynamic, + Eigen::Dynamic, + DerivedVC::IsRowMajor> MatrixXES; + MatrixXES V; + DerivedFC F; + VectorXJ CJ; + { + Eigen::VectorXi I; + igl::copyleft::cgal::RemeshSelfIntersectionsParam params; + params.stitch_all = true; + MatrixXES Vr; + DerivedFC Fr; + Eigen::MatrixXi IF; + igl::copyleft::cgal::remesh_self_intersections( + VV, FF, params, Vr, Fr, IF, CJ, I); + assert(I.size() == Vr.rows()); + // Merge coinciding vertices into non-manifold vertices. + std::for_each(Fr.data(), Fr.data()+Fr.size(), + [&I](typename DerivedFC::Scalar& a) { a=I[a]; }); + // Remove unreferenced vertices. + Eigen::VectorXi UIM; + igl::remove_unreferenced(Vr, Fr, V, F, UIM); + } +#ifdef MESH_BOOLEAN_TIMING + log_time("resolve_self_intersection"); +#endif + + // Compute edges of (F) --> (E,uE,EMAP,uE2E) + Eigen::MatrixXi E, uE; + Eigen::VectorXi EMAP; + std::vector > uE2E; + igl::unique_edge_map(F, E, uE, EMAP, uE2E); + + // Compute patches (F,EMAP,uE2E) --> (P) + Eigen::VectorXi P; + const size_t num_patches = igl::extract_manifold_patches(F, EMAP, uE2E, P); +#ifdef MESH_BOOLEAN_TIMING + log_time("patch_extraction"); +#endif + + // Compute cells (V,F,P,E,uE,EMAP) -> (per_patch_cells) + Eigen::MatrixXi per_patch_cells; + const size_t num_cells = + igl::copyleft::cgal::extract_cells( + V, F, P, E, uE, uE2E, EMAP, per_patch_cells); +#ifdef MESH_BOOLEAN_TIMING + log_time("cell_extraction"); +#endif + + // Compute winding numbers on each side of each facet. + const size_t num_faces = F.rows(); + // W(f,:) --> [w1out,w1in,w2out,w2in, ... wnout,wnint] winding numbers above + // and below each face w.r.t. each input mesh, so that W(f,2*i) is the + // winding number above face f w.r.t. input i, and W(f,2*i+1) is the winding + // number below face f w.r.t. input i. + Eigen::MatrixXi W; + // labels(f) = i means that face f comes from mesh i + Eigen::VectorXi labels(num_faces); + // cumulative sizes + Derivedsizes cumsizes; + igl::cumsum(sizes,1,cumsizes); + const size_t num_inputs = sizes.size(); + std::transform( + CJ.data(), + CJ.data()+CJ.size(), + labels.data(), + // Determine which input mesh birth face i comes from + [&num_inputs,&cumsizes](int i)->int + { + for(int k = 0;k 0) + { + valid = valid & + igl::copyleft::cgal::propagate_winding_numbers( + V, F, uE, uE2E, num_patches, P, num_cells, per_patch_cells, labels, W); + } else + { + W.resize(0, 2*num_inputs); + } + assert((size_t)W.rows() == num_faces); + // If W doesn't have enough columns, pad with zeros + if (W.cols() <= 2*num_inputs) + { + const int old_ncols = W.cols(); + W.conservativeResize(num_faces,2*num_inputs); + W.rightCols(2*num_inputs-old_ncols).setConstant(0); + } + assert((size_t)W.cols() == 2*num_inputs); +#ifdef MESH_BOOLEAN_TIMING + log_time("propagate_input_winding_number"); +#endif + + // Compute resulting winding number. + Eigen::MatrixXi Wr(num_faces, 2); + for (size_t i=0; i int + { + return (i+1)*(ori?1:-1); + }; + //auto signed_index_to_index = [&](int i) -> size_t { + // return abs(i) - 1; + //}; + std::vector selected; + for(size_t i=0; i 0) + { + selected.push_back(index_to_signed_index(i, true)); + } else if (should_keep < 0) + { + selected.push_back(index_to_signed_index(i, false)); + } + } + + const size_t num_selected = selected.size(); + DerivedFC kept_faces(num_selected, 3); + DerivedJ kept_face_indices(num_selected, 1); + for (size_t i=0; i 0) + { + kept_faces.row(i) = F.row(idx); + } else + { + kept_faces.row(i) = F.row(idx).reverse(); + } + kept_face_indices(i, 0) = CJ[idx]; + } +#ifdef MESH_BOOLEAN_TIMING + log_time("extract_output"); +#endif + + // Finally, remove duplicated faces and unreferenced vertices. + { + DerivedFC G; + DerivedJ JJ; + igl::resolve_duplicated_faces(kept_faces, G, JJ); + igl::slice(kept_face_indices, JJ, 1, J); + +#ifdef DOUBLE_CHECK_EXACT_OUTPUT + { + // Sanity check on exact output. + igl::copyleft::cgal::RemeshSelfIntersectionsParam params; + params.detect_only = true; + params.first_only = true; + MatrixXES dummy_VV; + DerivedFC dummy_FF, dummy_IF; + Eigen::VectorXi dummy_J, dummy_IM; + igl::copyleft::cgal::SelfIntersectMesh< + Kernel, + MatrixXES, DerivedFC, + MatrixXES, DerivedFC, + DerivedFC, + Eigen::VectorXi, + Eigen::VectorXi + > checker(V, G, params, + dummy_VV, dummy_FF, dummy_IF, dummy_J, dummy_IM); + if (checker.count != 0) + { + throw "Self-intersection not fully resolved."; + } + } +#endif + + MatrixX3S Vs; + assign(V,Vs); + Eigen::VectorXi newIM; + igl::remove_unreferenced(Vs,G,VC,FC,newIM); + } +#ifdef MESH_BOOLEAN_TIMING + log_time("clean_up"); +#endif + return valid; +} + +template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedVC, + typename DerivedFC> +IGL_INLINE bool igl::copyleft::cgal::mesh_boolean( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const MeshBooleanType & type, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC) +{ + Eigen::Matrix J; + return igl::copyleft::cgal::mesh_boolean(VA,FA,VB,FB,type,VC,FC,J); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::mesh_boolean, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::mesh_boolean, 8, 3, 0, 8, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::mesh_boolean, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::mesh_boolean, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::mesh_boolean, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::mesh_boolean, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::mesh_boolean, 8, 3, 0, 8, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, 8, 3, 0, 8, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, 8, 3, 0, 8, 3>, Eigen::Matrix, Eigen::Matrix, -1, 4, 0, -1, 4>, Eigen::Matrix, Eigen::Matrix, -1, 4, 0, -1, 4>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, -1, 4, 0, -1, 4> > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase, -1, 4, 0, -1, 4> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, 8, 3, 0, 8, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(std::vector, std::allocator > > const&, std::vector, std::allocator > > const&, std::function)> const&, std::function const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::mesh_boolean, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(std::vector, std::allocator > > const&, std::vector, std::allocator > > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template bool igl::copyleft::cgal::mesh_boolean, -1, 3, 0, -1, 3>, class Eigen::Matrix, class Eigen::Matrix, -1, 3, 0, -1, 3>, class Eigen::Matrix, class Eigen::Matrix, -1, 3, 0, -1, 3>, class Eigen::Matrix, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase> const &, class Eigen::MatrixBase, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase> const &, enum igl::MeshBooleanType const &, class Eigen::PlainObjectBase, -1, 3, 0, -1, 3>> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean.h b/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean.h new file mode 100644 index 0000000000000000000000000000000000000000..24c99ed41af7d5178be363acec0bdb36efd1b4ed --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean.h @@ -0,0 +1,229 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLEFT_CGAL_MESH_BOOLEAN_H +#define IGL_COPYLEFT_CGAL_MESH_BOOLEAN_H + +#include "../../igl_inline.h" +#include "../../MeshBooleanType.h" +#include +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // MESH_BOOLEAN Compute boolean csg operations on "solid", consistently + // oriented meshes. + // + // Inputs: + // VA #VA by 3 list of vertex positions of first mesh + // FA #FA by 3 list of triangle indices into VA + // VB #VB by 3 list of vertex positions of second mesh + // FB #FB by 3 list of triangle indices into VB + // type type of boolean operation + // Outputs: + // VC #VC by 3 list of vertex positions of boolean result mesh + // FC #FC by 3 list of triangle indices into VC + // J #FC list of indices into [FA;FA.rows()+FB] revealing "birth" facet + // Returns true if inputs induce a piecewise constant winding number + // field and type is valid + // + // See also: mesh_boolean_cork, intersect_other, + // remesh_self_intersections + template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool mesh_boolean( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const MeshBooleanType & type, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool mesh_boolean( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const std::string & type_str, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + // + // Inputs: + // VA #VA by 3 list of vertex positions of first mesh + // FA #FA by 3 list of triangle indices into VA + // VB #VB by 3 list of vertex positions of second mesh + // FB #FB by 3 list of triangle indices into VB + // wind_num_op function handle for filtering winding numbers from + // tuples of integer values to [0,1] outside/inside values + // keep function handle for determining if a patch should be "kept" + // in the output based on the winding number on either side + // Outputs: + // VC #VC by 3 list of vertex positions of boolean result mesh + // FC #FC by 3 list of triangle indices into VC + // J #FC list of indices into [FA;FB] revealing "birth" facet + // Returns true iff inputs induce a piecewise constant winding number + // field + // + // See also: mesh_boolean_cork, intersect_other, + // remesh_self_intersections + template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool mesh_boolean( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const std::function) >& wind_num_op, + const std::function & keep, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + // MESH_BOOLEAN Variadic boolean operations + // + // Inputs: + // Vlist k-long list of lists of mesh vertex positions + // Flist k-long list of lists of mesh face indices, so that Flist[i] indexes + // vertices in Vlist[i] + // wind_num_op function handle for filtering winding numbers from + // n-tuples of integer values to [0,1] outside/inside values + // keep function handle for determining if a patch should be "kept" + // in the output based on the winding number on either side + // Outputs: + // VC #VC by 3 list of vertex positions of boolean result mesh + // FC #FC by 3 list of triangle indices into VC + // J #FC list of indices into [Flist[0];Flist[1];...;Flist[k]] + // revealing "birth" facet + // Returns true iff inputs induce a piecewise constant winding number + // field + // + // See also: mesh_boolean_cork, intersect_other, + // remesh_self_intersections + template < + typename DerivedV, + typename DerivedF, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool mesh_boolean( + const std::vector & Vlist, + const std::vector & Flist, + const std::function) >& wind_num_op, + const std::function & keep, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + template < + typename DerivedV, + typename DerivedF, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool mesh_boolean( + const std::vector & Vlist, + const std::vector & Flist, + const MeshBooleanType & type, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + // Given a merged mesh (V,F) and list of sizes of inputs + // + // Inputs: + // V #V by 3 list of merged mesh vertex positions + // F #F by 3 list of merged mesh face indices so that first sizes(0) + // faces come from the first input, and the next sizes(1) faces come + // from the second input, and so on. + // sizes #inputs list of sizes so that sizes(i) is the #faces in the + // ith input + // wind_num_op function handle for filtering winding numbers from + // tuples of integer values to [0,1] outside/inside values + // keep function handle for determining if a patch should be "kept" + // in the output based on the winding number on either side + // Outputs: + // VC #VC by 3 list of vertex positions of boolean result mesh + // FC #FC by 3 list of triangle indices into VC + // J #FC list of birth parent indices + // + template < + typename DerivedVV, + typename DerivedFF, + typename Derivedsizes, + typename DerivedVC, + typename DerivedFC, + typename DerivedJ> + IGL_INLINE bool mesh_boolean( + const Eigen::MatrixBase & VV, + const Eigen::MatrixBase & FF, + const Eigen::MatrixBase & sizes, + const std::function) >& wind_num_op, + const std::function & keep, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC, + Eigen::PlainObjectBase & J); + // Inputs: + // VA #VA by 3 list of vertex positions of first mesh + // FA #FA by 3 list of triangle indices into VA + // VB #VB by 3 list of vertex positions of second mesh + // FB #FB by 3 list of triangle indices into VB + // type type of boolean operation + // Outputs: + // VC #VC by 3 list of vertex positions of boolean result mesh + // FC #FC by 3 list of triangle indices into VC + // Returns true ff inputs induce a piecewise constant winding number + // field and type is valid + template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedVC, + typename DerivedFC> + IGL_INLINE bool mesh_boolean( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const MeshBooleanType & type, + Eigen::PlainObjectBase & VC, + Eigen::PlainObjectBase & FC); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "mesh_boolean.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean_type_to_funcs.cpp b/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean_type_to_funcs.cpp new file mode 100644 index 0000000000000000000000000000000000000000..41b67c1b763a12942cc733070117dd7bc7529527 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean_type_to_funcs.cpp @@ -0,0 +1,39 @@ +#include "mesh_boolean_type_to_funcs.h" +#include "BinaryWindingNumberOperations.h" + +IGL_INLINE void igl::copyleft::cgal::mesh_boolean_type_to_funcs( + const MeshBooleanType & type, + std::function) >& wind_num_op, + std::function & keep) +{ + switch (type) + { + case MESH_BOOLEAN_TYPE_UNION: + wind_num_op = BinaryUnion(); + keep = KeepInside(); + return; + case MESH_BOOLEAN_TYPE_INTERSECT: + wind_num_op = BinaryIntersect(); + keep = KeepInside(); + return; + case MESH_BOOLEAN_TYPE_MINUS: + wind_num_op = BinaryMinus(); + keep = KeepInside(); + return; + case MESH_BOOLEAN_TYPE_XOR: + wind_num_op = BinaryXor(); + keep = KeepInside(); + return; + case MESH_BOOLEAN_TYPE_RESOLVE: + wind_num_op = BinaryResolve(); + keep = KeepAll(); + return; + default: + assert(false && "Unsupported boolean type."); + return; + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean_type_to_funcs.h b/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean_type_to_funcs.h new file mode 100644 index 0000000000000000000000000000000000000000..2a269d7708a9e18a575fe5a444d84462163527aa --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/mesh_boolean_type_to_funcs.h @@ -0,0 +1,37 @@ +#ifndef IGL_COPYLEFT_CGAL_MESH_BOOLEAN_TYPE_TO_FUNCS_H +#define IGL_COPYLEFT_CGAL_MESH_BOOLEAN_TYPE_TO_FUNCS_H + +#include "../../igl_inline.h" +#include "../../MeshBooleanType.h" +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Convert a MeshBooleanType enum to a pair of winding number conversion + // function and "keep" function used by mesh_boolean + // + // Inputs: + // type MeshBooleanType enum value + // Outputs: + // wind_num_op function handle for filtering winding numbers from + // tuples of integer values to [0,1] outside/inside values + // keep function handle for determining if a patch should be "kept" + // in the output based on the winding number on either side + // + // See also: string_to_mesh_boolean_type + IGL_INLINE void mesh_boolean_type_to_funcs( + const MeshBooleanType & type, + std::function) >& + wind_num_op, + std::function & keep); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "mesh_boolean_type_to_funcs.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/mesh_to_cgal_triangle_list.cpp b/vendor/libigl/include/igl/copyleft/cgal/mesh_to_cgal_triangle_list.cpp new file mode 100644 index 0000000000000000000000000000000000000000..131837939804dabc76f8f23c543ecb0b7c37db20 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/mesh_to_cgal_triangle_list.cpp @@ -0,0 +1,83 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mesh_to_cgal_triangle_list.h" +#include "assign.h" + +#include + +template < + typename DerivedV, + typename DerivedF, + typename Kernel> +IGL_INLINE void igl::copyleft::cgal::mesh_to_cgal_triangle_list( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + std::vector > & T) +{ + typedef CGAL::Point_3 Point_3; + typedef CGAL::Triangle_3 Triangle_3; + // Must be 3D + assert(V.cols() == 3); + // **Copy** to convert to output type (this is especially/only needed if the + // input type DerivedV::Scalar is CGAL::Epeck + Eigen::Matrix< + typename Kernel::FT, + DerivedV::RowsAtCompileTime, + DerivedV::ColsAtCompileTime> + KV(V.rows(),V.cols()); + assign(V,KV); + // Must be triangles + assert(F.cols() == 3); + T.reserve(F.rows()); + // Loop over faces + for(int f = 0;f<(int)F.rows();f++) + { + T.push_back( + Triangle_3( + Point_3( KV(F(f,0),0), KV(F(f,0),1), KV(F(f,0),2)), + Point_3( KV(F(f,1),0), KV(F(f,1),1), KV(F(f,1),2)), + Point_3( KV(F(f,2),0), KV(F(f,2),1), KV(F(f,2),2)))); + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Simple_cartesian >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector >, std::allocator > > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, -1, -1, 1, -1, -1>, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, -1, -1, 1, -1, -1>, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, 8, 3, 0, 8, 3>, Eigen::Matrix, CGAL::Epick>(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, 8, 3, 0, 8, 3>, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > >&); +template void igl::copyleft::cgal::mesh_to_cgal_triangle_list, Eigen::Matrix, CGAL::Simple_cartesian >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector >, std::allocator > > >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/mesh_to_cgal_triangle_list.h b/vendor/libigl/include/igl/copyleft/cgal/mesh_to_cgal_triangle_list.h new file mode 100644 index 0000000000000000000000000000000000000000..492215bd50dfb7febed8bc034b34c146b9bc1d83 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/mesh_to_cgal_triangle_list.h @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_MESH_TO_CGAL_TRIANGLE_LIST_H +#define IGL_COPYLEFT_CGAL_MESH_TO_CGAL_TRIANGLE_LIST_H +#include "../../igl_inline.h" +#include +#include "CGAL_includes.hpp" +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Convert a mesh (V,F) to a list of CGAL triangles + // + // Templates: + // Kernal CGAL computation and construction kernel (e.g. + // CGAL::Exact_predicates_exact_constructions_kernel) + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices + // Outputs: + // T #F list of CGAL triangles + template < + typename DerivedV, + typename DerivedF, + typename Kernel> + IGL_INLINE void mesh_to_cgal_triangle_list( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + std::vector > & T); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "mesh_to_cgal_triangle_list.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/mesh_to_polyhedron.cpp b/vendor/libigl/include/igl/copyleft/cgal/mesh_to_polyhedron.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cf459795ff153133bd2280eb7ff521cce2f74430 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/mesh_to_polyhedron.cpp @@ -0,0 +1,57 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mesh_to_polyhedron.h" +#include +#include + +template < + typename DerivedV, + typename DerivedF, + typename Polyhedron> +IGL_INLINE bool igl::copyleft::cgal::mesh_to_polyhedron( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + Polyhedron& poly) +{ + typedef typename Polyhedron::HalfedgeDS HalfedgeDS; + // Postcondition: hds is a valid polyhedral surface. + CGAL::Polyhedron_incremental_builder_3 B(poly.hds()); + B.begin_surface(V.rows(),F.rows()); + typedef typename HalfedgeDS::Vertex Vertex; + typedef typename Vertex::Point Point; + assert(V.cols() == 3 && "V must be #V by 3"); + for(int v = 0;v +#include +#include +template bool igl::copyleft::cgal::mesh_to_polyhedron, Eigen::Matrix, CGAL::Polyhedron_3, CGAL::Polyhedron_items_with_id_3, CGAL::HalfedgeDS_default, std::allocator > >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::Polyhedron_3, CGAL::Polyhedron_items_with_id_3, CGAL::HalfedgeDS_default, std::allocator >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/mesh_to_polyhedron.h b/vendor/libigl/include/igl/copyleft/cgal/mesh_to_polyhedron.h new file mode 100644 index 0000000000000000000000000000000000000000..9ce1ed4fb5c3b6a3f350ab86459c187266c8b870 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/mesh_to_polyhedron.h @@ -0,0 +1,45 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_MESH_TO_POLYHEDRON_H +#define IGL_COPYLEFT_CGAL_MESH_TO_POLYHEDRON_H +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Convert a mesh (V,F) to a CGAL Polyhedron + // + // Templates: + // Polyhedron CGAL Polyhedron type (e.g. Polyhedron_3) + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices + // Outputs: + // poly cgal polyhedron + // Returns true only if (V,F) can be converted to a valid polyhedron (i.e. if + // (V,F) is vertex and edge manifold). + template < + typename DerivedV, + typename DerivedF, + typename Polyhedron> + IGL_INLINE bool mesh_to_polyhedron( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + Polyhedron & poly); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "mesh_to_polyhedron.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/minkowski_sum.cpp b/vendor/libigl/include/igl/copyleft/cgal/minkowski_sum.cpp new file mode 100644 index 0000000000000000000000000000000000000000..18e94b18047626fe48b39e724d73ba5ae784522e --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/minkowski_sum.cpp @@ -0,0 +1,399 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "minkowski_sum.h" +#include "mesh_boolean.h" + +#include "../../slice.h" +#include "../../slice_mask.h" +#include "../../LinSpaced.h" +#include "../../unique_rows.h" +#include "../../get_seconds.h" +#include "../../edges.h" +#include +#include +#include +#include + + +template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedW, + typename DerivedG, + typename DerivedJ> +IGL_INLINE void igl::copyleft::cgal::minkowski_sum( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const bool resolve_overlaps, + Eigen::PlainObjectBase & W, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & J) +{ + using namespace std; + using namespace Eigen; + assert(FA.cols() == 3 && "FA must contain a closed triangle mesh"); + assert(FB.cols() <= FA.cols() && + "FB must contain lower diemnsional simplices than FA"); + const auto tictoc = []()->double + { + static double t_start; + double now = igl::get_seconds(); + double interval = now-t_start; + t_start = now; + return interval; + }; + tictoc(); + Matrix EB; + edges(FB,EB); + Matrix EA(0,2); + if(FB.cols() == 3) + { + edges(FA,EA); + } + // number of copies of A along edges of B + const int n_ab = EB.rows(); + // number of copies of B along edges of A + const int n_ba = EA.rows(); + + vector vW(n_ab + n_ba); + vector vG(n_ab + n_ba); + vector vJ(n_ab + n_ba); + vector offsets(n_ab + n_ba + 1); + offsets[0] = 0; + // sweep A along edges of B + for(int e = 0;e eJ; + minkowski_sum( + VA, + FA, + VB.row(EB(e,0)).eval(), + VB.row(EB(e,1)).eval(), + false, + vW[e], + vG[e], + eJ); + assert(vG[e].rows() == eJ.rows()); + assert(eJ.cols() == 1); + vJ[e].resize(vG[e].rows(),2); + vJ[e].col(0) = eJ; + vJ[e].col(1).setConstant(e); + offsets[e+1] = offsets[e] + vW[e].rows(); + } + // sweep B along edges of A + for(int e = 0;e eJ; + const int ee = n_ab+e; + minkowski_sum( + VB, + FB, + VA.row(EA(e,0)).eval(), + VA.row(EA(e,1)).eval(), + false, + vW[ee], + vG[ee], + eJ); + vJ[ee].resize(vG[ee].rows(),2); + vJ[ee].col(0) = eJ.array() + (FA.rows()+1); + vJ[ee].col(1).setConstant(ee); + offsets[ee+1] = offsets[ee] + vW[ee].rows(); + } + // Combine meshes + int n=0,m=0; + for_each(vW.begin(),vW.end(),[&n](const DerivedW & w){n+=w.rows();}); + for_each(vG.begin(),vG.end(),[&m](const DerivedG & g){m+=g.rows();}); + assert(n == offsets.back()); + + W.resize(n,3); + G.resize(m,3); + J.resize(m,2); + { + int m_off = 0,n_off = 0; + for(int i = 0;i SJ; + mesh_boolean( + DerivedW(W), + DerivedG(G), + Matrix(), + Matrix(), + MESH_BOOLEAN_TYPE_UNION, + W, + G, + SJ); + slice(DerivedJ(J),SJ,1,J); + } +} + +template < + typename DerivedVA, + typename DerivedFA, + typename sType, int sCols, int sOptions, + typename dType, int dCols, int dOptions, + typename DerivedW, + typename DerivedG, + typename DerivedJ> +IGL_INLINE void igl::copyleft::cgal::minkowski_sum( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::Matrix & s, + const Eigen::Matrix & d, + const bool resolve_overlaps, + Eigen::PlainObjectBase & W, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & J) +{ + using namespace Eigen; + using namespace std; + assert(s.cols() == 3 && "s should be a 3d point"); + assert(d.cols() == 3 && "d should be a 3d point"); + // silly base case + if(FA.size() == 0) + { + W.resize(0,3); + G.resize(0,3); + return; + } + const int dim = VA.cols(); + assert(dim == 3 && "dim must be 3D"); + assert(s.size() == 3 && "s must be 3D point"); + assert(d.size() == 3 && "d must be 3D point"); + // segment vector + const CGAL::Vector_3 v(d(0)-s(0),d(1)-s(1),d(2)-s(2)); + // number of vertices + const int n = VA.rows(); + // duplicate vertices at s and d, we'll remove unreferernced later + W.resize(2*n,dim); + for(int i = 0;i P(m,1),N(m,1); + // loop over faces + int mp = 0,mn = 0; + for(int f = 0;f plane( + CGAL::Point_3(VA(FA(f,0),0),VA(FA(f,0),1),VA(FA(f,0),2)), + CGAL::Point_3(VA(FA(f,1),0),VA(FA(f,1),1),VA(FA(f,1),2)), + CGAL::Point_3(VA(FA(f,2),0),VA(FA(f,2),1),VA(FA(f,2),2))); + const auto normal = plane.orthogonal_vector(); + const auto dt = normal * v; + if(dt > 0) + { + P(f) = true; + N(f) = false; + mp++; + }else + //}else if(dt < 0) + { + P(f) = false; + N(f) = true; + mn++; + //}else + //{ + // P(f) = false; + // N(f) = false; + } + } + + typedef Matrix MatrixXI; + typedef Matrix VectorXI; + MatrixXI GT(mp+mn,3); + GT<< slice_mask(FA,N,1), slice_mask((FA.array()+n).eval(),P,1); + // J indexes FA for parts at s and m+FA for parts at d + J.derived() = igl::LinSpaced(m,0,m-1); + DerivedJ JT(mp+mn); + JT << slice_mask(J,P,1), slice_mask(J,N,1); + JT.block(mp,0,mn,1).array()+=m; + + // Original non-co-planar faces with positively oriented reversed + MatrixXI BA(mp+mn,3); + BA << slice_mask(FA,P,1).rowwise().reverse(), slice_mask(FA,N,1); + // Quads along **all** sides + MatrixXI GQ((mp+mn)*3,4); + GQ<< + BA.col(1), BA.col(0), BA.col(0).array()+n, BA.col(1).array()+n, + BA.col(2), BA.col(1), BA.col(1).array()+n, BA.col(2).array()+n, + BA.col(0), BA.col(2), BA.col(2).array()+n, BA.col(0).array()+n; + + MatrixXI uGQ; + VectorXI S,sI,sJ; + // Inputs: + // F #F by d list of polygons + // Outputs: + // S #uF list of signed incidences for each unique face + // uF #uF by d list of unique faces + // I #uF index vector so that uF = sort(F,2)(I,:) + // J #F index vector so that sort(F,2) = uF(J,:) + []( + const MatrixXI & F, + VectorXI & S, + MatrixXI & uF, + VectorXI & I, + VectorXI & J) + { + const int m = F.rows(); + const int d = F.cols(); + MatrixXI sF = F; + const auto MN = sF.rowwise().minCoeff().eval(); + // rotate until smallest index is first + for(int p = 0;p M = Matrix::Zero(m,1); + { + VectorXI P = igl::LinSpaced(d,0,d-1); + for(int p = 0;p SJ; + mesh_boolean( + DerivedW(W),DerivedG(G), + Matrix(),MatrixXI(), + MESH_BOOLEAN_TYPE_UNION, + W,G,SJ); + J.derived() = slice(DerivedJ(J),SJ,1); + } +} + +template < + typename DerivedVA, + typename DerivedFA, + typename sType, int sCols, int sOptions, + typename dType, int dCols, int dOptions, + typename DerivedW, + typename DerivedG, + typename DerivedJ> +IGL_INLINE void igl::copyleft::cgal::minkowski_sum( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::Matrix & s, + const Eigen::Matrix & d, + Eigen::PlainObjectBase & W, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & J) +{ + return minkowski_sum(VA,FA,s,d,true,W,G,J); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::minkowski_sum, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::minkowski_sum, Eigen::Matrix, double, 3, 1, double, 3, 1, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, Eigen::Matrix const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::minkowski_sum, -1, -1, 1, -1, -1>, Eigen::Matrix, CGAL::Lazy_exact_nt, 3, 1, CGAL::Lazy_exact_nt, 3, 1, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::Matrix, 1, 3, 1, 1, 3> const&, Eigen::Matrix, 1, 3, 1, 1, 3> const&, bool, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::minkowski_sum< + Eigen::Matrix, + Eigen::Matrix, + double, 3, 1, + float, 3, 1, + Eigen::Matrix, -1, -1, 1, -1, -1>, + Eigen::Matrix, + Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, Eigen::Matrix const&, bool, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/minkowski_sum.h b/vendor/libigl/include/igl/copyleft/cgal/minkowski_sum.h new file mode 100644 index 0000000000000000000000000000000000000000..1631f0766fbc5a69093543ffa81a08f7a61a578b --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/minkowski_sum.h @@ -0,0 +1,110 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_MINKOWSKI_SUM_H +#define IGL_COPYLEFT_CGAL_MINKOWSKI_SUM_H + +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Compute the Minkowski sum of a closed triangle mesh (V,F) and a + // set of simplices in 3D. + // + // Inputs: + // VA #VA by 3 list of mesh vertices in 3D + // FA #FA by 3 list of triangle indices into VA + // VB #VB by 3 list of mesh vertices in 3D + // FB #FB by ss list of simplex indices into VB, ss<=3 + // resolve_overlaps whether or not to resolve self-union. If false + // then result may contain self-intersections if input mesh is + // non-convex. + // Outputs: + // W #W by 3 list of mesh vertices in 3D + // G #G by 3 list of triangle indices into W + // J #G by 2 list of indices into + // + template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedW, + typename DerivedG, + typename DerivedJ> + IGL_INLINE void minkowski_sum( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::MatrixBase & VB, + const Eigen::MatrixBase & FB, + const bool resolve_overlaps, + Eigen::PlainObjectBase & W, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & J); + // Compute the Minkowski sum of a closed triangle mesh (V,F) and a + // segment [s,d] in 3D. + // + // Inputs: + // VA #VA by 3 list of mesh vertices in 3D + // FA #FA by 3 list of triangle indices into VA + // s segment source endpoint in 3D + // d segment source endpoint in 3D + // resolve_overlaps whether or not to resolve self-union. If false + // then result may contain self-intersections if input mesh is + // non-convex. + // Outputs: + // W #W by 3 list of mesh vertices in 3D + // G #G by 3 list of triangle indices into W + // J #G list of indices into [F;#V+F;[s d]] of birth parents + // + template < + typename DerivedVA, + typename DerivedFA, + typename sType, int sCols, int sOptions, + typename dType, int dCols, int dOptions, + typename DerivedW, + typename DerivedG, + typename DerivedJ> + IGL_INLINE void minkowski_sum( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::Matrix & s, + const Eigen::Matrix & d, + const bool resolve_overlaps, + Eigen::PlainObjectBase & W, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & J); + template < + typename DerivedVA, + typename DerivedFA, + typename sType, int sCols, int sOptions, + typename dType, int dCols, int dOptions, + typename DerivedW, + typename DerivedG, + typename DerivedJ> + IGL_INLINE void minkowski_sum( + const Eigen::MatrixBase & VA, + const Eigen::MatrixBase & FA, + const Eigen::Matrix & s, + const Eigen::Matrix & d, + Eigen::PlainObjectBase & W, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & J); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "minkowski_sum.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edge.cpp b/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edge.cpp new file mode 100644 index 0000000000000000000000000000000000000000..13b585b509a8e90e2e2699d550b7f0484ece9dd0 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edge.cpp @@ -0,0 +1,428 @@ +#include "order_facets_around_edge.h" +#include +#include + +#include + +// adj_faces contains signed index starting from +- 1. +template< + typename DerivedV, + typename DerivedF, + typename DerivedI > +void igl::copyleft::cgal::order_facets_around_edge( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + size_t s, + size_t d, + const std::vector& adj_faces, + Eigen::PlainObjectBase& order, bool debug) +{ + // Although we only need exact predicates in the algorithm, + // exact constructions are needed to avoid degeneracies due to + // casting to double. + typedef CGAL::Exact_predicates_exact_constructions_kernel K; + typedef K::Point_3 Point_3; + typedef K::Plane_3 Plane_3; + + auto get_face_index = [&](int adj_f)->size_t + { + return abs(adj_f) - 1; + }; + + auto get_opposite_vertex = [&](size_t fid)->size_t + { + typedef typename DerivedF::Scalar Index; + if (F(fid, 0) != (Index)s && F(fid, 0) != (Index)d) return F(fid, 0); + if (F(fid, 1) != (Index)s && F(fid, 1) != (Index)d) return F(fid, 1); + if (F(fid, 2) != (Index)s && F(fid, 2) != (Index)d) return F(fid, 2); + assert(false); + return -1; + }; + + // Handle base cases + if (adj_faces.size() == 0) + { + order.resize(0, 1); + return; + } else if (adj_faces.size() == 1) + { + order.resize(1, 1); + order(0, 0) = 0; + return; + } else if (adj_faces.size() == 2) + { + const size_t o1 = get_opposite_vertex(get_face_index(adj_faces[0])); + const size_t o2 = get_opposite_vertex(get_face_index(adj_faces[1])); + const Point_3 ps(V(s, 0), V(s, 1), V(s, 2)); + const Point_3 pd(V(d, 0), V(d, 1), V(d, 2)); + const Point_3 p1(V(o1, 0), V(o1, 1), V(o1, 2)); + const Point_3 p2(V(o2, 0), V(o2, 1), V(o2, 2)); + order.resize(2, 1); + switch (CGAL::orientation(ps, pd, p1, p2)) + { + case CGAL::POSITIVE: + order(0, 0) = 1; + order(1, 0) = 0; + break; + case CGAL::NEGATIVE: + order(0, 0) = 0; + order(1, 0) = 1; + break; + case CGAL::COPLANAR: + { + switch (CGAL::coplanar_orientation(ps, pd, p1, p2)) { + case CGAL::POSITIVE: + // Duplicated face, use index to break tie. + order(0, 0) = adj_faces[0] < adj_faces[1] ? 0:1; + order(1, 0) = adj_faces[0] < adj_faces[1] ? 1:0; + break; + case CGAL::NEGATIVE: + // Coplanar faces, one on each side of the edge. + // It is equally valid to order them (0, 1) or (1, 0). + // I cannot think of any reason to prefer one to the + // other. So just use (0, 1) ordering by default. + order(0, 0) = 0; + order(1, 0) = 1; + break; + case CGAL::COLLINEAR: + std::cerr << "Degenerated triangle detected." << + std::endl; + assert(false); + break; + default: + assert(false); + } + } + break; + default: + assert(false); + } + return; + } + + const size_t num_adj_faces = adj_faces.size(); + const size_t o = get_opposite_vertex( get_face_index(adj_faces[0])); + const Point_3 p_s(V(s, 0), V(s, 1), V(s, 2)); + const Point_3 p_d(V(d, 0), V(d, 1), V(d, 2)); + const Point_3 p_o(V(o, 0), V(o, 1), V(o, 2)); + const Plane_3 separator(p_s, p_d, p_o); + if (separator.is_degenerate()) { + throw std::runtime_error( + "Cannot order facets around edge due to degenerated facets"); + } + + std::vector opposite_vertices; + for (size_t i=0; i positive_side; + std::vector negative_side; + std::vector tie_positive_oriented; + std::vector tie_negative_oriented; + + std::vector positive_side_index; + std::vector negative_side_index; + std::vector tie_positive_oriented_index; + std::vector tie_negative_oriented_index; + + for (size_t i=0; i& data) -> std::vector{ + const size_t len = data.size(); + std::vector order(len); + for (size_t i=0; i tie_positive_order = index_sort(tie_positive_oriented); + std::vector tie_negative_order = index_sort(tie_negative_oriented); + + // Copy results into order vector. + const size_t tie_positive_size = tie_positive_oriented.size(); + const size_t tie_negative_size = tie_negative_oriented.size(); + const size_t positive_size = positive_order.size(); + const size_t negative_size = negative_order.size(); + + order.resize( + tie_positive_size + positive_size + tie_negative_size + negative_size,1); + + size_t count=0; + for (size_t i=0; i +IGL_INLINE +void igl::copyleft::cgal::order_facets_around_edge( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + size_t s, + size_t d, + const std::vector& adj_faces, + const Eigen::PlainObjectBase& pivot_point, + Eigen::PlainObjectBase& order) +{ + assert(V.cols() == 3); + assert(F.cols() == 3); + assert(pivot_point.cols() == 3); + auto signed_index_to_index = [&](int signed_idx) + { + return abs(signed_idx) -1; + }; + auto get_opposite_vertex_index = [&](size_t fid) -> typename DerivedF::Scalar + { + typedef typename DerivedF::Scalar Index; + if (F(fid, 0) != (Index)s && F(fid, 0) != (Index)d) return F(fid, 0); + if (F(fid, 1) != (Index)s && F(fid, 1) != (Index)d) return F(fid, 1); + if (F(fid, 2) != (Index)s && F(fid, 2) != (Index)d) return F(fid, 2); + assert(false); + // avoid warning + return -1; + }; + + { + // Check if s, d and pivot are collinear. + typedef CGAL::Exact_predicates_exact_constructions_kernel K; + K::Point_3 ps(V(s,0), V(s,1), V(s,2)); + K::Point_3 pd(V(d,0), V(d,1), V(d,2)); + K::Point_3 pp(pivot_point(0,0), pivot_point(0,1), pivot_point(0,2)); + if (CGAL::collinear(ps, pd, pp)) { + throw std::runtime_error( + "Pivot point is collinear with the outer edge!"); + } + } + + const size_t N = adj_faces.size(); + const size_t num_faces = N + 1; // N adj faces + 1 pivot face + + // Because face indices are used for tie breaking, the original face indices + // in the new faces array must be ascending. + auto comp = [&](int i, int j) + { + return signed_index_to_index(adj_faces[i]) < + signed_index_to_index(adj_faces[j]); + }; + std::vector adj_order(N); + for (size_t i=0; i adj_faces_with_pivot(num_faces); + for (size_t i=0; i, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase >&, bool); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase >&, bool); +template void igl::copyleft::cgal::order_facets_around_edge, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase >&, bool); +template void igl::copyleft::cgal::order_facets_around_edge, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase >&, bool); +template void igl::copyleft::cgal::order_facets_around_edge, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::order_facets_around_edge, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::order_facets_around_edge, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, unsigned long, unsigned long, std::vector > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase> &, bool); +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase> &, bool); +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::order_facets_around_edge, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase> &, bool); +template void igl::copyleft::cgal::order_facets_around_edge, -1, 3, 0, -1, 3>, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, 3, 0, -1, 3>> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase, -1, 3, 0, -1, 3>> const &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::order_facets_around_edge, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::order_facets_around_edge, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, unsigned __int64, unsigned __int64, class std::vector> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edge.h b/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edge.h new file mode 100644 index 0000000000000000000000000000000000000000..6e09129accfa7ae84000234e6630bd28b16f8a73 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edge.h @@ -0,0 +1,77 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLEFT_CGAL_ORDER_FACETS_AROUND_EDGE_H +#define IGL_COPYLEFT_CGAL_ORDER_FACETS_AROUND_EDGE_H +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given a directed edge, sort its adjacent faces. Assuming the + // directed edge is (s, d). Sort the adjacent faces clockwise around the + // axis (d - s), i.e. left-hand rule. An adjacent face is consistently + // oriented if it contains (d, s) as a directed edge. + // + // For overlapping faces, break the tie using signed face index, smaller + // signed index comes before the larger signed index. Signed index is + // computed as (consistent? 1:-1) * (face_index + 1). + // + // Inputs: + // V #V by 3 list of vertices. + // F #F by 3 list of faces + // s Index of source vertex. + // d Index of destination vertex. + // adj_faces List of adjacent face signed indices. + // Output: + // order List of face indices that orders adjacent faces around edge + // (s, d) clockwise. + template< + typename DerivedV, + typename DerivedF, + typename DerivedI > + IGL_INLINE + void order_facets_around_edge( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + size_t s, + size_t d, + const std::vector& adj_faces, + Eigen::PlainObjectBase& order, + bool debug=false); + + // This function is a wrapper around the one above. Since the ordering + // is circular, the pivot point is used to define a starting point. So + // order[0] is the index into adj_face that is immediately after the + // pivot face (s, d, pivot point) in clockwise order. + template< + typename DerivedV, + typename DerivedF, + typename DerivedI> + IGL_INLINE + void order_facets_around_edge( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + size_t s, + size_t d, + const std::vector& adj_faces, + const Eigen::PlainObjectBase& pivot_point, + Eigen::PlainObjectBase& order); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +#include "order_facets_around_edge.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edges.cpp b/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edges.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a7d45b8dfaae037ee6a636281181c0114e2a82f9 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edges.cpp @@ -0,0 +1,337 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "order_facets_around_edges.h" +#include "order_facets_around_edge.h" +#include "../../sort_angles.h" +#include +#include +#include + +template< + typename DerivedV, + typename DerivedF, + typename DerivedN, + typename DeriveduE, + typename uE2EType, + typename uE2oEType, + typename uE2CType > +IGL_INLINE +typename std::enable_if::value, void>::type +igl::copyleft::cgal::order_facets_around_edges( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& N, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + std::vector >& uE2oE, + std::vector >& uE2C ) { + + typedef Eigen::Matrix Vector3F; + const typename DerivedV::Scalar EPS = 1e-12; + const size_t num_faces = F.rows(); + const size_t num_undirected_edges = uE.rows(); + + auto edge_index_to_face_index = [&](size_t ei) { return ei % num_faces; }; + auto edge_index_to_corner_index = [&](size_t ei) { return ei / num_faces; }; + + uE2oE.resize(num_undirected_edges); + uE2C.resize(num_undirected_edges); + + for(size_t ui = 0;ui 0); + + const auto ref_edge = adj_edges[0]; + const auto ref_face = edge_index_to_face_index(ref_edge); + Vector3F ref_normal = N.row(ref_face); + + const auto ref_corner_o = edge_index_to_corner_index(ref_edge); + const auto ref_corner_s = (ref_corner_o+1)%3; + const auto ref_corner_d = (ref_corner_o+2)%3; + + const typename DerivedF::Scalar o = F(ref_face, ref_corner_o); + const typename DerivedF::Scalar s = F(ref_face, ref_corner_s); + const typename DerivedF::Scalar d = F(ref_face, ref_corner_d); + + Vector3F edge = V.row(d) - V.row(s); + auto edge_len = edge.norm(); + bool degenerated = edge_len < EPS; + if (degenerated) { + if (edge_valance <= 2) { + // There is only one way to order 2 or less faces. + edge.setZero(); + } else { + edge.setZero(); + Eigen::Matrix + normals(edge_valance, 3); + for (size_t fei=0; fei= EPS) { + edge.normalize(); + break; + } + } + + // Ensure edge direction are consistent with reference face. + Vector3F in_face_vec = V.row(o) - V.row(s); + if (edge.cross(in_face_vec).dot(ref_normal) < 0) { + edge *= -1; + } + + if (edge.norm() < EPS) { + std::cerr << "=====================================" << std::endl; + std::cerr << " ui: " << ui << std::endl; + std::cerr << "edge: " << ref_edge << std::endl; + std::cerr << "face: " << ref_face << std::endl; + std::cerr << " vs: " << V.row(s) << std::endl; + std::cerr << " vd: " << V.row(d) << std::endl; + std::cerr << "adj face normals: " << std::endl; + std::cerr << normals << std::endl; + std::cerr << "Very degenerated case detected:" << std::endl; + std::cerr << "Near zero edge surrounded by " + << edge_valance << " neearly colinear faces" << + std::endl; + std::cerr << "=====================================" << std::endl; + } + } + } else { + edge.normalize(); + } + + Eigen::MatrixXd angle_data(edge_valance, 3); + std::vector cons(edge_valance); + + for (size_t fei=0; fei +IGL_INLINE +typename std::enable_if::value, void>::type +igl::copyleft::cgal::order_facets_around_edges( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& N, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + std::vector >& uE2oE, + std::vector >& uE2C ) { + + typedef Eigen::Matrix Vector3F; + typedef Eigen::Matrix Vector3E; + const typename DerivedV::Scalar EPS = 1e-12; + const size_t num_faces = F.rows(); + const size_t num_undirected_edges = uE.rows(); + + auto edge_index_to_face_index = [&](size_t ei) { return ei % num_faces; }; + auto edge_index_to_corner_index = [&](size_t ei) { return ei / num_faces; }; + + uE2oE.resize(num_undirected_edges); + uE2C.resize(num_undirected_edges); + + for(size_t ui = 0;ui 0); + + const auto ref_edge = adj_edges[0]; + const auto ref_face = edge_index_to_face_index(ref_edge); + Vector3F ref_normal = N.row(ref_face); + + const auto ref_corner_o = edge_index_to_corner_index(ref_edge); + const auto ref_corner_s = (ref_corner_o+1)%3; + const auto ref_corner_d = (ref_corner_o+2)%3; + + const typename DerivedF::Scalar o = F(ref_face, ref_corner_o); + const typename DerivedF::Scalar s = F(ref_face, ref_corner_s); + const typename DerivedF::Scalar d = F(ref_face, ref_corner_d); + + Vector3E exact_edge = V.row(d) - V.row(s); + exact_edge.array() /= exact_edge.squaredNorm(); + Vector3F edge( + CGAL::to_double(exact_edge[0]), + CGAL::to_double(exact_edge[1]), + CGAL::to_double(exact_edge[2])); + edge.normalize(); + + Eigen::MatrixXd angle_data(edge_valance, 3); + std::vector cons(edge_valance); + + for (size_t fei=0; fei +IGL_INLINE void igl::copyleft::cgal::order_facets_around_edges( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + std::vector >& uE2oE, + std::vector >& uE2C ) { + + //typedef Eigen::Matrix Vector3E; + const size_t num_faces = F.rows(); + const size_t num_undirected_edges = uE.rows(); + + auto edge_index_to_face_index = [&](size_t ei) { return ei % num_faces; }; + auto edge_index_to_corner_index = [&](size_t ei) { return ei / num_faces; }; + + uE2oE.resize(num_undirected_edges); + uE2C.resize(num_undirected_edges); + + for(size_t ui = 0;ui 0); + + const auto ref_edge = adj_edges[0]; + const auto ref_face = edge_index_to_face_index(ref_edge); + + const auto ref_corner_o = edge_index_to_corner_index(ref_edge); + const auto ref_corner_s = (ref_corner_o+1)%3; + const auto ref_corner_d = (ref_corner_o+2)%3; + + //const typename DerivedF::Scalar o = F(ref_face, ref_corner_o); + const typename DerivedF::Scalar s = F(ref_face, ref_corner_s); + const typename DerivedF::Scalar d = F(ref_face, ref_corner_d); + + std::vector cons(edge_valance); + std::vector adj_faces(edge_valance); + for (size_t fei=0; fei, Eigen::Matrix, Eigen::Matrix, int, int, bool>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&); +// generated by autoexplicit.sh +template std::enable_if::Scalar, CGAL::Lazy_exact_nt >::value), void>::type igl::copyleft::cgal::order_facets_around_edges, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int, int, bool>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&); +template void igl::copyleft::cgal::order_facets_around_edges, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, long, long, bool>(Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&); +template void igl::copyleft::cgal::order_facets_around_edges, Eigen::Matrix, Eigen::Matrix, long, long, bool>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&); +template void igl::copyleft::cgal::order_facets_around_edges, Eigen::Matrix, Eigen::Matrix, long, long, bool>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&); +template void igl::copyleft::cgal::order_facets_around_edges, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, long, long, bool>(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&); +#ifdef WIN32 +template void igl::copyleft::cgal::order_facets_around_edges,-1,-1,0,-1,-1>,class Eigen::Matrix,class Eigen::Matrix,__int64,__int64,bool>(class Eigen::PlainObjectBase,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class std::vector >,class std::allocator > > > const &,class std::vector >,class std::allocator > > > &,class std::vector >,class std::allocator > > > &); +template void igl::copyleft::cgal::order_facets_around_edges,class Eigen::Matrix,class Eigen::Matrix,__int64,__int64,bool>(class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class std::vector >,class std::allocator > > > const &,class std::vector >,class std::allocator > > > &,class std::vector >,class std::allocator > > > &); +template void igl::copyleft::cgal::order_facets_around_edges,class Eigen::Matrix,class Eigen::Matrix,__int64,__int64,bool>(class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class std::vector >,class std::allocator > > > const &,class std::vector >,class std::allocator > > > &,class std::vector >,class std::allocator > > > &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edges.h b/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edges.h new file mode 100644 index 0000000000000000000000000000000000000000..89ac2918eea67fe96f243d9fc35cede5645405cd --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/order_facets_around_edges.h @@ -0,0 +1,107 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_ORDER_FACETS_AROUND_EDGES_H +#define IGL_COPYLEFT_CGAL_ORDER_FACETS_AROUND_EDGES_H +#include "../../igl_inline.h" +#include +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // For each undirected edge, sort its adjacent faces. Assuming the + // undirected edge is (s, d). Sort the adjacent faces clockwise around the + // axis (d - s), i.e. left-hand rule. An adjacent face is consistently + // oriented if it contains (d, s) as a directed edge. + // + // For overlapping faces, break the tie using signed face index, smaller + // signed index comes before the larger signed index. Signed index is + // computed as (consistent? 1:-1) * index. + // + // Inputs: + // V #V by 3 list of vertices. + // F #F by 3 list of faces + // N #F by 3 list of face normals. + // uE #uE by 2 list of vertex_indices, represents undirected edges. + // uE2E #uE list of lists that maps uE to E. (a one-to-many map) + // + // Outputs: + // uE2oE #uE list of lists that maps uE to an ordered list of E. (a + // one-to-many map) + // uE2C #uE list of lists of bools indicates whether each face in + // uE2oE[i] is consistently orientated as the ordering. + // + template< + typename DerivedV, + typename DerivedF, + typename DerivedN, + typename DeriveduE, + typename uE2EType, + typename uE2oEType, + typename uE2CType > + IGL_INLINE + typename std::enable_if::value, void>::type + order_facets_around_edges( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& N, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + std::vector >& uE2oE, + std::vector >& uE2C ); + + template< + typename DerivedV, + typename DerivedF, + typename DerivedN, + typename DeriveduE, + typename uE2EType, + typename uE2oEType, + typename uE2CType > + IGL_INLINE + typename std::enable_if::value, void>::type + order_facets_around_edges( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& N, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + std::vector >& uE2oE, + std::vector >& uE2C ); + + // Order faces around each edge. Only exact predicate is used in the algorithm. + // Normal is not needed. + template< + typename DerivedV, + typename DerivedF, + typename DeriveduE, + typename uE2EType, + typename uE2oEType, + typename uE2CType > + IGL_INLINE void order_facets_around_edges( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + std::vector >& uE2oE, + std::vector >& uE2C ); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +#include "order_facets_around_edges.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/orient2D.cpp b/vendor/libigl/include/igl/copyleft/cgal/orient2D.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6e6cfe649f4207448c2f82367a16741b88510552 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/orient2D.cpp @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "orient2D.h" +#include +#include + +template +IGL_INLINE short igl::copyleft::cgal::orient2D( + const Scalar *pa, + const Scalar *pb, + const Scalar *pc) +{ + typedef CGAL::Exact_predicates_exact_constructions_kernel Epeck; + typedef CGAL::Exact_predicates_inexact_constructions_kernel Epick; + typedef typename std::conditional::value, + Epeck, Epick>::type Kernel; + + switch(CGAL::orientation( + typename Kernel::Point_2(pa[0], pa[1]), + typename Kernel::Point_2(pb[0], pb[1]), + typename Kernel::Point_2(pc[0], pc[1]))) + { + case CGAL::LEFT_TURN: + return 1; + case CGAL::RIGHT_TURN: + return -1; + case CGAL::COLLINEAR: + return 0; + default: + throw "Invalid orientation"; + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template short igl::copyleft::cgal::orient2D(double const*, double const*, double const*); +#ifdef WIN32 +template short igl::copyleft::cgal::orient2D(double const * const, double const * const, double const * const); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/orient2D.h b/vendor/libigl/include/igl/copyleft/cgal/orient2D.h new file mode 100644 index 0000000000000000000000000000000000000000..6f816aa66b7d6aa82b897ceb2dbb1405c2a53fd8 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/orient2D.h @@ -0,0 +1,38 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_COPYLEFT_CGAL_ORIENT_2D_H +#define IGL_COPYLEFT_CGAL_ORIENT_2D_H + +#include "../../igl_inline.h" + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Inputs: + // pa,pb,pc 2D points. + // Output: + // 1 if pa,pb,pc are counterclockwise oriented. + // 0 if pa,pb,pc are collinear. + // -1 if pa,pb,pc are clockwise oriented. + template + IGL_INLINE short orient2D( + const Scalar *pa, + const Scalar *pb, + const Scalar *pc); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "orient2D.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/orient3D.cpp b/vendor/libigl/include/igl/copyleft/cgal/orient3D.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3bdbfb80ef9026ca43725f40d48c6d54ce401cc4 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/orient3D.cpp @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "orient3D.h" +#include +#include + +template +IGL_INLINE short igl::copyleft::cgal::orient3D( + const Scalar pa[3], + const Scalar pb[3], + const Scalar pc[3], + const Scalar pd[3]) +{ + typedef CGAL::Exact_predicates_exact_constructions_kernel Epeck; + typedef CGAL::Exact_predicates_inexact_constructions_kernel Epick; + typedef typename std::conditional::value, + Epeck, Epick>::type Kernel; + + switch(CGAL::orientation( + typename Kernel::Point_3(pa[0], pa[1], pa[2]), + typename Kernel::Point_3(pb[0], pb[1], pb[2]), + typename Kernel::Point_3(pc[0], pc[1], pc[2]), + typename Kernel::Point_3(pd[0], pd[1], pd[2]))) { + case CGAL::POSITIVE: + return 1; + case CGAL::NEGATIVE: + return -1; + case CGAL::COPLANAR: + return 0; + default: + throw "Invalid orientation"; + } +} diff --git a/vendor/libigl/include/igl/copyleft/cgal/orient3D.h b/vendor/libigl/include/igl/copyleft/cgal/orient3D.h new file mode 100644 index 0000000000000000000000000000000000000000..029e208b12f445ed7a24e4b58254f16ff4915d56 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/orient3D.h @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_COPYLEFT_CGAL_ORIENT_3D_H +#define IGL_COPYLEFT_CGAL_ORIENT_3D_H + +#include "../../igl_inline.h" + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Inputs: + // pa,pb,pc,pd 3D points. + // Output: + // 1 if pa,pb,pc,pd forms a tet of positive volume. + // 0 if pa,pb,pc,pd are coplanar. + // -1 if pa,pb,pc,pd forms a tet of negative volume. + template + IGL_INLINE short orient3D( + const Scalar pa[3], + const Scalar pb[3], + const Scalar pc[3], + const Scalar pd[3]); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "orient3D.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/outer_element.cpp b/vendor/libigl/include/igl/copyleft/cgal/outer_element.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cdf8a35cfdc093a73ff9866bddb6af0ec8d47642 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/outer_element.cpp @@ -0,0 +1,234 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "outer_element.h" +#include +#include + +template < + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename IndexType, + typename DerivedA + > +IGL_INLINE void igl::copyleft::cgal::outer_vertex( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & I, + IndexType & v_index, + Eigen::PlainObjectBase & A) +{ + // Algorithm: + // Find an outer vertex (i.e. vertex reachable from infinity) + // Return the vertex with the largest X value. + // If there is a tie, pick the one with largest Y value. + // If there is still a tie, pick the one with the largest Z value. + // If there is still a tie, then there are duplicated vertices within the + // mesh, which violates the precondition. + typedef typename DerivedF::Scalar Index; + const Index INVALID = std::numeric_limits::max(); + const size_t num_selected_faces = I.rows(); + std::vector candidate_faces; + Index outer_vid = INVALID; + typename DerivedV::Scalar outer_val = 0; + for (size_t i=0; i outer_val) + { + outer_val = vx; + outer_vid = v; + candidate_faces = {f}; + } else if (v == outer_vid) + { + candidate_faces.push_back(f); + } else if (vx == outer_val) + { + // Break tie. + auto vy = V(v,1); + auto vz = V(v, 2); + auto outer_y = V(outer_vid, 1); + auto outer_z = V(outer_vid, 2); + assert(!(vy == outer_y && vz == outer_z)); + bool replace = (vy > outer_y) || + ((vy == outer_y) && (vz > outer_z)); + if (replace) + { + outer_val = vx; + outer_vid = v; + candidate_faces = {f}; + } + } + } + } + + assert(outer_vid != INVALID); + assert(candidate_faces.size() > 0); + v_index = outer_vid; + A.resize(candidate_faces.size()); + std::copy(candidate_faces.begin(), candidate_faces.end(), A.data()); +} + +template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename IndexType, + typename DerivedA + > +IGL_INLINE void igl::copyleft::cgal::outer_edge( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & I, + IndexType & v1, + IndexType & v2, + Eigen::PlainObjectBase & A) { + // Algorithm: + // Find an outer vertex first. + // Find the incident edge with largest abs slope when projected onto XY plane. + // If there is a tie, check the signed slope and use the positive one. + // If there is still a tie, break it using the projected slope onto ZX plane. + // If there is still a tie, again check the signed slope and use the positive one. + // If there is still a tie, then there are multiple overlapping edges, + // which violates the precondition. + typedef typename DerivedV::Scalar Scalar; + typedef typename DerivedV::Index Index; + typedef typename Eigen::Matrix ScalarArray3; + typedef typename Eigen::Matrix IndexArray3; + const Index INVALID = std::numeric_limits::max(); + + Index outer_vid; + Eigen::Matrix candidate_faces; + outer_vertex(V, F, I, outer_vid, candidate_faces); + const ScalarArray3& outer_v = V.row(outer_vid); + assert(candidate_faces.size() > 0); + + auto get_vertex_index = [&](const IndexArray3& f, Index vid) -> Index + { + if (f[0] == vid) return 0; + if (f[1] == vid) return 1; + if (f[2] == vid) return 2; + assert(false); + return -1; + }; + + auto unsigned_value = [](Scalar v) -> Scalar { + if (v < 0) return v * -1; + else return v; + }; + + Scalar outer_slope_YX = 0; + Scalar outer_slope_ZX = 0; + Index outer_opp_vid = INVALID; + bool infinite_slope_detected = false; + std::vector incident_faces; + auto check_and_update_outer_edge = [&](Index opp_vid, Index fid) -> void { + if (opp_vid == outer_opp_vid) + { + incident_faces.push_back(fid); + return; + } + + const ScalarArray3 opp_v = V.row(opp_vid); + if (!infinite_slope_detected && outer_v[0] != opp_v[0]) + { + // Finite slope + const ScalarArray3 diff = opp_v - outer_v; + const Scalar slope_YX = diff[1] / diff[0]; + const Scalar slope_ZX = diff[2] / diff[0]; + const Scalar u_slope_YX = unsigned_value(slope_YX); + const Scalar u_slope_ZX = unsigned_value(slope_ZX); + bool update = false; + if (outer_opp_vid == INVALID) { + update = true; + } else { + const Scalar u_outer_slope_YX = unsigned_value(outer_slope_YX); + if (u_slope_YX > u_outer_slope_YX) { + update = true; + } else if (u_slope_YX == u_outer_slope_YX && + slope_YX > outer_slope_YX) { + update = true; + } else if (slope_YX == outer_slope_YX) { + const Scalar u_outer_slope_ZX = + unsigned_value(outer_slope_ZX); + if (u_slope_ZX > u_outer_slope_ZX) { + update = true; + } else if (u_slope_ZX == u_outer_slope_ZX && + slope_ZX > outer_slope_ZX) { + update = true; + } else if (slope_ZX == u_outer_slope_ZX) { + assert(false); + } + } + } + + if (update) { + outer_opp_vid = opp_vid; + outer_slope_YX = slope_YX; + outer_slope_ZX = slope_ZX; + incident_faces = {fid}; + } + } else if (!infinite_slope_detected) + { + // Infinite slope + outer_opp_vid = opp_vid; + infinite_slope_detected = true; + incident_faces = {fid}; + } + }; + + const size_t num_candidate_faces = candidate_faces.size(); + for (size_t i=0; i +template void igl::copyleft::cgal::outer_edge, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_edge, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_edge, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_edge, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_edge, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_edge, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_edge, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_edge, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_edge, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, long, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, long&, long&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template void igl::copyleft::cgal::outer_edge, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge, -1, 3, 0, -1, 3>, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase, -1, 3, 0, -1, 3>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge,-1,-1,0,-1,-1>,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,__int64,class Eigen::Matrix<__int64,-1,1,0,-1,1> >(class Eigen::PlainObjectBase,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,__int64 &,__int64 &,class Eigen::PlainObjectBase > &); +template void igl::copyleft::cgal::outer_edge, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge, class Eigen::Matrix, class Eigen::Matrix, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, __int64 &, __int64 &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::outer_edge,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,__int64,class Eigen::Matrix<__int64,-1,1,0,-1,1> >(class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,__int64 &,__int64 &,class Eigen::PlainObjectBase > &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/outer_element.h b/vendor/libigl/include/igl/copyleft/cgal/outer_element.h new file mode 100644 index 0000000000000000000000000000000000000000..adaef3464dbedc247ea5527134780909e65ece8a --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/outer_element.h @@ -0,0 +1,83 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_OUTER_ELEMENT_H +#define IGL_COPYLEFT_CGAL_OUTER_ELEMENT_H +#include "../../igl_inline.h" +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Find a vertex that is reachable from infinite without crossing any faces. + // Such vertex is called "outer vertex." + // + // Precondition: The input mesh must have all self-intersection resolved and + // no duplicated vertices. See cgal::remesh_self_intersections.h for how to + // obtain such input. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // I #I list of facets to consider + // Outputs: + // v_index index of outer vertex + // A #A list of facets incident to the outer vertex + template < + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename IndexType, + typename DerivedA + > + IGL_INLINE void outer_vertex( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & I, + IndexType & v_index, + Eigen::PlainObjectBase & A); + // Find an edge that is reachable from infinity without crossing any faces. + // Such edge is called "outer edge." + // + // Precondition: The input mesh must have all self-intersection resolved + // and no duplicated vertices. The correctness of the output depends on + // the fact that there is no edge overlap. See + // cgal::remesh_self_intersections.h for how to obtain such input. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // I #I list of facets to consider + // Outputs: + // v1 index of the first end point of outer edge + // v2 index of the second end point of outer edge + // A #A list of facets incident to the outer edge + template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename IndexType, + typename DerivedA + > + IGL_INLINE void outer_edge( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & I, + IndexType & v1, + IndexType & v2, + Eigen::PlainObjectBase & A); + + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "outer_element.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/outer_facet.cpp b/vendor/libigl/include/igl/copyleft/cgal/outer_facet.cpp new file mode 100644 index 0000000000000000000000000000000000000000..40cfa7ac02b2143c96174da95b3d32f9b7e3862f --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/outer_facet.cpp @@ -0,0 +1,183 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "outer_facet.h" +#include "outer_element.h" +#include "order_facets_around_edge.h" +#include +#include + +template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename IndexType + > +IGL_INLINE void igl::copyleft::cgal::outer_facet( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & I, + IndexType & f, + bool & flipped) { + + // Algorithm: + // + // 1. Find an outer edge (s, d). + // + // 2. Order adjacent facets around this edge. Because the edge is an + // outer edge, there exists a plane passing through it such that all its + // adjacent facets lie on the same side. The implementation of + // order_facets_around_edge() will find a natural start facet such that + // The first and last facets according to this order are on the outside. + // + // 3. Because the vertex s is an outer vertex by construction (see + // implemnetation of outer_edge()). The first adjacent facet is facing + // outside (i.e. flipped=false) if it has positive X normal component. + // If it has zero normal component, it is facing outside if it contains + // directed edge (s, d). + + //typedef typename DerivedV::Scalar Scalar; + typedef typename DerivedV::Index Index; + + Index s,d; + Eigen::Matrix incident_faces; + outer_edge(V, F, I, s, d, incident_faces); + assert(incident_faces.size() > 0); + + auto convert_to_signed_index = [&](size_t fid) -> int{ + if ((F(fid, 0) == s && F(fid, 1) == d) || + (F(fid, 1) == s && F(fid, 2) == d) || + (F(fid, 2) == s && F(fid, 0) == d) ) { + return int(fid+1) * -1; + } else { + return int(fid+1); + } + }; + + auto signed_index_to_index = [&](int signed_id) -> size_t { + return size_t(abs(signed_id) - 1); + }; + + std::vector adj_faces(incident_faces.size()); + std::transform(incident_faces.data(), + incident_faces.data() + incident_faces.size(), + adj_faces.begin(), + convert_to_signed_index); + + DerivedV pivot_point = V.row(s); + pivot_point(0, 0) += 1.0; + + Eigen::VectorXi order; + order_facets_around_edge(V, F, s, d, adj_faces, pivot_point, order); + + f = signed_index_to_index(adj_faces[order[0]]); + flipped = adj_faces[order[0]] > 0; +} + + + +template< + typename DerivedV, + typename DerivedF, + typename DerivedN, + typename DerivedI, + typename IndexType + > +IGL_INLINE void igl::copyleft::cgal::outer_facet( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & N, + const Eigen::PlainObjectBase & I, + IndexType & f, + bool & flipped) { + // Algorithm: + // Find an outer edge. + // Find the incident facet with the largest absolute X normal component. + // If there is a tie, keep the one with positive X component. + // If there is still a tie, pick the face with the larger signed index + // (flipped face has negative index). + typedef typename DerivedV::Scalar Scalar; + typedef typename DerivedV::Index Index; + const size_t INVALID = std::numeric_limits::max(); + + Index v1,v2; + Eigen::Matrix incident_faces; + outer_edge(V, F, I, v1, v2, incident_faces); + assert(incident_faces.size() > 0); + + auto generic_fabs = [&](const Scalar& val) -> const Scalar { + if (val >= 0) return val; + else return -val; + }; + + Scalar max_nx = 0; + size_t outer_fid = INVALID; + const size_t num_incident_faces = incident_faces.size(); + for (size_t i=0; i generic_fabs(max_nx)) { + max_nx = nx; + outer_fid = fid; + } else if (nx == -max_nx && nx > 0) { + max_nx = nx; + outer_fid = fid; + } else if (nx == max_nx) { + if ((max_nx >= 0 && outer_fid < fid) || + (max_nx < 0 && outer_fid > fid)) { + max_nx = nx; + outer_fid = fid; + } + } + } + } + + assert(outer_fid != INVALID); + f = outer_fid; + flipped = max_nx < 0; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::outer_facet, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, unsigned long>(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned long&, bool&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::outer_facet, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::outer_facet, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, unsigned long>(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned long&, bool&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::outer_facet, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::outer_facet, Eigen::Matrix, Eigen::Matrix, unsigned long>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned long&, bool&); +#include +#include +template void igl::copyleft::cgal::outer_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +template void igl::copyleft::cgal::outer_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, unsigned long>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned long&, bool&); +template void igl::copyleft::cgal::outer_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +template void igl::copyleft::cgal::outer_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +template void igl::copyleft::cgal::outer_facet, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +template void igl::copyleft::cgal::outer_facet, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +template void igl::copyleft::cgal::outer_facet, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +template void igl::copyleft::cgal::outer_facet, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, unsigned long>(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned long&, bool&); +template void igl::copyleft::cgal::outer_facet, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +template void igl::copyleft::cgal::outer_facet, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +template void igl::copyleft::cgal::outer_facet, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int&, bool&); +#ifdef WIN32 +template void igl::copyleft::cgal::outer_facet, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, unsigned __int64>(class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, unsigned __int64 &, bool &); +template void igl::copyleft::cgal::outer_facet, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, unsigned __int64>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, unsigned __int64 &, bool &); +template void igl::copyleft::cgal::outer_facet, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, unsigned __int64>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, unsigned __int64 &, bool &); +template void igl::copyleft::cgal::outer_facet,-1,-1,0,-1,-1>,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,int>(class Eigen::PlainObjectBase,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,int &,bool &); +template void igl::copyleft::cgal::outer_facet,class Eigen::Matrix,class Eigen::Matrix,unsigned __int64>(class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,unsigned __int64 &,bool &); +template void igl::copyleft::cgal::outer_facet,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,int>(class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,int &,bool &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/outer_facet.h b/vendor/libigl/include/igl/copyleft/cgal/outer_facet.h new file mode 100644 index 0000000000000000000000000000000000000000..b025a94ab17d210fe034715bfc2163c2a16c4fad --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/outer_facet.h @@ -0,0 +1,91 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_COPYLEFT_CGAL_OUTER_FACET_H +#define IGL_COPYLEFT_CGAL_OUTER_FACET_H +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Find a facet that is reachable from infinity without crossing any faces. + // Such facet is called "outer facet." + // + // Precondition: The input mesh must have all self-intersection resolved. I.e + // there is no duplicated vertices, no overlapping edge and no intersecting + // faces (the only exception is there could be topologically duplicated faces). + // See cgal::remesh_self_intersections.h for how to obtain such input. + // + // This function differ from igl::outer_facet() in the fact this + // function is more robust because it does not rely on facet normals. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // I #I list of facets to consider + // Outputs: + // f Index of the outer facet. + // flipped true iff the normal of f points inwards. + template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename IndexType + > + IGL_INLINE void outer_facet( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & I, + IndexType & f, + bool & flipped); + + // Find a facet that is reachable from infinity without crossing any faces. + // Such facet is called "outer facet." + // + // Precondition: The input mesh must have all self-intersection resolved. + // I.e there is no duplicated vertices, no overlapping edge and no + // intersecting faces (the only exception is there could be topologically + // duplicated faces). See cgal::remesh_self_intersections.h for how to + // obtain such input. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // N #N by 3 list of face normals + // I #I list of facets to consider + // Outputs: + // f Index of the outer facet. + // flipped true iff the normal of f points inwards. + template< + typename DerivedV, + typename DerivedF, + typename DerivedN, + typename DerivedI, + typename IndexType + > + IGL_INLINE void outer_facet( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & N, + const Eigen::PlainObjectBase & I, + IndexType & f, + bool & flipped); + + } + + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "outer_facet.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/outer_hull.cpp b/vendor/libigl/include/igl/copyleft/cgal/outer_hull.cpp new file mode 100644 index 0000000000000000000000000000000000000000..16cce0869ee776bfeae9ecbd3eba6591042ee7d1 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/outer_hull.cpp @@ -0,0 +1,539 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "outer_hull.h" +#include "extract_cells.h" +#include "remesh_self_intersections.h" +#include "assign.h" +#include "../../remove_unreferenced.h" + +#include +#include +#include +#include +#include + +template < + typename DerivedV, + typename DerivedF, + typename DerivedHV, + typename DerivedHF, + typename DerivedJ, + typename Derivedflip> +IGL_INLINE void igl::copyleft::cgal::outer_hull( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & HV, + Eigen::PlainObjectBase & HF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & flip) +{ + // Exact types + typedef CGAL::Epeck Kernel; + typedef Kernel::FT ExactScalar; + typedef + Eigen::Matrix< + ExactScalar, + Eigen::Dynamic, + Eigen::Dynamic, + DerivedHV::IsRowMajor> + MatrixXES; + // Remesh self-intersections + MatrixXES Vr; + DerivedHF Fr; + DerivedJ Jr; + { + RemeshSelfIntersectionsParam params; + params.stitch_all = true; + Eigen::VectorXi I; + Eigen::MatrixXi IF; + remesh_self_intersections(V, F, params, Vr, Fr, IF, Jr, I); + // Merge coinciding vertices into non-manifold vertices. + std::for_each(Fr.data(), Fr.data()+Fr.size(), + [&I](typename DerivedHF::Scalar& a) { a=I[a]; }); + // Remove unreferenced vertices. + Eigen::VectorXi UIM; + remove_unreferenced(MatrixXES(Vr),DerivedHF(Fr), Vr, Fr, UIM); + } + // Extract cells for each face + Eigen::MatrixXi C; + extract_cells(Vr,Fr,C); + // Extract faces on ambient cell + int num_outer = 0; + for(int i = 0;i +#include +#include +#include +#include +#include +#include +//#define IGL_OUTER_HULL_DEBUG + +template < + typename DerivedV, + typename DerivedF, + typename DerivedG, + typename DerivedJ, + typename Derivedflip> +IGL_INLINE void igl::copyleft::cgal::outer_hull_legacy( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & flip) +{ +#ifdef IGL_OUTER_HULL_DEBUG + std::cerr << "Extracting outer hull" << std::endl; +#endif + using namespace Eigen; + using namespace std; + typedef typename DerivedF::Index Index; + Matrix C; + typedef Matrix MatrixXV; + //typedef Matrix MatrixXF; + typedef Matrix MatrixXG; + typedef Matrix MatrixXJ; + const Index m = F.rows(); + + // UNUSED: + //const auto & duplicate_simplex = [&F](const int f, const int g)->bool + //{ + // return + // (F(f,0) == F(g,0) && F(f,1) == F(g,1) && F(f,2) == F(g,2)) || + // (F(f,1) == F(g,0) && F(f,2) == F(g,1) && F(f,0) == F(g,2)) || + // (F(f,2) == F(g,0) && F(f,0) == F(g,1) && F(f,1) == F(g,2)) || + // (F(f,0) == F(g,2) && F(f,1) == F(g,1) && F(f,2) == F(g,0)) || + // (F(f,1) == F(g,2) && F(f,2) == F(g,1) && F(f,0) == F(g,0)) || + // (F(f,2) == F(g,2) && F(f,0) == F(g,1) && F(f,1) == F(g,0)); + //}; + +#ifdef IGL_OUTER_HULL_DEBUG + cout<<"outer hull..."< MatrixX2I; + typedef Matrix VectorXI; + //typedef Matrix Vector3F; + MatrixX2I E,uE; + VectorXI EMAP; + vector > uE2E; + unique_edge_map(F,E,uE,EMAP,uE2E); +#ifdef IGL_OUTER_HULL_DEBUG + for (size_t ui=0; ui > uE2oE; + std::vector > uE2C; + order_facets_around_edges(V, F, uE, uE2E, uE2oE, uE2C); + uE2E = uE2oE; + VectorXI diIM(3*m); + for (auto ue : uE2E) { + for (size_t i=0; i > > TT,_1; + triangle_triangle_adjacency(E,EMAP,uE2E,false,TT,_1); + VectorXI counts; +#ifdef IGL_OUTER_HULL_DEBUG + cout<<"facet components..."< FH(m,false); + vector EH(3*m,false); + vector vG(ncc); + vector vJ(ncc); + vector vIM(ncc); + //size_t face_count = 0; + for(size_t id = 0;id g(ncc,0); + // place order of each face in its respective component + for(Index f = 0;f Q; + Q.push(f+0*m); + Q.push(f+1*m); + Q.push(f+2*m); + flip(f) = f_flip; + //std::cout << "face " << face_count++ << ": " << f << std::endl; + //std::cout << "f " << F.row(f).array()+1 << std::endl; + //cout<<"flip("< "<<(nf+1)<<", |"<< + // di[EMAP(e)][diIM(e)]<<" - "< "<<(nf+1)<= 0) + { + max_ne = uE2E[EMAP(e)][nfei]; + } + + if(max_ne>=0) + { + // face of neighbor + const int nf = max_ne%m; +#ifdef IGL_OUTER_HULL_DEBUG + if(!FH[nf]) + { + // first time seeing face + cout<<(f+1)<<" --> "<<(nf+1)< & V, + const MatrixXG & A, + const MatrixXG & B)->bool + { + const auto & bounding_box = []( + const Eigen::PlainObjectBase & V, + const MatrixXG & F)-> + DerivedV + { + DerivedV BB(2,3); + BB<< + 1e26,1e26,1e26, + -1e26,-1e26,-1e26; + const size_t m = F.rows(); + for(size_t f = 0;f0 || + (ABB.row(0)-BBB.row(1)).maxCoeff()>0 ) + { + // bounding boxes do not overlap + return false; + } else { + return true; + } + }; + + // Reject components which are completely inside other components + vector keep(ncc,true); + size_t nG = 0; + // This is O( ncc * ncc * m) + for(size_t id = 0;id unresolved; + for(size_t oid = 0;oid, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_hull_legacy< Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &); +template void igl::copyleft::cgal::outer_hull_legacy< Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_hull_legacy, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::outer_hull_legacy, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template void igl::copyleft::cgal::outer_hull_legacy,-1,-1,0,-1,-1>,class Eigen::Matrix,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix >(class Eigen::PlainObjectBase,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &); +template void igl::copyleft::cgal::outer_hull_legacy,class Eigen::Matrix,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix >(class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/outer_hull.h b/vendor/libigl/include/igl/copyleft/cgal/outer_hull.h new file mode 100644 index 0000000000000000000000000000000000000000..191a8d49276aad56d545f2186cde402d9ab29a95 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/outer_hull.h @@ -0,0 +1,84 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_OUTER_HULL_H +#define IGL_COPYLEFT_CGAL_OUTER_HULL_H +#include "../../igl_inline.h" +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Compute the "outer hull" of a piecewise constant winding number induce + // triangle mesh (V,F). + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // Outputs: + // HV #HV by 3 list of output vertex positions + // HF #HF by 3 list of output triangle indices into HV + // J #HF list of indices into F + // flip #HF list of whether facet was flipped when added to HF + // + template < + typename DerivedV, + typename DerivedF, + typename DerivedHV, + typename DerivedHF, + typename DerivedJ, + typename Derivedflip> + IGL_INLINE void outer_hull( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & HV, + Eigen::PlainObjectBase & HF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & flip); + // Compute the "outer hull" of a potentially non-manifold mesh (V,F) whose + // intersections have been "resolved" (e.g. using `cork` or + // `igl::copyleft::cgal::selfintersect`). The outer hull is defined to be all facets + // (regardless of orientation) for which there exists some path from infinity + // to the face without intersecting any other facets. For solids, this is the + // surface of the solid. In general this includes any thin "wings" or + // "flaps". This implementation largely follows Section 3.6 of "Direct + // repair of self-intersecting meshes" [Attene 2014]. + // + // Note: This doesn't require the input mesh to be piecewise constant + // winding number, but won't handle multiple non-nested connected + // components. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // Outputs: + // G #G by 3 list of output triangle indices into V + // J #G list of indices into F + // flip #F list of whether facet was added to G **and** flipped orientation + // (false for faces not added to G) + template < + typename DerivedV, + typename DerivedF, + typename DerivedG, + typename DerivedJ, + typename Derivedflip> + IGL_INLINE void outer_hull_legacy( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & flip); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "outer_hull.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/peel_outer_hull_layers.cpp b/vendor/libigl/include/igl/copyleft/cgal/peel_outer_hull_layers.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2af7e7806520918cef78504b40f3f04baf8a4977 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/peel_outer_hull_layers.cpp @@ -0,0 +1,127 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "peel_outer_hull_layers.h" +#include "outer_hull.h" +#include "../../LinSpaced.h" +#include +#include +//#define IGL_PEEL_OUTER_HULL_LAYERS_DEBUG +#ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG +#include "../../writePLY.h" +#include "../../writeDMAT.h" +#include "../../STR.h" +#endif + +template < + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename Derivedflip> +IGL_INLINE size_t igl::copyleft::cgal::peel_outer_hull_layers( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & flip) +{ + using namespace Eigen; + using namespace std; + typedef typename DerivedF::Index Index; + typedef Matrix MatrixXF; + typedef Matrix MatrixXI; + typedef Matrix MatrixXflip; + const Index m = F.rows(); +#ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG + cout<<"peel outer hull layers..."<(m,0,m-1); + // This is O(n * layers) + MatrixXI P(m,1); + Index iter = 0; + while(Fr.size() > 0) + { + assert(Fr.rows() == IM.rows()); + // Compute outer hull of current Fr + MatrixXF Fo; + MatrixXI Jo; + MatrixXflip flipr; +#ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG + { + cout<<"calling outer hull..." << iter < in_outer(Fr.rows(),false); + for(Index g = 0;g +#include +template unsigned long igl::copyleft::cgal::peel_outer_hull_layers, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template size_t igl::copyleft::cgal::peel_outer_hull_layers, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template unsigned __int64 igl::copyleft::cgal::peel_outer_hull_layers,-1,-1,0,-1,-1>,class Eigen::Matrix,class Eigen::Matrix,class Eigen::Matrix >(class Eigen::PlainObjectBase,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase > const &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/peel_outer_hull_layers.h b/vendor/libigl/include/igl/copyleft/cgal/peel_outer_hull_layers.h new file mode 100644 index 0000000000000000000000000000000000000000..ee2752b296de7d5ace84499112175ec61cff25c2 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/peel_outer_hull_layers.h @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_PEEL_OUTER_HULL_LAYERS_H +#define IGL_COPYLEFT_CGAL_PEEL_OUTER_HULL_LAYERS_H +#include "../../igl_inline.h" +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Computes necessary generic information for boolean operations by + // successively "peeling" off the "outer hull" of a mesh (V,F) resulting from + // "resolving" all (self-)intersections. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // Outputs: + // I #F list of which peel Iation a facet belongs + // flip #F list of whether a facet's orientation was flipped when facet + // "peeled" into its associated outer hull layer. + // Returns number of peels + template < + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename Derivedflip> + IGL_INLINE size_t peel_outer_hull_layers( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & flip); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "peel_outer_hull_layers.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/peel_winding_number_layers.cpp b/vendor/libigl/include/igl/copyleft/cgal/peel_winding_number_layers.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2bb71a7800062e43b9b7d3b35be2db2912563223 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/peel_winding_number_layers.cpp @@ -0,0 +1,33 @@ +#include "peel_winding_number_layers.h" + +#include + +#include "propagate_winding_numbers.h" + +template< +typename DerivedV, +typename DerivedF, +typename DerivedW > +IGL_INLINE size_t igl::copyleft::cgal::peel_winding_number_layers( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase& W) { + const size_t num_faces = F.rows(); + Eigen::VectorXi labels(num_faces); + labels.setZero(); + + Eigen::MatrixXi winding_numbers; + igl::copyleft::cgal::propagate_winding_numbers(V, F, labels, winding_numbers); + assert(winding_numbers.rows() == num_faces); + assert(winding_numbers.cols() == 2); + + int min_w = winding_numbers.minCoeff(); + int max_w = winding_numbers.maxCoeff(); + assert(max_w > min_w); + + W.resize(num_faces, 1); + for (size_t i=0; i + +namespace igl { + namespace copyleft { + namespace cgal { + template< + typename DerivedV, + typename DerivedF, + typename DerivedW > + IGL_INLINE size_t peel_winding_number_layers( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase& W); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "peel_winding_number_layers.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/piecewise_constant_winding_number.cpp b/vendor/libigl/include/igl/copyleft/cgal/piecewise_constant_winding_number.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6d053c35817ddc145f2451cfe3040320dca248f9 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/piecewise_constant_winding_number.cpp @@ -0,0 +1,33 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "piecewise_constant_winding_number.h" +#include "../../piecewise_constant_winding_number.h" +#include "remesh_self_intersections.h" +#include +#include + +template < typename DerivedV, typename DerivedF> +IGL_INLINE bool igl::copyleft::cgal::piecewise_constant_winding_number( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F) +{ + Eigen::Matrix VV; + Eigen::Matrix FF; + Eigen::Matrix IF; + Eigen::Matrix J; + Eigen::Matrix UIM,IM; + // resolve intersections + remesh_self_intersections(V,F,{false,false,true},VV,FF,IF,J,IM); + return igl::piecewise_constant_winding_number(FF); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::piecewise_constant_winding_number, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/piecewise_constant_winding_number.h b/vendor/libigl/include/igl/copyleft/cgal/piecewise_constant_winding_number.h new file mode 100644 index 0000000000000000000000000000000000000000..2b93913b333b1168ada7b29bfc359adabd2c5c8f --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/piecewise_constant_winding_number.h @@ -0,0 +1,41 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_PIECEWISE_CONSTANT_WINDING_NUMBER_H +#define IGL_COPYLEFT_CGAL_PIECEWISE_CONSTANT_WINDING_NUMBER_H +#include "../../igl_inline.h" +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // PIECEWISE_CONSTANT_WINDING_NUMBER Determine if a given mesh induces a + // piecewise constant winding number field: Is this mesh valid input to + // solid set operations. + // + // Inputs: + // V #V by 3 list of mesh vertex positions + // F #F by 3 list of triangle indices into V + // Returns true if the mesh _combinatorially_ induces a piecewise + // constant winding number field. + template < + typename DerivedV, + typename DerivedF> + IGL_INLINE bool piecewise_constant_winding_number( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase& F); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "piecewise_constant_winding_number.cpp" +#endif +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_areas.cpp b/vendor/libigl/include/igl/copyleft/cgal/point_areas.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7b3f9be1439053cba25c9cd6e79c2c05530dec3e --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_areas.cpp @@ -0,0 +1,186 @@ +#include "point_areas.h" +#include "delaunay_triangulation.h" + +#include "../../colon.h" +#include "../../slice.h" +#include "../../slice_mask.h" +#include "../../parallel_for.h" + +#include "CGAL/Exact_predicates_inexact_constructions_kernel.h" +#include "CGAL/Triangulation_vertex_base_with_info_2.h" +#include "CGAL/Triangulation_data_structure_2.h" +#include "CGAL/Delaunay_triangulation_2.h" + + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Triangulation_vertex_base_with_info_2 Vb; +typedef CGAL::Triangulation_data_structure_2 Tds; +typedef CGAL::Delaunay_triangulation_2 Delaunay; +typedef Kernel::Point_2 Point; + +namespace igl { + namespace copyleft{ + namespace cgal{ + + template + IGL_INLINE void point_areas( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& I, + const Eigen::MatrixBase& N, + Eigen::PlainObjectBase & A) + { + Eigen::MatrixXd T; + point_areas(P,I,N,A,T); + } + + + template + IGL_INLINE void point_areas( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& I, + const Eigen::MatrixBase& N, + Eigen::PlainObjectBase & A, + Eigen::PlainObjectBase & T) + { + typedef typename DerivedP::Scalar real; + typedef typename DerivedN::Scalar scalarN; + typedef typename DerivedA::Scalar scalarA; + typedef Eigen::Matrix RowVec3; + typedef Eigen::Matrix RowVec2; + + typedef Eigen::Matrix MatrixP; + typedef Eigen::Matrix MatrixN; + typedef Eigen::Matrix VecotorO; + typedef Eigen::Matrix MatrixI; + + + + const int n = P.rows(); + + assert(P.cols() == 3 && "P must have exactly 3 columns"); + assert(P.rows() == N.rows() + && "P and N must have the same number of rows"); + assert(P.rows() == I.rows() + && "P and I must have the same number of rows"); + + A.setZero(n,1); + T.setZero(n,3); + igl::parallel_for(P.rows(),[&](int i) + { + MatrixI neighbor_index = I.row(i); + MatrixP neighbors; + igl::slice(P,neighbor_index,1,neighbors); + if(N.rows() && neighbors.rows() > 1){ + MatrixN neighbor_normals; + igl::slice(N,neighbor_index,1,neighbor_normals); + Eigen::Matrix poi_normal = neighbor_normals.row(0); + Eigen::Matrix dotprod = + poi_normal(0)*neighbor_normals.col(0) + + poi_normal(1)*neighbor_normals.col(1) + + poi_normal(2)*neighbor_normals.col(2); + Eigen::Array keep = dotprod.array() > 0; + igl::slice_mask(Eigen::MatrixXd(neighbors),keep,1,neighbors); + } + if(neighbors.rows() <= 2){ + A(i) = 0; + } else { + //subtract the mean from neighbors, then take svd, + //the scores will be U*S. This is our pca plane fitting + RowVec3 mean = neighbors.colwise().mean(); + MatrixP mean_centered = neighbors.rowwise() - mean; + Eigen::JacobiSVD svd(mean_centered, + Eigen::ComputeThinU | Eigen::ComputeThinV); + MatrixP scores = svd.matrixU() * svd.singularValues().asDiagonal(); + + T.row(i) = svd.matrixV().col(2).transpose(); + if(T.row(i).dot(N.row(i)) < 0){ + T.row(i) *= -1; + } + + MatrixP plane; + igl::slice(scores,igl::colon(0,scores.rows()-1), + igl::colon(0,1),plane); + + std::vector< std::pair > points; + //This is where we obtain a delaunay triangulation of the points + for(unsigned iter = 0; iter < plane.rows(); iter++){ + points.push_back( std::make_pair( + Point(plane(iter,0),plane(iter,1)), iter ) ); + } + Delaunay triangulation; + triangulation.insert(points.begin(),points.end()); + Eigen::MatrixXi F(triangulation.number_of_faces(),3); + int f_row = 0; + for(Delaunay::Finite_faces_iterator fit = + triangulation.finite_faces_begin(); + fit != triangulation.finite_faces_end(); ++fit) { + Delaunay::Face_handle face = fit; + F.row(f_row) = Eigen::RowVector3i((int)face->vertex(0)->info(), + (int)face->vertex(1)->info(), + (int)face->vertex(2)->info()); + f_row++; + } + + //Here we calculate the voronoi area of the point + scalarA area_accumulator = 0; + for(int f = 0; f < F.rows(); f++){ + int X = -1; + for(int face_iter = 0; face_iter < 3; face_iter++){ + if(F(f,face_iter) == 0){ + X = face_iter; + } + } + if(X >= 0){ + //Triangle XYZ with X being the point we want the area of + int Y = (X+1)%3; + int Z = (X+2)%3; + scalarA x = (plane.row(F(f,Y))-plane.row(F(f,Z))).norm(); + scalarA y = (plane.row(F(f,X))-plane.row(F(f,Z))).norm(); + scalarA z = (plane.row(F(f,Y))-plane.row(F(f,X))).norm(); + scalarA cosX = (z*z + y*y - x*x)/(2*y*z); + scalarA cosY = (z*z + x*x - y*y)/(2*x*z); + scalarA cosZ = (x*x + y*y - z*z)/(2*y*x); + Eigen::Matrix barycentric; + barycentric << x*cosX, y*cosY, z*cosZ; + barycentric /= (barycentric(0)+barycentric(1)+barycentric(2)); + + //TODO: to make numerically stable, reorder so that x≥y≥z: + scalarA full_area = 0.25*std::sqrt( + (x+(y+z))*(z-(x-y))*(z+(x-y))*(x+(y-z))); + Eigen::Matrix partial_area = + barycentric * full_area; + if(cosX < 0){ + area_accumulator += 0.5*full_area; + } else if (cosY < 0 || cosZ < 0){ + area_accumulator += 0.25*full_area; + } else { + area_accumulator += (partial_area(1) + partial_area(2))/2; + } + } + } + + if(std::isfinite(area_accumulator)){ + A(i) = area_accumulator; + } else { + A(i) = 0; + } + } + },1000); + } + } + } +} + + + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::point_areas, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_areas.h b/vendor/libigl/include/igl/copyleft/cgal/point_areas.h new file mode 100644 index 0000000000000000000000000000000000000000..7614d3ecc73025bd2b6bd5861c831b5ead17d253 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_areas.h @@ -0,0 +1,80 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Gavin Barill +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/ + +#ifndef IGL_POINT_AREAS_H +#define IGL_POINT_AREAS_H +#include "../../igl_inline.h" +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given a 3D set of points P, each with a list of k-nearest-neighbours, + // estimate the geodesic voronoi area associated with each point. + // + // The k nearest neighbours may be known from running igl::knn_octree on + // the output data from igl::octree. We reccomend using a k value + // between 15 and 20 inclusive for accurate area estimation. + // + // N is used filter the neighbours, to ensure area estimation only occurs + // using neighbors that are on the same side of the surface (ie for thin + // sheets), as well as to solve the orientation ambiguity of the tangent + // plane normal. + // + // Note: This function *should* be implemented by pre-filtering I, rather + // than filtering in this function using N. In this case, the function + // would only take P and I as input. + // + // Inputs: + // P #P by 3 list of point locations + // I #P by k list of k-nearest-neighbor indices into P + // N #P by 3 list of point normals + // Outputs: + // A #P list of estimated areas + // + // See also: igl::knn + template + IGL_INLINE void point_areas( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& I, + const Eigen::MatrixBase& N, + Eigen::PlainObjectBase & A); + + // This version can be used to output the tangent plane normal at each + // point. Since we area already fitting a plane to each point's neighbour + // set, the tangent plane normals come "for free" + // + // Inputs: + // P #P by 3 list of point locations + // I #P by k list of k-nearest-neighbor indices into P + // N #P by 3 list of point normals + // Outputs: + // A #P list of estimated areas + // T #P by 3 list of tangent plane normals for each point + template + IGL_INLINE void point_areas( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& I, + const Eigen::MatrixBase& N, + Eigen::PlainObjectBase & A, + Eigen::PlainObjectBase & T); + + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "point_areas.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_mesh_squared_distance.cpp b/vendor/libigl/include/igl/copyleft/cgal/point_mesh_squared_distance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e36306991799f453ea933444f700ada9a16bcf6d --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_mesh_squared_distance.cpp @@ -0,0 +1,142 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "point_mesh_squared_distance.h" +#include "mesh_to_cgal_triangle_list.h" +#include "assign_scalar.h" + +template < + typename Kernel, + typename DerivedP, + typename DerivedV, + typename DerivedF, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> +IGL_INLINE void igl::copyleft::cgal::point_mesh_squared_distance( + const Eigen::PlainObjectBase & P, + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) +{ + using namespace std; + typedef CGAL::Triangle_3 Triangle_3; + typedef typename std::vector::iterator Iterator; + typedef CGAL::AABB_triangle_primitive Primitive; + typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_tree Tree; + Tree tree; + vector T; + point_mesh_squared_distance_precompute(V,F,tree,T); + return point_mesh_squared_distance(P,tree,T,sqrD,I,C); +} + +template +IGL_INLINE void igl::copyleft::cgal::point_mesh_squared_distance_precompute( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + CGAL::AABB_tree< + CGAL::AABB_traits >::iterator + > + > + > & tree, + std::vector > & T) +{ + using namespace std; + + typedef CGAL::Triangle_3 Triangle_3; + typedef CGAL::Point_3 Point_3; + typedef typename std::vector::iterator Iterator; + typedef CGAL::AABB_triangle_primitive Primitive; + typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_tree Tree; + + // Must be 3D + assert(V.cols() == 3); + // Must be triangles + assert(F.cols() == 3); + + // WTF ALERT!!!! + // + // There's a bug in clang probably or at least in cgal. Without calling this + // line (I guess invoking some compilation from ), clang will vomit + // errors inside CGAL. + // + // http://stackoverflow.com/questions/27748442/is-clangs-c11-support-reliable + T.reserve(0); + + // Make list of cgal triangles + mesh_to_cgal_triangle_list(V,F,T); + tree.clear(); + tree.insert(T.begin(),T.end()); + tree.accelerate_distance_queries(); + // accelerate_distance_queries doesn't seem actually to do _all_ of the + // precomputation. the tree (despite being const) will still do more + // precomputation and reorganizing on the first call of `closest_point` or + // `closest_point_and_primitive`. Therefore, call it once here. + tree.closest_point_and_primitive(Point_3(0,0,0)); +} + +template < + typename Kernel, + typename DerivedP, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> +IGL_INLINE void igl::copyleft::cgal::point_mesh_squared_distance( + const Eigen::PlainObjectBase & P, + const CGAL::AABB_tree< + CGAL::AABB_traits >::iterator + > + > + > & tree, + const std::vector > & T, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) +{ + typedef CGAL::Triangle_3 Triangle_3; + typedef typename std::vector::iterator Iterator; + typedef CGAL::AABB_triangle_primitive Primitive; + typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_tree Tree; + typedef typename Tree::Point_and_primitive_id Point_and_primitive_id; + typedef CGAL::Point_3 Point_3; + assert(P.cols() == 3); + const int n = P.rows(); + sqrD.resize(n,1); + I.resize(n,1); + C.resize(n,P.cols()); + for(int p = 0;p < n;p++) + { + Point_3 query(P(p,0),P(p,1),P(p,2)); + // Find closest point and primitive id + Point_and_primitive_id pp = tree.closest_point_and_primitive(query); + Point_3 closest_point = pp.first; + assign_scalar(closest_point[0],C(p,0)); + assign_scalar(closest_point[1],C(p,1)); + assign_scalar(closest_point[2],C(p,2)); + assign_scalar((closest_point-query).squared_length(),sqrD(p)); + I(p) = pp.second - T.begin(); + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::point_mesh_squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::point_mesh_squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::point_mesh_squared_distance, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, 1, 0, -1, 1>, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::point_mesh_squared_distance_precompute, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> >&, std::vector >, std::allocator > > >&); +template void igl::copyleft::cgal::point_mesh_squared_distance_precompute, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> >&, std::vector >, std::allocator > > >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_mesh_squared_distance.h b/vendor/libigl/include/igl/copyleft/cgal/point_mesh_squared_distance.h new file mode 100644 index 0000000000000000000000000000000000000000..b525bddda2bb4bf36c1ffeacd89e0c617047e309 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_mesh_squared_distance.h @@ -0,0 +1,104 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_POINT_MESH_SQUARED_DISTANCE_H +#define IGL_COPYLEFT_CGAL_POINT_MESH_SQUARED_DISTANCE_H +#include "../../igl_inline.h" +#include +#include +#include "CGAL_includes.hpp" +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Compute distances from a set of points P to a triangle mesh (V,F) + // + // Templates: + // Kernal CGAL computation and construction kernel (e.g. + // CGAL::Simple_cartesian) + // Inputs: + // P #P by 3 list of query point positions + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices + // Outputs: + // sqrD #P list of smallest squared distances + // I #P list of facet indices corresponding to smallest distances + // C #P by 3 list of closest points + // + // Known bugs: This only computes distances to triangles. So unreferenced + // vertices and degenerate triangles (segments) are ignored. + template < + typename Kernel, + typename DerivedP, + typename DerivedV, + typename DerivedF, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> + IGL_INLINE void point_mesh_squared_distance( + const Eigen::PlainObjectBase & P, + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C); + // Probably can do this in a way that we don't pass around `tree` and `T` + // + // Outputs: + // tree CGAL's AABB tree + // T list of CGAL triangles in order of F (for determining which was found + // in computation) + template < + typename Kernel, + typename DerivedV, + typename DerivedF + > + IGL_INLINE void point_mesh_squared_distance_precompute( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + CGAL::AABB_tree< + CGAL::AABB_traits >::iterator + > + > + > & tree, + std::vector > & T); + // Inputs: + // see above + // Outputs: + // see above + template < + typename Kernel, + typename DerivedP, + typename DerivedsqrD, + typename DerivedI, + typename DerivedC> + IGL_INLINE void point_mesh_squared_distance( + const Eigen::PlainObjectBase & P, + const CGAL::AABB_tree< + CGAL::AABB_traits >::iterator + > + > + > & tree, + const std::vector > & T, + Eigen::PlainObjectBase & sqrD, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "point_mesh_squared_distance.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_segment_squared_distance.cpp b/vendor/libigl/include/igl/copyleft/cgal/point_segment_squared_distance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..257206ae6d32e36b20792532514a1fe612b29718 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_segment_squared_distance.cpp @@ -0,0 +1,41 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "point_segment_squared_distance.h" + +template < typename Kernel> +IGL_INLINE void igl::copyleft::cgal::point_segment_squared_distance( + const CGAL::Point_3 & P1, + const CGAL::Segment_3 & S2, + CGAL::Point_3 & P2, + typename Kernel::FT & d) +{ + if(S2.is_degenerate()) + { + P2 = S2.source(); + d = (P1-P2).squared_length(); + return; + } + // http://stackoverflow.com/a/1501725/148668 + const auto sqr_len = S2.squared_length(); + assert(sqr_len != 0); + const auto & V = S2.source(); + const auto & W = S2.target(); + const auto t = (P1-V).dot(W-V)/sqr_len; + if(t<0) + { + P2 = V; + }else if(t>1) + { + P2 = W; + }else + { + P2 = V + t*(W-V); + } + d = (P1-P2).squared_length(); +} + diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_segment_squared_distance.h b/vendor/libigl/include/igl/copyleft/cgal/point_segment_squared_distance.h new file mode 100644 index 0000000000000000000000000000000000000000..eac628b2ab8af6efd72f9a1fa7ae36ba3893aff7 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_segment_squared_distance.h @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_POINT_SEGMENT_SQUARED_DISTANCE_H +#define IGL_COPYLEFT_CGAL_POINT_SEGMENT_SQUARED_DISTANCE_H +#include "../../igl_inline.h" +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given a point P1 and segment S2 find the points on each of closest + // approach and the squared distance thereof. + // + // Inputs: + // P1 point + // S2 segment + // Outputs: + // P2 point on S2 closest to P1 + // d distance betwee P1 and S2 + template < typename Kernel> + IGL_INLINE void point_segment_squared_distance( + const CGAL::Point_3 & P1, + const CGAL::Segment_3 & S2, + CGAL::Point_3 & P2, + typename Kernel::FT & d + ); + + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "point_segment_squared_distance.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_solid_signed_squared_distance.cpp b/vendor/libigl/include/igl/copyleft/cgal/point_solid_signed_squared_distance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7aef2efd195750e24cec3401369819f232d2cc96 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_solid_signed_squared_distance.cpp @@ -0,0 +1,56 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "point_solid_signed_squared_distance.h" +#include "points_inside_component.h" +#include "point_mesh_squared_distance.h" +#include "../../list_to_matrix.h" +#include "../../slice_mask.h" +#include +#include + +template < + typename DerivedQ, + typename DerivedVB, + typename DerivedFB, + typename DerivedD> +IGL_INLINE void igl::copyleft::cgal::point_solid_signed_squared_distance( + const Eigen::PlainObjectBase & Q, + const Eigen::PlainObjectBase & VB, + const Eigen::PlainObjectBase & FB, + Eigen::PlainObjectBase & D) +{ + // compute unsigned distances + Eigen::VectorXi I; + DerivedVB C; + point_mesh_squared_distance(Q,VB,FB,D,I,C); + // Collect queries that have non-zero distance + Eigen::Array NZ = D.array()!=0; + // Compute sign for non-zero distance queries + DerivedQ QNZ; + slice_mask(Q,NZ,1,QNZ); + Eigen::Array DNZ; + igl::copyleft::cgal::points_inside_component(VB,FB,QNZ,DNZ); + // Apply sign to distances + DerivedD S = DerivedD::Zero(Q.rows(),1); + { + int k = 0; + for(int q = 0;q, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, 1, 0, -1, 1> >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_solid_signed_squared_distance.h b/vendor/libigl/include/igl/copyleft/cgal/point_solid_signed_squared_distance.h new file mode 100644 index 0000000000000000000000000000000000000000..845fad13385653d3ddd6d290279f0db69dc9b907 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_solid_signed_squared_distance.h @@ -0,0 +1,48 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_POINT_SOLID_SIGNED_SQUARED_DISTANCE_H +#define IGL_COPYLEFT_CGAL_POINT_SOLID_SIGNED_SQUARED_DISTANCE_H +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // POINT_SOLID_SIGNED_SQUARED_DISTANCE Given a set of points (Q) and the + // boundary mesh (VB,FB) of a solid (as defined in [Zhou et al. 2016], + // determine the signed squared distance for each point q in Q so that d(q,B) is + // negative if inside and positive if outside. + // + // Inputs: + // Q #Q by 3 list of query point positions + // VB #VB by 3 list of mesh vertex positions of B + // FB #FB by 3 list of mesh triangle indices into VB + // Outputs: + // D + template < + typename DerivedQ, + typename DerivedVB, + typename DerivedFB, + typename DerivedD> + IGL_INLINE void point_solid_signed_squared_distance( + const Eigen::PlainObjectBase & Q, + const Eigen::PlainObjectBase & VB, + const Eigen::PlainObjectBase & FB, + Eigen::PlainObjectBase & D); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "point_solid_signed_squared_distance.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_triangle_squared_distance.cpp b/vendor/libigl/include/igl/copyleft/cgal/point_triangle_squared_distance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ea29bc376f6c57960e2a473dfba8ea6927c4584 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_triangle_squared_distance.cpp @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "point_triangle_squared_distance.h" +#include +template < typename Kernel> +IGL_INLINE void point_triangle_squared_distance( + const CGAL::Point_3 & P1, + const CGAL::Triangle_3 & T2, + CGAL::Point_3 & P2, + typename Kernel::FT & d) +{ + assert(!T2.is_degenerate()); + if(T2.has_on(P1)) + { + P2 = P1; + d = 0; + return; + } + const auto proj_1 = T2.supporting_plane().projection(P2); + if(T2.has_on(proj_1)) + { + P2 = proj_1; + d = (proj_1-P1).squared_length(); + return; + } + // closest point must be on the boundary + bool first = true; + // loop over edges + for(int i=0;i<3;i++) + { + CGAL::Point_3 P2i; + typename Kernel::FT di; + const CGAL::Segment_3 si( T2.vertex(i+1), T2.vertex(i+2)); + point_segment_squared_distance(P1,si,P2i,di); + if(first || di < d) + { + first = false; + d = di; + P2 = P2i; + } + } +} diff --git a/vendor/libigl/include/igl/copyleft/cgal/point_triangle_squared_distance.h b/vendor/libigl/include/igl/copyleft/cgal/point_triangle_squared_distance.h new file mode 100644 index 0000000000000000000000000000000000000000..37b63adcbbaf6d94e15fbe1e206fce4475f23dc2 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/point_triangle_squared_distance.h @@ -0,0 +1,45 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_POINT_TRIANGLE_SQUARED_DISTANCE_H +#define IGL_COPYLEFT_CGAL_POINT_TRIANGLE_SQUARED_DISTANCE_H +#include "../../igl_inline.h" +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given a point P1 and triangle T2 find the points on each of closest + // approach and the squared distance thereof. + // + // Inputs: + // P1 point + // T2 triangle + // Outputs: + // P2 point on T2 closest to P1 + // d distance betwee P1 and T2 + template < typename Kernel> + IGL_INLINE void point_triangle_squared_distance( + const CGAL::Point_3 & P1, + const CGAL::Triangle_3 & T2, + CGAL::Point_3 & P2, + typename Kernel::FT & d + ); + + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "point_triangle_squared_distance.cpp" +#endif + +#endif + + diff --git a/vendor/libigl/include/igl/copyleft/cgal/points_inside_component.cpp b/vendor/libigl/include/igl/copyleft/cgal/points_inside_component.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1558e130d0e9e7f5d375e696d79fff6e844595d2 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/points_inside_component.cpp @@ -0,0 +1,350 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "points_inside_component.h" +#include "../../LinSpaced.h" +#include "order_facets_around_edge.h" +#include "assign_scalar.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + + +namespace igl { + namespace copyleft + { + namespace cgal { + namespace points_inside_component_helper { + typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; + typedef Kernel::Ray_3 Ray_3; + typedef Kernel::Point_3 Point_3; + typedef Kernel::Vector_3 Vector_3; + typedef Kernel::Triangle_3 Triangle; + typedef Kernel::Plane_3 Plane_3; + typedef std::vector::iterator Iterator; + typedef CGAL::AABB_triangle_primitive Primitive; + typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_tree Tree; + + template + void extract_adj_faces( + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const size_t s, const size_t d, + std::vector& adj_faces) { + const size_t num_faces = I.rows(); + for (size_t i=0; i + void extract_adj_vertices( + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const size_t v, std::vector& adj_vertices) { + std::set unique_adj_vertices; + const size_t num_faces = I.rows(); + for (size_t i=0; i + bool determine_point_edge_orientation( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Point_3& query, size_t s, size_t d) { + // Algorithm: + // + // Order the adj faces around the edge (s,d) clockwise using + // query point as pivot. (i.e. The first face of the ordering + // is directly after the pivot point, and the last face is + // directly before the pivot.) + // + // The point is outside if the first and last faces of the + // ordering forms a convex angle. This check can be done + // without any construction by looking at the orientation of the + // faces. The angle is convex iff the first face contains (s,d) + // as an edge and the last face contains (d,s) as an edge. + // + // The point is inside if the first and last faces of the + // ordering forms a concave angle. That is the first face + // contains (d,s) as an edge and the last face contains (s,d) as + // an edge. + // + // In the special case of duplicated faces. I.e. multiple faces + // sharing the same 3 corners, but not necessarily the same + // orientation. The ordering will always rank faces containing + // edge (s,d) before faces containing edge (d,s). + // + // Therefore, if there are any duplicates of the first faces, + // the ordering will always choose the one with edge (s,d) if + // possible. The same for the last face. + // + // In the very degenerated case where the first and last face + // are duplicates, but with different orientations, it is + // equally valid to think the angle formed by them is either 0 + // or 360 degrees. By default, 0 degree is used, and thus the + // query point is outside. + + std::vector adj_faces; + extract_adj_faces(F, I, s, d, adj_faces); + const size_t num_adj_faces = adj_faces.size(); + assert(num_adj_faces > 0); + + DerivedV pivot_point(1, 3); + igl::copyleft::cgal::assign_scalar(query.x(), pivot_point(0, 0)); + igl::copyleft::cgal::assign_scalar(query.y(), pivot_point(0, 1)); + igl::copyleft::cgal::assign_scalar(query.z(), pivot_point(0, 2)); + Eigen::VectorXi order; + order_facets_around_edge(V, F, s, d, + adj_faces, pivot_point, order); + assert((size_t)order.size() == num_adj_faces); + if (adj_faces[order[0]] > 0 && + adj_faces[order[num_adj_faces-1] < 0]) { + return true; + } else if (adj_faces[order[0]] < 0 && + adj_faces[order[num_adj_faces-1] > 0]) { + return false; + } else { + throw "The input mesh does not represent a valid volume"; + } + throw "The input mesh does not represent a valid volume"; + return false; + } + + template + bool determine_point_vertex_orientation( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Point_3& query, size_t s) { + std::vector adj_vertices; + extract_adj_vertices(F, I, s, adj_vertices); + const size_t num_adj_vertices = adj_vertices.size(); + + std::vector adj_points; + for (size_t i=0; i bool{ + size_t positive=0; + size_t negative=0; + size_t coplanar=0; + for (const auto& point : adj_points) { + switch(separator.oriented_side(point)) { + case CGAL::ON_POSITIVE_SIDE: + positive++; + break; + case CGAL::ON_NEGATIVE_SIDE: + negative++; + break; + case CGAL::ON_ORIENTED_BOUNDARY: + coplanar++; + break; + default: + throw "Unknown plane-point orientation"; + } + } + auto query_orientation = separator.oriented_side(query); + bool r = + (positive == 0 && query_orientation == CGAL::POSITIVE) + || + (negative == 0 && query_orientation == CGAL::NEGATIVE); + return r; + }; + + size_t d = std::numeric_limits::max(); + Point_3 p(V(s,0), V(s,1), V(s,2)); + for (size_t i=0; i (size_t)V.rows()) { + // All adj faces are coplanar, use the first edge. + d = adj_vertices[0]; + } + return determine_point_edge_orientation(V, F, I, query, s, d); + } + + template + bool determine_point_face_orientation( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Point_3& query, size_t fid) { + // Algorithm: A point is on the inside of a face if the + // tetrahedron formed by them is negatively oriented. + + Eigen::Vector3i f = F.row(I(fid, 0)); + const Point_3 v0(V(f[0], 0), V(f[0], 1), V(f[0], 2)); + const Point_3 v1(V(f[1], 0), V(f[1], 1), V(f[1], 2)); + const Point_3 v2(V(f[2], 0), V(f[2], 1), V(f[2], 2)); + auto result = CGAL::orientation(v0, v1, v2, query); + if (result == CGAL::COPLANAR) { + throw "Cannot determine inside/outside because query point lies exactly on the input surface."; + } + return result == CGAL::NEGATIVE; + } + } + } + } +} + +template +IGL_INLINE void igl::copyleft::cgal::points_inside_component( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Eigen::PlainObjectBase& P, + Eigen::PlainObjectBase& inside) { + using namespace igl::copyleft::cgal::points_inside_component_helper; + if (F.rows() <= 0 || I.rows() <= 0) { + throw "Inside check cannot be done on empty facet component."; + } + + const size_t num_faces = I.rows(); + std::vector triangles; + for (size_t i=0; i ElementType{ + const Eigen::Vector3i f = F.row(I(fid, 0)); + const Point_3 p0(V(f[0], 0), V(f[0], 1), V(f[0], 2)); + const Point_3 p1(V(f[1], 0), V(f[1], 1), V(f[1], 2)); + const Point_3 p2(V(f[2], 0), V(f[2], 1), V(f[2], 2)); + + if (p == p0) { element_index = 0; return VERTEX; } + if (p == p1) { element_index = 1; return VERTEX; } + if (p == p2) { element_index = 2; return VERTEX; } + if (CGAL::collinear(p0, p1, p)) { element_index = 2; return EDGE; } + if (CGAL::collinear(p1, p2, p)) { element_index = 0; return EDGE; } + if (CGAL::collinear(p2, p0, p)) { element_index = 1; return EDGE; } + + element_index = 0; + return FACE; + }; + + const size_t num_queries = P.rows(); + inside.resize(num_queries, 1); + for (size_t i=0; i +IGL_INLINE void igl::copyleft::cgal::points_inside_component( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& P, + Eigen::PlainObjectBase& inside) { + Eigen::VectorXi I = igl::LinSpaced(F.rows(), 0, F.rows()-1); + igl::copyleft::cgal::points_inside_component(V, F, I, P, inside); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::points_inside_component, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Array >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::points_inside_component< Eigen::Matrix, Eigen::Matrix< int, -1, -1, 0, -1, -1>, Eigen::Matrix< int, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix< int, -1, -1, 0, -1, -1> > ( Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::points_inside_component< Eigen::Matrix, Eigen::Matrix< int, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix< int, -1, -1, 0, -1, -1> > ( Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::points_inside_component, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix >(Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::points_inside_component, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::points_inside_component, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::points_inside_component, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/points_inside_component.h b/vendor/libigl/include/igl/copyleft/cgal/points_inside_component.h new file mode 100644 index 0000000000000000000000000000000000000000..f213544557ae42d821114cbcfc9cf2707d6dbfca --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/points_inside_component.h @@ -0,0 +1,71 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_POINTS_INSIDE_COMPONENTS +#define IGL_COPYLEFT_CGAL_POINTS_INSIDE_COMPONENTS + +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal { + + // Determine if queries points P are inside of connected facet component + // (V, F, I), where I indicates a subset of facets that forms the + // component. + // + // Precondition: + // The input mesh must be a closed, self-intersection free, + // non-degenerated surface. Queries points must be either inside or + // outside of the mesh (i.e. not on the surface of the mesh). + // + // Inputs: + // V #V by 3 array of vertex positions. + // F #F by 3 array of triangles. + // I #I list of triangle indices to consider. + // P #P by 3 array of query points. + // + // Outputs: + // inside #P list of booleans that is true iff the corresponding + // query point is inside of the mesh. + template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename DerivedP, + typename DerivedB> + IGL_INLINE void points_inside_component( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + const Eigen::PlainObjectBase& P, + Eigen::PlainObjectBase& inside); + + // Determine if query points P is inside of the mesh (V, F). + // See above for precondition and I/O specs. + template< + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DerivedB> + IGL_INLINE void points_inside_component( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& P, + Eigen::PlainObjectBase& inside); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +#include "points_inside_component.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/polyhedron_to_mesh.cpp b/vendor/libigl/include/igl/copyleft/cgal/polyhedron_to_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..88ceb3e302bb53efa16c442efd0cbfb20408a77e --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/polyhedron_to_mesh.cpp @@ -0,0 +1,72 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "polyhedron_to_mesh.h" +#include +#include "assign_scalar.h" + +template < + typename Polyhedron, + typename DerivedV, + typename DerivedF> +IGL_INLINE void igl::copyleft::cgal::polyhedron_to_mesh( + const Polyhedron & poly, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F) +{ + using namespace std; + V.resize(poly.size_of_vertices(),3); + F.resize(poly.size_of_facets(),3); + typedef typename Polyhedron::Vertex_const_iterator Vertex_iterator; + std::map vertex_to_index; + { + size_t v = 0; + for( + typename Polyhedron::Vertex_const_iterator p = poly.vertices_begin(); + p != poly.vertices_end(); + p++) + { + assign_scalar(p->point().x(),V(v,0)); + assign_scalar(p->point().y(),V(v,1)); + assign_scalar(p->point().z(),V(v,2)); + vertex_to_index[p] = v; + v++; + } + } + { + size_t f = 0; + for( + typename Polyhedron::Facet_const_iterator facet = poly.facets_begin(); + facet != poly.facets_end(); + ++facet) + { + typename Polyhedron::Halfedge_around_facet_const_circulator he = + facet->facet_begin(); + // Facets in polyhedral surfaces are at least triangles. + assert(CGAL::circulator_size(he) == 3 && "Facets should be triangles"); + size_t c = 0; + do { + //// This is stooopidly slow + // F(f,c) = std::distance(poly.vertices_begin(), he->vertex()); + F(f,c) = vertex_to_index[he->vertex()]; + c++; + } while ( ++he != facet->facet_begin()); + f++; + } + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +#include +#include +#include +template void igl::copyleft::cgal::polyhedron_to_mesh >, Eigen::Matrix, Eigen::Matrix >(CGAL::Polyhedron_3 > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::polyhedron_to_mesh >, Eigen::Matrix, Eigen::Matrix >(CGAL::Polyhedron_3 > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::polyhedron_to_mesh,CGAL::Polyhedron_items_with_id_3, CGAL::HalfedgeDS_default, std::allocator >, Eigen::Matrix, Eigen::Matrix >(CGAL::Polyhedron_3,CGAL::Polyhedron_items_with_id_3, CGAL::HalfedgeDS_default, std::allocator > const&,Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/polyhedron_to_mesh.h b/vendor/libigl/include/igl/copyleft/cgal/polyhedron_to_mesh.h new file mode 100644 index 0000000000000000000000000000000000000000..3f8c66a888d01c5c0a7accb2a821f6a990458a7c --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/polyhedron_to_mesh.h @@ -0,0 +1,43 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_POLYHEDRON_TO_MESH_H +#define IGL_COPYLEFT_CGAL_POLYHEDRON_TO_MESH_H +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Convert a CGAL Polyhedron to a mesh (V,F) + // + // Templates: + // Polyhedron CGAL Polyhedron type (e.g. Polyhedron_3) + // Inputs: + // poly cgal polyhedron + // Outputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices + template < + typename Polyhedron, + typename DerivedV, + typename DerivedF> + IGL_INLINE void polyhedron_to_mesh( + const Polyhedron & poly, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "polyhedron_to_mesh.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/projected_cdt.cpp b/vendor/libigl/include/igl/copyleft/cgal/projected_cdt.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f34352c6643fab88453b32801f9fa997b309e765 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/projected_cdt.cpp @@ -0,0 +1,82 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "projected_cdt.h" +#include "insert_into_cdt.h" +#include "assign_scalar.h" +#include "../../list_to_matrix.h" +template +IGL_INLINE void igl::copyleft::cgal::projected_cdt( + const std::vector & objects, + const CGAL::Plane_3 & P, + std::vector >& vertices, + std::vector >& faces) +{ + typedef CGAL::Triangulation_vertex_base_2 TVB_2; + typedef CGAL::Constrained_triangulation_face_base_2 CTFB_2; + typedef CGAL::Triangulation_data_structure_2 TDS_2; + typedef CGAL::Exact_intersections_tag Itag; + typedef CGAL::Constrained_Delaunay_triangulation_2 CDT_2; + typedef CGAL::Constrained_triangulation_plus_2 CDT_plus_2; + CDT_plus_2 cdt; + for(const auto & obj : objects) insert_into_cdt(obj,P,cdt); + // Read off vertices of the cdt, remembering index + std::map v2i; + size_t count=0; + for ( + auto itr = cdt.finite_vertices_begin(); + itr != cdt.finite_vertices_end(); + itr++) + { + vertices.push_back(P.to_3d(itr->point())); + v2i[itr] = count; + count++; + } + // Read off faces and store index triples + for ( + auto itr = cdt.finite_faces_begin(); + itr != cdt.finite_faces_end(); + itr++) + { + faces.push_back( + { v2i[itr->vertex(0)], v2i[itr->vertex(1)], v2i[itr->vertex(2)] }); + } +} + +template < typename Kernel, typename DerivedV, typename DerivedF> +IGL_INLINE void igl::copyleft::cgal::projected_cdt( + const std::vector & objects, + const CGAL::Plane_3 & P, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F) +{ + std::vector > vertices; + std::vector > faces; + projected_cdt(objects,P,vertices,faces); + V.resize(vertices.size(),3); + for(int v = 0;v(std::vector > const&, CGAL::Plane_3 const&, std::vector, std::allocator > >&, std::vector >, std::allocator > > >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::projected_cdt(std::vector > const&, CGAL::Plane_3 const&, std::vector, std::allocator > >&, std::vector >, std::allocator > > >&); +#include +#ifdef WIN32 +template void igl::copyleft::cgal::projected_cdt(class std::vector> const &, class CGAL::Plane_3 const &, class std::vector, class std::allocator>> &, class std::vector>, class std::allocator>>> &); +template void igl::copyleft::cgal::projected_cdt(class std::vector> const &, class CGAL::Plane_3 const &, class std::vector, class std::allocator>> &, class std::vector>, class std::allocator>>> &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/projected_cdt.h b/vendor/libigl/include/igl/copyleft/cgal/projected_cdt.h new file mode 100644 index 0000000000000000000000000000000000000000..a161cc4503406c7a51d5af56c3d176593413f9f3 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/projected_cdt.h @@ -0,0 +1,61 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_PROJECTED_CDT_H +#define IGL_COPYLEFT_CGAL_PROJECTED_CDT_H +#include "../../igl_inline.h" +#include +#include +#include +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given a list of objects (e.g., resulting from intersecting a triangle + // with many other triangles), construct a constrained Delaunay + // triangulation on a given plane (P), by inersting constraints for each + // object projected onto that plane. + // + // Inputs: + // objects list of objects. This should lie on the given plane (P), + // otherwise they are added to the cdt _after_ their non-trivial + // projection + // P plane upon which all objects lie and upon which the CDT is + // conducted + // Outputs: + // vertices list of vertices of the CDT mesh _back on the 3D plane_ + // faces list of list of triangle indices into vertices + // + template + IGL_INLINE void projected_cdt( + const std::vector & objects, + const CGAL::Plane_3 & P, + std::vector >& vertices, + std::vector >& faces); + // Outputs: + // V #V by 3 list of vertices of the CDT mesh _back on the 3D plane_, + // **cast** from the number type of Kernel to the number type of + // DerivedV + // F #F by 3 list of triangle indices into V + template < typename Kernel, typename DerivedV, typename DerivedF> + IGL_INLINE void projected_cdt( + const std::vector & objects, + const CGAL::Plane_3 & P, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "projected_cdt.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/projected_delaunay.cpp b/vendor/libigl/include/igl/copyleft/cgal/projected_delaunay.cpp new file mode 100644 index 0000000000000000000000000000000000000000..52ea4927456c1e6ad730230f16219a07a139faf4 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/projected_delaunay.cpp @@ -0,0 +1,106 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "projected_delaunay.h" +#include "../../REDRUM.h" +#include +#include + +#if CGAL_VERSION_NR < 1040611000 +# warning "CGAL Version < 4.6.1 may result in crashes. Please upgrade CGAL" +#endif + +template +IGL_INLINE void igl::copyleft::cgal::projected_delaunay( + const CGAL::Triangle_3 & A, + const std::vector & A_objects_3, + CGAL::Constrained_triangulation_plus_2< + CGAL::Constrained_Delaunay_triangulation_2< + Kernel, + CGAL::Triangulation_data_structure_2< + CGAL::Triangulation_vertex_base_2, + CGAL::Constrained_triangulation_face_base_2 >, + CGAL::Exact_intersections_tag> > & cdt) +{ + using namespace std; + // 3D Primitives + typedef CGAL::Point_3 Point_3; + typedef CGAL::Segment_3 Segment_3; + typedef CGAL::Triangle_3 Triangle_3; + typedef CGAL::Plane_3 Plane_3; + //typedef CGAL::Tetrahedron_3 Tetrahedron_3; + typedef CGAL::Point_2 Point_2; + //typedef CGAL::Segment_2 Segment_2; + //typedef CGAL::Triangle_2 Triangle_2; + typedef CGAL::Triangulation_vertex_base_2 TVB_2; + typedef CGAL::Constrained_triangulation_face_base_2 CTFB_2; + typedef CGAL::Triangulation_data_structure_2 TDS_2; + typedef CGAL::Exact_intersections_tag Itag; + typedef CGAL::Constrained_Delaunay_triangulation_2 + CDT_2; + typedef CGAL::Constrained_triangulation_plus_2 CDT_plus_2; + + // http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Triangulation_2/Chapter_main.html#Section_2D_Triangulations_Constrained_Plus + // Plane of triangle A + Plane_3 P(A.vertex(0),A.vertex(1),A.vertex(2)); + // Insert triangle into vertices + typename CDT_plus_2::Vertex_handle corners[3]; + typedef size_t Index; + for(Index i = 0;i<3;i++) + { + const Point_3 & p3 = A.vertex(i); + const Point_2 & p2 = P.to_2d(p3); + typename CDT_plus_2::Vertex_handle corner = cdt.insert(p2); + corners[i] = corner; + } + // Insert triangle edges as constraints + for(Index i = 0;i<3;i++) + { + cdt.insert_constraint( corners[(i+1)%3], corners[(i+2)%3]); + } + // Insert constraints for intersection objects + for( const auto & obj : A_objects_3) + { + if(const Segment_3 *iseg = CGAL::object_cast(&obj)) + { + // Add segment constraint + cdt.insert_constraint(P.to_2d(iseg->vertex(0)),P.to_2d(iseg->vertex(1))); + }else if(const Point_3 *ipoint = CGAL::object_cast(&obj)) + { + // Add point + cdt.insert(P.to_2d(*ipoint)); + } else if(const Triangle_3 *itri = CGAL::object_cast(&obj)) + { + // Add 3 segment constraints + cdt.insert_constraint(P.to_2d(itri->vertex(0)),P.to_2d(itri->vertex(1))); + cdt.insert_constraint(P.to_2d(itri->vertex(1)),P.to_2d(itri->vertex(2))); + cdt.insert_constraint(P.to_2d(itri->vertex(2)),P.to_2d(itri->vertex(0))); + } else if(const std::vector *polyp = + CGAL::object_cast< std::vector >(&obj)) + { + //cerr< & poly = *polyp; + const Index m = poly.size(); + assert(m>=2); + for(Index p = 0;p(CGAL::Triangle_3 const&, std::vector > const&, CGAL::Constrained_triangulation_plus_2 >, CGAL::Constrained_triangulation_face_base_2 > > >, CGAL::Exact_intersections_tag> >&); +template void igl::copyleft::cgal::projected_delaunay(CGAL::Triangle_3 const&, std::vector > const&, CGAL::Constrained_triangulation_plus_2 >, CGAL::Constrained_triangulation_face_base_2 > > >, CGAL::Exact_intersections_tag> >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/projected_delaunay.h b/vendor/libigl/include/igl/copyleft/cgal/projected_delaunay.h new file mode 100644 index 0000000000000000000000000000000000000000..ee72305cdde1fcb172a5af002d7e5dece17b3265 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/projected_delaunay.h @@ -0,0 +1,46 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_PROJECTED_DELAUNAY_H +#define IGL_COPYLEFT_CGAL_PROJECTED_DELAUNAY_H +#include "../../igl_inline.h" +#include "CGAL_includes.hpp" +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Compute 2D delaunay triangulation of a given 3d triangle and a list of + // intersection objects (points,segments,triangles). CGAL uses an affine + // projection rather than an isometric projection, so we're not guaranteed + // that the 2D delaunay triangulation here will be a delaunay triangulation + // in 3D. + // + // Inputs: + // A triangle in 3D + // A_objects_3 updated list of intersection objects for A + // Outputs: + // cdt Contrained delaunay triangulation in projected 2D plane + template + IGL_INLINE void projected_delaunay( + const CGAL::Triangle_3 & A, + const std::vector & A_objects_3, + CGAL::Constrained_triangulation_plus_2< + CGAL::Constrained_Delaunay_triangulation_2< + Kernel, + CGAL::Triangulation_data_structure_2< + CGAL::Triangulation_vertex_base_2, + CGAL::Constrained_triangulation_face_base_2 >, + CGAL::Exact_intersections_tag> > & cdt); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "projected_delaunay.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/propagate_winding_numbers.cpp b/vendor/libigl/include/igl/copyleft/cgal/propagate_winding_numbers.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7de9d98d264eada78443a00f3cb3dab58b6e40ca --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/propagate_winding_numbers.cpp @@ -0,0 +1,324 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#include "propagate_winding_numbers.h" +#include "../../extract_manifold_patches.h" +#include "../../extract_non_manifold_edge_curves.h" +#include "../../facet_components.h" +#include "../../unique_edge_map.h" +#include "../../piecewise_constant_winding_number.h" +#include "../../writeOBJ.h" +#include "../../writePLY.h" +#include "../../get_seconds.h" +#include "../../LinSpaced.h" +#include "order_facets_around_edge.h" +#include "outer_facet.h" +#include "closest_facet.h" +#include "assign.h" +#include "extract_cells.h" +#include "cell_adjacency.h" + +#include +#include +#include +#include +#include + +//#define PROPAGATE_WINDING_NUMBER_TIMING + +template< + typename DerivedV, + typename DerivedF, + typename DerivedL, + typename DerivedW> +IGL_INLINE bool igl::copyleft::cgal::propagate_winding_numbers( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& labels, + Eigen::PlainObjectBase& W) +{ +#ifdef PROPAGATE_WINDING_NUMBER_TIMING + const auto & tictoc = []() -> double + { + static double t_start = igl::get_seconds(); + double diff = igl::get_seconds()-t_start; + t_start += diff; + return diff; + }; + const auto log_time = [&](const std::string& label) -> void { + std::cout << "propagate_winding_num." << label << ": " + << tictoc() << std::endl; + }; + tictoc(); +#endif + + Eigen::MatrixXi E, uE; + Eigen::VectorXi EMAP; + std::vector > uE2E; + igl::unique_edge_map(F, E, uE, EMAP, uE2E); + + Eigen::VectorXi P; + const size_t num_patches = igl::extract_manifold_patches(F, EMAP, uE2E, P); + + DerivedW per_patch_cells; + const size_t num_cells = + igl::copyleft::cgal::extract_cells( + V, F, P, E, uE, uE2E, EMAP, per_patch_cells); +#ifdef PROPAGATE_WINDING_NUMBER_TIMING + log_time("cell_extraction"); +#endif + + return propagate_winding_numbers(V, F, + uE, uE2E, + num_patches, P, + num_cells, per_patch_cells, + labels, W); +} + + +template< + typename DerivedV, + typename DerivedF, + typename DeriveduE, + typename uE2EType, + typename DerivedP, + typename DerivedC, + typename DerivedL, + typename DerivedW> +IGL_INLINE bool igl::copyleft::cgal::propagate_winding_numbers( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + const size_t num_patches, + const Eigen::PlainObjectBase& P, + const size_t num_cells, + const Eigen::PlainObjectBase& C, + const Eigen::PlainObjectBase& labels, + Eigen::PlainObjectBase& W) +{ +#ifdef PROPAGATE_WINDING_NUMBER_TIMING + const auto & tictoc = []() -> double + { + static double t_start = igl::get_seconds(); + double diff = igl::get_seconds()-t_start; + t_start += diff; + return diff; + }; + const auto log_time = [&](const std::string& label) -> void { + std::cout << "propagate_winding_num." << label << ": " + << tictoc() << std::endl; + }; + tictoc(); +#endif + + bool valid = true; + // https://github.com/libigl/libigl/issues/674 + if (!igl::piecewise_constant_winding_number(F, uE, uE2E)) + { + assert(false && "Input mesh is not PWN"); + std::cerr << "Input mesh is not PWN!" << std::endl; + valid = false; + } + + const size_t num_faces = F.rows(); + typedef std::tuple CellConnection; + std::vector > cell_adj; + igl::copyleft::cgal::cell_adjacency(C, num_cells, cell_adj); +#ifdef PROPAGATE_WINDING_NUMBER_TIMING + log_time("cell_connectivity"); +#endif + + auto save_cell = [&](const std::string& filename, size_t cell_id) -> void{ + std::vector faces; + for (size_t i=0; i std::list { + std::list path; + path.push_back(idx); + while ((size_t)parents[path.back()] != path.back()) { + path.push_back(parents[path.back()]); + } + return path; + }; + for (size_t i=0; i Q; + Q.push(i); + parents[i] = i; + while (!Q.empty()) { + size_t curr_idx = Q.front(); + Q.pop(); + int curr_label = cell_labels[curr_idx]; + for (const auto& neighbor : cell_adj[curr_idx]) { + if (cell_labels[std::get<0>(neighbor)] == 0) + { + cell_labels[std::get<0>(neighbor)] = curr_label * -1; + Q.push(std::get<0>(neighbor)); + parents[std::get<0>(neighbor)] = curr_idx; + } else + { + if (cell_labels[std::get<0>(neighbor)] != curr_label * -1) + { + std::cerr << "Odd cell cycle detected!" << std::endl; + auto path = trace_parents(curr_idx); + path.reverse(); + auto path2 = trace_parents(std::get<0>(neighbor)); + path.insert(path.end(), path2.begin(), path2.end()); + for (auto cell_id : path) + { + std::cout << cell_id << " "; + std::stringstream filename; + filename << "cell_" << cell_id << ".ply"; + save_cell(filename.str(), cell_id); + } + std::cout << std::endl; + valid = false; + } + // Do not fail when odd cycle is detected because the resulting + // integer winding number field, although inconsistent, may still + // be used if the problem region is local and embedded within a + // valid volume. + //assert(cell_labels[std::get<0>(neighbor)] == curr_label * -1); + } + } + } + } + } +#ifdef PROPAGATE_WINDING_NUMBER_TIMING + log_time("odd_cycle_check"); +#endif + } +#endif + + size_t outer_facet; + bool flipped; + Eigen::VectorXi I = igl::LinSpaced(num_faces, 0, num_faces-1); + igl::copyleft::cgal::outer_facet(V, F, I, outer_facet, flipped); +#ifdef PROPAGATE_WINDING_NUMBER_TIMING + log_time("outer_facet"); +#endif + + const size_t outer_patch = P[outer_facet]; + const size_t infinity_cell = C(outer_patch, flipped?1:0); + + Eigen::VectorXi patch_labels(num_patches); + const int INVALID = std::numeric_limits::max(); + patch_labels.setConstant(INVALID); + for (size_t i=0; i Q; + Q.push(infinity_cell); + while (!Q.empty()) { + size_t curr_cell = Q.front(); + Q.pop(); + for (const auto& neighbor : cell_adj[curr_cell]) { + size_t neighbor_cell, patch_idx; + bool direction; + std::tie(neighbor_cell, direction, patch_idx) = neighbor; + if ((per_cell_W.row(neighbor_cell).array() == INVALID).any()) { + per_cell_W.row(neighbor_cell) = per_cell_W.row(curr_cell); + for (size_t i=0; i, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, unsigned long, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, unsigned long, Eigen::PlainObjectBase > const&, unsigned long, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::copyleft::cgal::propagate_winding_numbers, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, unsigned long, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector >, std::allocator > > > const&, unsigned long, Eigen::PlainObjectBase > const&, unsigned long, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template bool igl::copyleft::cgal::propagate_winding_numbers, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template bool igl::copyleft::cgal::propagate_winding_numbers, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, unsigned __int64, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class std::vector>, class std::allocator>>> const &, unsigned __int64, class Eigen::PlainObjectBase> const &, unsigned __int64, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> &); +template bool igl::copyleft::cgal::propagate_winding_numbers, -1, -1, 1, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, unsigned __int64, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix>(class Eigen::PlainObjectBase, -1, -1, 1, -1, -1>> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class std::vector>, class std::allocator>>> const &, unsigned __int64, class Eigen::PlainObjectBase> const &, unsigned __int64, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> const &, class Eigen::PlainObjectBase> &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/propagate_winding_numbers.h b/vendor/libigl/include/igl/copyleft/cgal/propagate_winding_numbers.h new file mode 100644 index 0000000000000000000000000000000000000000..77d8e7666b0c316b6189c7005289f7c3badbc3aa --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/propagate_winding_numbers.h @@ -0,0 +1,103 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLEFT_CGAL_PROPAGATE_WINDING_NUMBERS_H +#define IGL_COPYLEFT_CGAL_PROPAGATE_WINDING_NUMBERS_H +#include "../../igl_inline.h" +#include +#include + +// The following methods compute the winding number on each side of each facet +// or patch of a 3D mesh. The input mesh is valid if it splits the ambient +// space, R^3, into subspaces with constant integer winding numbers. That is +// the input mesh should be closed and for each directed edge the number of +// clockwise facing facets should equal the number of counterclockwise facing +// facets. + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // TODO: This shouldn't need to be in igl::copyleft::cgal, it should + // instead take as input an index of the ambient cell and the winding + // number vector there. + // + // Compute winding number on each side of the face. The input mesh + // could contain multiple connected components. The input mesh must + // represent the boundary of a valid 3D volume, which means it is + // closed, consistently oriented and induces integer winding numbers. + // + // Inputs: + // V #V by 3 list of vertex positions. + // F #F by 3 list of triangle indices into V. + // labels #F list of facet labels ranging from 0 to k-1. + // Output: + // W #F by k*2 list of winding numbers. ``W(i,j*2)`` is the winding + // number on the positive side of facet ``i`` with respect to the + // facets labeled ``j``. Similarly, ``W(i,j*2+1)`` is the winding + // number on the negative side of facet ``i`` with respect to the + // facets labeled ``j``. + // Returns true iff the input induces a piecewise-constant winding number + // field. + template< + typename DerivedV, + typename DerivedF, + typename DerivedL, + typename DerivedW> + IGL_INLINE bool propagate_winding_numbers( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& labels, + Eigen::PlainObjectBase& W); + + // Inputs: + // V #V by 3 list of vertex positions. + // F #F by 3 list of triangle indices into V. + // uE #uE by 2 list of vertex_indices, represents undirected edges. + // uE2E #uE list of lists that maps uE to E. (a one-to-many map) + // num_patches number of patches + // P #F list of patch ids. + // num_cells number of cells + // C #P by 2 list of cell ids on each side of each patch. + // labels #F list of facet labels ranging from 0 to k-1. + // Output: + // W #F by k*2 list of winding numbers. ``W(i,j*2)`` is the winding + // number on the positive side of facet ``i`` with respect to the + // facets labeled ``j``. Similarly, ``W(i,j*2+1)`` is the winding + // number on the negative side of facet ``i`` with respect to the + // facets labeled ``j``. + template< + typename DerivedV, + typename DerivedF, + typename DeriveduE, + typename uE2EType, + typename DerivedP, + typename DerivedC, + typename DerivedL, + typename DerivedW> + IGL_INLINE bool propagate_winding_numbers( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& uE, + const std::vector >& uE2E, + const size_t num_patches, + const Eigen::PlainObjectBase& P, + const size_t num_cells, + const Eigen::PlainObjectBase& C, + const Eigen::PlainObjectBase& labels, + Eigen::PlainObjectBase& W); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "propagate_winding_numbers.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/read_triangle_mesh.cpp b/vendor/libigl/include/igl/copyleft/cgal/read_triangle_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..24ebbb127edd301f299fec46aedbf49f43bf6f16 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/read_triangle_mesh.cpp @@ -0,0 +1,26 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "read_triangle_mesh.h" +#include "assign.h" +#include "../../read_triangle_mesh.h" + +template +IGL_INLINE bool igl::copyleft::cgal::read_triangle_mesh( + const std::string str, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& F) +{ + Eigen::MatrixXd Vd; + bool ret = igl::read_triangle_mesh(str,Vd,F); + if(ret) + { + assign(Vd,V); + } + return ret; +} diff --git a/vendor/libigl/include/igl/copyleft/cgal/read_triangle_mesh.h b/vendor/libigl/include/igl/copyleft/cgal/read_triangle_mesh.h new file mode 100644 index 0000000000000000000000000000000000000000..c1dae2a22d22de53d93690eba88a91db17631a78 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/read_triangle_mesh.h @@ -0,0 +1,42 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_READ_TRIANGLE_MESH_H +#define IGL_COPYLEFT_CGAL_READ_TRIANGLE_MESH_H +#include "../../igl_inline.h" + +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Simple wrapper, reads floating point precision but assigns to + // DerivedV::Scalar which may be a CGAL type + // + // Inputs: + // str path to file + // Outputs: + // V eigen double matrix #V by 3 + // F eigen int matrix #F by 3 + // Returns true iff success + template + IGL_INLINE bool read_triangle_mesh( + const std::string str, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& F); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "read_triangle_mesh.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/relabel_small_immersed_cells.cpp b/vendor/libigl/include/igl/copyleft/cgal/relabel_small_immersed_cells.cpp new file mode 100644 index 0000000000000000000000000000000000000000..993e009ec660e0e709798c4191a773874e95b7dd --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/relabel_small_immersed_cells.cpp @@ -0,0 +1,117 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// + +#include "relabel_small_immersed_cells.h" +#include "../../centroid.h" +#include "assign.h" +#include "cell_adjacency.h" + +#include + +template< + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DerivedC, + typename FT, + typename DerivedW> +IGL_INLINE void igl::copyleft::cgal::relabel_small_immersed_cells( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const size_t num_patches, + const Eigen::PlainObjectBase& P, + const size_t num_cells, + const Eigen::PlainObjectBase& C, + const FT vol_threashold, + Eigen::PlainObjectBase& W) +{ + const size_t num_vertices = V.rows(); + const size_t num_faces = F.rows(); + typedef std::tuple CellConnection; + std::vector > cell_adj; + igl::copyleft::cgal::cell_adjacency(C, num_cells, cell_adj); + + Eigen::MatrixXd VV; + assign(V,VV); + + auto compute_cell_volume = [&](size_t cell_id) { + std::vector is_involved(num_patches, 0); + for (size_t i=0; i involved_positive_faces; + std::vector involved_negative_faces; + for (size_t i=0; i cell_volumes(num_cells); + for (size_t i=0; i cell_values(num_cells); + for (size_t i=0; i= vol_threashold) continue; + std::set neighbor_values; + const auto neighbors = cell_adj[i]; + for (const auto& entry : neighbors) { + const auto& j = std::get<0>(entry); + neighbor_values.insert(cell_values[j]); + } + // If cell i is immersed, assign its value to be the immersed value. + if (neighbor_values.size() == 1) { + cell_values[i] = *neighbor_values.begin(); + } + } + + for (size_t i=0; i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_RELABEL_SMALL_IMMERSED_CELLS +#define IGL_RELABEL_SMALL_IMMERSED_CELLS + +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Inputs: + // V #V by 3 list of vertex positions. + // F #F by 3 list of triangle indices into V. + // num_patches number of patches + // P #F list of patch ids. + // num_cells number of cells + // C #P by 2 list of cell ids on each side of each patch. + // vol_threshold Volume threshold, cells smaller than this + // and is completely immersed will be relabeled. + // + // In/Output: + // W #F by 2 cell labels. W(i,0) is the label on the positive side of + // face i, W(i,1) is the label on the negative side of face i. W + // will be modified in place by this method. + template< + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DerivedC, + typename FT, + typename DerivedW> + IGL_INLINE void relabel_small_immersed_cells( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const size_t num_patches, + const Eigen::PlainObjectBase& P, + const size_t num_cells, + const Eigen::PlainObjectBase& C, + const FT vol_threashold, + Eigen::PlainObjectBase& W); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "relabel_small_immersed_cells.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/remesh_intersections.cpp b/vendor/libigl/include/igl/copyleft/cgal/remesh_intersections.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b45126c4c9f9bac4d617ceb171c3a9beca596a8f --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/remesh_intersections.cpp @@ -0,0 +1,545 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#include "remesh_intersections.h" +#include "assign_scalar.h" +#include "projected_cdt.h" +#include "../../get_seconds.h" +#include "../../parallel_for.h" +#include "../../LinSpaced.h" +#include "../../unique_rows.h" + +#include +#include +#include +#include +#include + +//#define REMESH_INTERSECTIONS_TIMING + +template < + typename DerivedV, + typename DerivedF, + typename Kernel, + typename DerivedVV, + typename DerivedFF, + typename DerivedJ, + typename DerivedIM> +IGL_INLINE void igl::copyleft::cgal::remesh_intersections( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const std::vector > & T, + const std::map< + typename DerivedF::Index, + std::vector< + std::pair > > & offending, + Eigen::PlainObjectBase & VV, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM) +{ + // by default, no stitching + igl::copyleft::cgal::remesh_intersections(V,F,T,offending,false,VV,FF,J,IM); +} + +template < + typename DerivedV, + typename DerivedF, + typename Kernel, + typename DerivedVV, + typename DerivedFF, + typename DerivedJ, + typename DerivedIM> +IGL_INLINE void igl::copyleft::cgal::remesh_intersections( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const std::vector > & T, + const std::map< + typename DerivedF::Index, + std::vector< + std::pair > > & offending, + bool stitch_all, + Eigen::PlainObjectBase & VV, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM) +{ + +#ifdef REMESH_INTERSECTIONS_TIMING + const auto & tictoc = []() -> double + { + static double t_start = igl::get_seconds(); + double diff = igl::get_seconds()-t_start; + t_start += diff; + return diff; + }; + const auto log_time = [&](const std::string& label) -> void { + std::cout << "remesh_intersections." << label << ": " + << tictoc() << std::endl; + }; + tictoc(); +#endif + + typedef CGAL::Point_3 Point_3; + typedef CGAL::Segment_3 Segment_3; + typedef CGAL::Plane_3 Plane_3; + typedef CGAL::Triangulation_vertex_base_2 TVB_2; + typedef CGAL::Constrained_triangulation_face_base_2 CTFB_2; + typedef CGAL::Triangulation_data_structure_2 TDS_2; + typedef CGAL::Exact_intersections_tag Itag; + typedef CGAL::Constrained_Delaunay_triangulation_2 + CDT_2; + typedef CGAL::Constrained_triangulation_plus_2 CDT_plus_2; + + typedef typename DerivedF::Index Index; + typedef std::pair Edge; + struct EdgeHash { + size_t operator()(const Edge& e) const { + return (e.first * 805306457) ^ (e.second * 201326611); + } + }; + typedef std::unordered_map, EdgeHash > EdgeMap; + + const size_t num_faces = F.rows(); + const size_t num_base_vertices = V.rows(); + assert(num_faces == T.size()); + + std::vector is_offending(num_faces, false); + for (const auto itr : offending) + { + const auto& fid = itr.first; + is_offending[fid] = true; + } + + // Cluster overlaps so that co-planar clusters are resolved only once + std::unordered_map > intersecting_and_coplanar; + for (const auto itr : offending) + { + const auto& fi = itr.first; + const auto P = T[fi].supporting_plane(); + assert(!P.is_degenerate()); + for (const auto jtr : itr.second) + { + const auto& fj = jtr.first; + const auto& tj = T[fj]; + if (P.has_on(tj[0]) && P.has_on(tj[1]) && P.has_on(tj[2])) + { + auto loc = intersecting_and_coplanar.find(fi); + if (loc == intersecting_and_coplanar.end()) + { + intersecting_and_coplanar[fi] = {fj}; + } else + { + loc->second.push_back(fj); + } + } + } + } +#ifdef REMESH_INTERSECTIONS_TIMING + log_time("overlap_analysis"); +#endif + + std::vector > resolved_faces; + std::vector source_faces; + std::vector new_vertices; + EdgeMap edge_vertices; + // face_vertices: Given a face Index, find vertices inside the face + std::unordered_map> face_vertices; + + // Run constraint Delaunay triangulation on the plane. + // + // Inputs: + // P plane to triangulate upone + // involved_faces #F list of indices into triangle of involved faces + // Outputs: + // vertices #V list of vertex positions of output triangulation + // faces #F list of face indices into vertices of output triangulation + // + auto delaunay_triangulation = [&offending, &T]( + const Plane_3& P, + const std::vector& involved_faces, + std::vector& vertices, + std::vector >& faces) -> void + { + std::vector objects; + + CDT_plus_2 cdt; + // insert each face into a common cdt + for (const auto& fid : involved_faces) + { + const auto itr = offending.find(fid); + const auto& triangle = T[fid]; + objects.push_back(CGAL::make_object(triangle)); + if (itr == offending.end()) + { + continue; + } + for (const auto& index_obj : itr->second) + { + //const auto& ofid = index_obj.first; + const auto& obj = index_obj.second; + objects.push_back(obj); + } + } + projected_cdt(objects,P,vertices,faces); + }; + + // Given p on triangle indexed by ori_f, add point to list of vertices return index of p. + // + // Input: + // p point to search for + // ori_f index of triangle p is corner of + // Returns global index of vertex (dependent on whether stitch_all flag is + // set) + // + auto find_or_append_point = [&]( + const Point_3& p, + const size_t ori_f) -> Index + { + if (stitch_all) + { + // No need to check if p shared by multiple triangles because all shared + // vertices would be merged later on. + const size_t index = num_base_vertices + new_vertices.size(); + new_vertices.push_back(p); + return index; + } else + { + // Stitching triangles according to input connectivity. + // This step is potentially costly. + const auto& triangle = T[ori_f]; + const auto& f = F.row(ori_f).eval(); + + // Check if p is one of the triangle corners. + for (size_t i=0; i<3; i++) + { + if (p == triangle[i]) return f[i]; + } + + // Check if p is on one of the edges. + for (size_t i=0; i<3; i++) { + const Point_3 curr_corner = triangle[i]; + const Point_3 next_corner = triangle[(i+1)%3]; + const Segment_3 edge(curr_corner, next_corner); + if (edge.has_on(p)) { + const Index curr = f[i]; + const Index next = f[(i+1)%3]; + Edge key; + key.first = currsecond) { + if (p == new_vertices[vid - num_base_vertices]) { + return vid; + } + } + const size_t index = num_base_vertices + new_vertices.size(); + new_vertices.push_back(p); + itr->second.push_back(index); + return index; + } + } + } + + // p must be in the middle of the triangle. + auto & existing_face_vertices = face_vertices[ori_f]; + for(const auto vid : existing_face_vertices) { + if (p == new_vertices[vid - num_base_vertices]) { + return vid; + } + } + const size_t index = num_base_vertices + new_vertices.size(); + new_vertices.push_back(p); + existing_face_vertices.push_back(index); + return index; + } + }; + + // Determine the vertex indices for each corner of each output triangle. + // + // Inputs: + // vertices #V list of vertices of cdt + // faces #F list of list of face indices into vertices of cdt + // involved_faces list of involved faces on the plane of cdt + // Side effects: + // - add faces to resolved_faces + // - add corresponding original face to source_faces + // - + auto post_triangulation_process = [&]( + const std::vector& vertices, + const std::vector >& faces, + const std::vector& involved_faces) -> void + { + assert(involved_faces.size() > 0); + // for all faces of the cdt + for (const auto& f : faces) + { + const Point_3& v0 = vertices[f[0]]; + const Point_3& v1 = vertices[f[1]]; + const Point_3& v2 = vertices[f[2]]; + Point_3 center( + (v0[0] + v1[0] + v2[0]) / 3.0, + (v0[1] + v1[1] + v2[1]) / 3.0, + (v0[2] + v1[2] + v2[2]) / 3.0); + if (involved_faces.size() == 1) + { + // If only there is only one involved face, all sub-triangles must + // belong to it and have the correct orientation. + const auto& ori_f = involved_faces[0]; + std::vector corners(3); + corners[0] = find_or_append_point(v0, ori_f); + corners[1] = find_or_append_point(v1, ori_f); + corners[2] = find_or_append_point(v2, ori_f); + resolved_faces.emplace_back(corners); + source_faces.push_back(ori_f); + } else + { + for (const auto& ori_f : involved_faces) + { + const auto& triangle = T[ori_f]; + const Plane_3 P = triangle.supporting_plane(); + if (triangle.has_on(center)) { + std::vector corners(3); + corners[0] = find_or_append_point(v0, ori_f); + corners[1] = find_or_append_point(v1, ori_f); + corners[2] = find_or_append_point(v2, ori_f); + if (CGAL::orientation( + P.to_2d(v0), P.to_2d(v1), P.to_2d(v2)) + == CGAL::RIGHT_TURN) { + std::swap(corners[0], corners[1]); + } + resolved_faces.emplace_back(corners); + source_faces.push_back(ori_f); + } + } + } + } + }; + + // Process un-touched faces. + for (size_t i=0; i processed(num_faces, false); + std::vector > > cdt_inputs; + for (const auto itr : offending) + { + const auto fid = itr.first; + if (processed[fid]) continue; + processed[fid] = true; + + const auto loc = intersecting_and_coplanar.find(fid); + std::vector involved_faces; + if (loc == intersecting_and_coplanar.end()) + { + involved_faces.push_back(fid); + } else + { + std::queue Q; + Q.push(fid); + while (!Q.empty()) + { + const auto index = Q.front(); + involved_faces.push_back(index); + Q.pop(); + + const auto overlapping_faces = intersecting_and_coplanar.find(index); + assert(overlapping_faces != intersecting_and_coplanar.end()); + + for (const auto other_index : overlapping_faces->second) + { + if (processed[other_index]) continue; + processed[other_index] = true; + Q.push(other_index); + } + } + } + + Plane_3 P = T[fid].supporting_plane(); + cdt_inputs.emplace_back(P, involved_faces); + } +#ifdef REMESH_INTERSECTIONS_TIMING + log_time("preprocess"); +#endif + + const size_t num_cdts = cdt_inputs.size(); + std::vector > cdt_vertices(num_cdts); + std::vector > > cdt_faces(num_cdts); + + //// Not clear whether this is safe because of reference counting on Point_3 + //// objects... + //// + //// I tried it and got random segfaults (via MATLAB). Seems this is not + //// safe. + //igl::parallel_for(num_cdts,[&](int i) + for (size_t i=0; i + >(unique_vv.rows(), 0, unique_vv.rows()-1); + }else + { + // Vertices with the same coordinates would be represented by one vertex. + // The IM value of a vertex is the index of the representative vertex. + for (Index v=0; v<(Index)VV_size; v++) { + IM(v) = unique_to_vv[vv_to_unique[v]]; + } + } + +#ifdef REMESH_INTERSECTIONS_TIMING + log_time("store_results"); +#endif +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_intersections, -1, -1, 1, -1, -1>, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, -1, 1, -1, -1>, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, 8, 3, 0, 8, 3>, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, 8, 3, 0, 8, 3>, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_intersections, Eigen::Matrix, CGAL::Epick, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector, std::allocator > > const&, std::map::Index, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > >, std::less::Index>, std::allocator::Index const, std::vector::Index, CGAL::Object>, std::allocator::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template void igl::copyleft::cgal::remesh_intersections,class Eigen::Matrix,class CGAL::Epeck,class Eigen::Matrix,-1,-1,0,-1,-1>,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix >(class Eigen::MatrixBase > const &,class Eigen::MatrixBase > const &,class std::vector,class std::allocator > > const &,class std::map<__int64,class std::vector,class std::allocator > >,struct std::less<__int64>,class std::allocator,class std::allocator > > > > > const &,bool,class Eigen::PlainObjectBase,-1,-1,0,-1,-1> > &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &); +template void igl::copyleft::cgal::remesh_intersections,class Eigen::Matrix,class CGAL::Epick,class Eigen::Matrix,-1,-1,0,-1,-1>,class Eigen::Matrix,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix >(class Eigen::MatrixBase > const &,class Eigen::MatrixBase > const &,class std::vector,class std::allocator > > const &,class std::map<__int64,class std::vector,class std::allocator > >,struct std::less<__int64>,class std::allocator,class std::allocator > > > > > const &,bool,class Eigen::PlainObjectBase,-1,-1,0,-1,-1> > &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &,class Eigen::PlainObjectBase > &); +template void igl::copyleft::cgal::remesh_intersections, class Eigen::Matrix, class CGAL::Epeck, class Eigen::Matrix, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix>(class Eigen::MatrixBase> const &, class Eigen::MatrixBase> const &, class std::vector, class std::allocator>> const &, class std::map<__int64, class std::vector, class std::allocator>>, struct std::less<__int64>, class std::allocator, class std::allocator>>>>> const &, bool, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::remesh_intersections, class Eigen::Matrix, class CGAL::Epick, class Eigen::Matrix, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix>(class Eigen::MatrixBase> const &, class Eigen::MatrixBase> const &, class std::vector, class std::allocator>> const &, class std::map<__int64, class std::vector, class std::allocator>>, struct std::less<__int64>, class std::allocator, class std::allocator>>>>> const &, bool, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, class Eigen::Matrix, class CGAL::Epeck, class Eigen::Matrix, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix>(class Eigen::MatrixBase, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase> const &, class std::vector, class std::allocator>> const &, class std::map<__int64, class std::vector, class std::allocator>>, struct std::less<__int64>, class std::allocator, class std::allocator>>>>> const &, bool, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::remesh_intersections, -1, 3, 0, -1, 3>, class Eigen::Matrix, class CGAL::Epick, class Eigen::Matrix, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix>(class Eigen::MatrixBase, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase> const &, class std::vector, class std::allocator>> const &, class std::map<__int64, class std::vector, class std::allocator>>, struct std::less<__int64>, class std::allocator, class std::allocator>>>>> const &, bool, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/remesh_intersections.h b/vendor/libigl/include/igl/copyleft/cgal/remesh_intersections.h new file mode 100644 index 0000000000000000000000000000000000000000..2b6a44a578db56894cc8cb828756919e23e35863 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/remesh_intersections.h @@ -0,0 +1,94 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLEFT_CGAL_REMESH_INTERSECTIONS_H +#define IGL_COPYLEFT_CGAL_REMESH_INTERSECTIONS_H + +#include "../../igl_inline.h" +#include +#include "CGAL_includes.hpp" + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Remesh faces according to results of intersection detection and + // construction (e.g. from `igl::copyleft::cgal::intersect_other` or + // `igl::copyleft::cgal::SelfIntersectMesh`) + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // T #F list of cgal triangles + // offending #offending map taking face indices into F to pairs of order + // of first finding and list of intersection objects from all + // intersections + // stitch_all if true, merge all vertices with the same coordinate. + // Outputs: + // VV #VV by 3 list of vertex positions, if stitch_all = false then + // first #V vertices will always be V + // FF #FF by 3 list of triangle indices into V + // IF #intersecting face pairs by 2 list of intersecting face pairs, + // indexing F + // J #FF list of indices into F denoting birth triangle + // IM / stitch_all = true #VV list from 0 to #VV-1 + // \ stitch_all = false #VV list of indices into VV of unique vertices. + // + template < + typename DerivedV, + typename DerivedF, + typename Kernel, + typename DerivedVV, + typename DerivedFF, + typename DerivedJ, + typename DerivedIM> + IGL_INLINE void remesh_intersections( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const std::vector > & T, + const std::map< + typename DerivedF::Index, + std::vector< + std::pair > > & offending, + bool stitch_all, + Eigen::PlainObjectBase & VV, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM); + // Same as above except stitch_all is assumed "false" + template < + typename DerivedV, + typename DerivedF, + typename Kernel, + typename DerivedVV, + typename DerivedFF, + typename DerivedJ, + typename DerivedIM> + IGL_INLINE void remesh_intersections( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const std::vector > & T, + const std::map< + typename DerivedF::Index, + std::vector< + std::pair > > & offending, + Eigen::PlainObjectBase & VV, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "remesh_intersections.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/remesh_self_intersections.cpp b/vendor/libigl/include/igl/copyleft/cgal/remesh_self_intersections.cpp new file mode 100644 index 0000000000000000000000000000000000000000..48e2cbf28a7705fe85bb42d99fc485e309b4d256 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/remesh_self_intersections.cpp @@ -0,0 +1,114 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "remesh_self_intersections.h" +#include "SelfIntersectMesh.h" +#include "../../C_STR.h" +#include +#include + +template < + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> +IGL_INLINE void igl::copyleft::cgal::remesh_self_intersections( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const RemeshSelfIntersectionsParam & params, + Eigen::PlainObjectBase & VV, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & IF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM) +{ + using namespace std; + if(params.detect_only) + { + //// This is probably a terrible idea, but CGAL is throwing floating point + //// exceptions. + +//#ifdef __APPLE__ +//#define IGL_THROW_FPE 11 +// const auto & throw_fpe = [](int e) +// { +// throw "IGL_THROW_FPE"; +// }; +// signal(SIGFPE,throw_fpe); +//#endif + + typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; + typedef + SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM> + SelfIntersectMeshK; + SelfIntersectMeshK SIM(V,F,params,VV,FF,IF,J,IM); + +//#ifdef __APPLE__ +// signal(SIGFPE,SIG_DFL); +//#endif + + }else + { + typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; + typedef + SelfIntersectMesh< + Kernel, + DerivedV, + DerivedF, + DerivedVV, + DerivedFF, + DerivedIF, + DerivedJ, + DerivedIM> + SelfIntersectMeshK; + SelfIntersectMeshK SIM(V,F,params,VV,FF,IF,J,IM); + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_self_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::remesh_self_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, 8, 3, 0, 8, 3>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::remesh_self_intersections, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template void igl::copyleft::cgal::remesh_self_intersections, class Eigen::Matrix, class Eigen::Matrix, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix>(class Eigen::MatrixBase> const &, class Eigen::MatrixBase> const &, struct igl::copyleft::cgal::RemeshSelfIntersectionsParam const &, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +template void igl::copyleft::cgal::remesh_self_intersections, class Eigen::Matrix, class Eigen::Matrix, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix >(class Eigen::MatrixBase > const &, class Eigen::MatrixBase > const &, struct igl::copyleft::cgal::RemeshSelfIntersectionsParam const &, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > &, class Eigen::PlainObjectBase > &, class Eigen::PlainObjectBase > &, class Eigen::PlainObjectBase > &, class Eigen::PlainObjectBase > &); +template void igl::copyleft::cgal::remesh_self_intersections, -1, 3, 0, -1, 3>, class Eigen::Matrix, class Eigen::Matrix, -1, -1, 0, -1, -1>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix>(class Eigen::MatrixBase, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase> const &, struct igl::copyleft::cgal::RemeshSelfIntersectionsParam const &, class Eigen::PlainObjectBase, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &, class Eigen::PlainObjectBase> &); +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/remesh_self_intersections.h b/vendor/libigl/include/igl/copyleft/cgal/remesh_self_intersections.h new file mode 100644 index 0000000000000000000000000000000000000000..e8e8cc492a963d91b346aa35c3fb9a3bc1141fe3 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/remesh_self_intersections.h @@ -0,0 +1,81 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_REMESH_SELF_INTERSECTIONS_H +#define IGL_COPYLEFT_CGAL_REMESH_SELF_INTERSECTIONS_H +#include "../../igl_inline.h" +#include "RemeshSelfIntersectionsParam.h" + +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given a triangle mesh (V,F) compute a new mesh (VV,FF) which is the same + // as (V,F) except that any self-intersecting triangles in (V,F) have been + // subdivided (new vertices and face created) so that the self-intersection + // contour lies exactly on edges in (VV,FF). New vertices will appear in + // original faces or on original edges. New vertices on edges are "merged" + // only across original faces sharing that edge. This means that if the input + // triangle mesh is a closed manifold the output will be too. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices into V + // params struct of optional parameters + // Outputs: + // VV #VV by 3 list of vertex positions + // FF #FF by 3 list of triangle indices into VV + // IF #intersecting face pairs by 2 list of intersecting face pairs, + // indexing F + // J #FF list of indices into F denoting birth triangle + // IM #VV list of indices into VV of unique vertices. + // + // Known bugs: If an existing edge in (V,F) lies exactly on another face then + // any resulting additional vertices along that edge may not get properly + // connected so that the output mesh has the same global topology. This is + // because + // + // Example: + // // resolve intersections + // igl::copyleft::cgal::remesh_self_intersections(V,F,params,VV,FF,IF,J,IM); + // // _apply_ duplicate vertex mapping IM to FF + // for_each(FF.data(),FF.data()+FF.size(),[&IM](int & a){a=IM(a);}); + // // remove any vertices now unreferenced after duplicate mapping. + // igl::remove_unreferenced(VV,FF,SV,SF,UIM); + // // Now (SV,SF) is ready to extract outer hull + // igl::copyleft::cgal::outer_hull(SV,SF,G,J,flip); + // + template < + typename DerivedV, + typename DerivedF, + typename DerivedVV, + typename DerivedFF, + typename DerivedIF, + typename DerivedJ, + typename DerivedIM> + IGL_INLINE void remesh_self_intersections( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const RemeshSelfIntersectionsParam & params, + Eigen::PlainObjectBase & VV, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & IF, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "remesh_self_intersections.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/remove_unreferenced.cpp b/vendor/libigl/include/igl/copyleft/cgal/remove_unreferenced.cpp new file mode 100644 index 0000000000000000000000000000000000000000..03c8864cb84873fb1f446e460d7b7ea88090ea94 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/remove_unreferenced.cpp @@ -0,0 +1,20 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "../../remove_unreferenced.h" +#include +#include +#ifdef IGL_STATIC_LIBRARY +#undef IGL_STATIC_LIBRARY +#include "../../remove_unreferenced.cpp" +template void igl::remove_unreferenced, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::remove_unreferenced, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::remove_unreferenced, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::remove_unreferenced, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix, -1, 4, 0, -1, 4>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, 4, 0, -1, 4> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::remove_unreferenced, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::remove_unreferenced, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/resolve_intersections.cpp b/vendor/libigl/include/igl/copyleft/cgal/resolve_intersections.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1cac435af7a3ce7b151a15ae2903e744e092734b --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/resolve_intersections.cpp @@ -0,0 +1,96 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "resolve_intersections.h" +#include "subdivide_segments.h" +#include "row_to_point.h" +#include "../../unique.h" +#include "../../list_to_matrix.h" +#include +#include +#include +#include +#include + +template < + typename DerivedV, + typename DerivedE, + typename DerivedVI, + typename DerivedEI, + typename DerivedJ, + typename DerivedIM> +IGL_INLINE void igl::copyleft::cgal::resolve_intersections( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & VI, + Eigen::PlainObjectBase & EI, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM) +{ + using namespace Eigen; + using namespace igl; + using namespace std; + // Exact scalar type + typedef CGAL::Epeck K; + typedef K::FT EScalar; + typedef CGAL::Segment_2 Segment_2; + typedef CGAL::Point_2 Point_2; + typedef Matrix MatrixXE; + + // Convert vertex positions to exact kernel + MatrixXE VE(V.rows(),V.cols()); + for(int i = 0;i > steiner(m); + for(int i = 0;i(VE,E(i,0)),row_to_point(VE,E(i,1))); + steiner[i].push_back(si.vertex(0)); + steiner[i].push_back(si.vertex(1)); + for(int j = i+1;j(VE,E(j,0)),row_to_point(VE,E(j,1))); + // do they intersect? + if(CGAL::do_intersect(si,sj)) + { + CGAL::Object result = CGAL::intersection(si,sj); + if(const Point_2 * p = CGAL::object_cast(&result)) + { + steiner[i].push_back(*p); + steiner[j].push_back(*p); + // add intersection point + }else if(const Segment_2 * s = CGAL::object_cast(&result)) + { + // add both endpoints + steiner[i].push_back(s->vertex(0)); + steiner[j].push_back(s->vertex(0)); + steiner[i].push_back(s->vertex(1)); + steiner[j].push_back(s->vertex(1)); + }else + { + assert(false && "Unknown intersection type"); + } + } + } + } + + subdivide_segments(V,E,steiner,VI,EI,J,IM); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::resolve_intersections, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/resolve_intersections.h b/vendor/libigl/include/igl/copyleft/cgal/resolve_intersections.h new file mode 100644 index 0000000000000000000000000000000000000000..086ef1361d0e689d30d8332f05759b8bef81c1fb --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/resolve_intersections.h @@ -0,0 +1,51 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H +#define IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + // RESOLVE_INTERSECTIONS Given a list of possible intersecting segments with + // endpoints, split segments to overlap only at endpoints + // + // Inputs: + // V #V by 2 list of vertex positions + // E #E by 2 list of segment indices into V + // Outputs: + // VI #VI by 2 list of output vertex positions, copies of V are always + // the first #V vertices + // EI #EI by 2 list of segment indices into V, #EI ≥ #E + // J #EI list of indices into E revealing "parent segments" + // IM #VI list of indices into VV of unique vertices. + namespace cgal + { + template < + typename DerivedV, + typename DerivedE, + typename DerivedVI, + typename DerivedEI, + typename DerivedJ, + typename DerivedIM> + IGL_INLINE void resolve_intersections( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & VI, + Eigen::PlainObjectBase & EI, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "resolve_intersections.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/row_to_point.cpp b/vendor/libigl/include/igl/copyleft/cgal/row_to_point.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b6c940c162281af7eeb8cf9ac49dee93db728fa3 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/row_to_point.cpp @@ -0,0 +1,25 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "row_to_point.h" + +template < + typename Kernel, + typename DerivedV> +IGL_INLINE CGAL::Point_2 igl::copyleft::cgal::row_to_point( + const Eigen::PlainObjectBase & V, + const typename DerivedV::Index & i) +{ + return CGAL::Point_2(V(i,0),V(i,1)); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#include +#include +template CGAL::Point_2 igl::copyleft::cgal::row_to_point, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::Matrix, -1, -1, 0, -1, -1>::Index const&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/row_to_point.h b/vendor/libigl/include/igl/copyleft/cgal/row_to_point.h new file mode 100644 index 0000000000000000000000000000000000000000..54e27ad4f9da366e6f049d566aa77f244110de0c --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/row_to_point.h @@ -0,0 +1,38 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_ROW_TO_POINT_H +#define IGL_COPYLEFT_CGAL_ROW_TO_POINT_H +#include "../../igl_inline.h" +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Extract a row from V and treat as a 2D cgal point (only first two + // columns of V are used). + // + // Inputs: + // V #V by 2 list of vertex positions + // i row index + // Returns 2D cgal point + template < + typename Kernel, + typename DerivedV> + IGL_INLINE CGAL::Point_2 row_to_point( + const Eigen::PlainObjectBase & V, + const typename DerivedV::Index & i); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "row_to_point.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/segment_segment_squared_distance.cpp b/vendor/libigl/include/igl/copyleft/cgal/segment_segment_squared_distance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ca695995c85fc74d96b2f2dd65266135f0d07a0 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/segment_segment_squared_distance.cpp @@ -0,0 +1,129 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "segment_segment_squared_distance.h" +#include + +// http://geomalgorithms.com/a07-_distance.html +template < typename Kernel> +IGL_INLINE bool igl::copyleft::cgal::segment_segment_squared_distance( + const CGAL::Segment_3 & S1, + const CGAL::Segment_3 & S2, + CGAL::Point_3 & P1, + CGAL::Point_3 & P2, + typename Kernel::FT & dst) +{ + typedef CGAL::Point_3 Point_3; + typedef CGAL::Vector_3 Vector_3; + typedef typename Kernel::FT EScalar; + if(S1.is_degenerate()) + { + // All points on S1 are the same + P1 = S1.source(); + point_segment_squared_distance(P1,S2,P2,dst); + return true; + }else if(S2.is_degenerate()) + { + assert(!S1.is_degenerate()); + // All points on S2 are the same + P2 = S2.source(); + point_segment_squared_distance(P2,S1,P1,dst); + return true; + } + + assert(!S1.is_degenerate()); + assert(!S2.is_degenerate()); + + Vector_3 u = S1.target() - S1.source(); + Vector_3 v = S2.target() - S2.source(); + Vector_3 w = S1.source() - S2.source(); + + const auto a = u.dot(u); // always >= 0 + const auto b = u.dot(v); + const auto c = v.dot(v); // always >= 0 + const auto d = u.dot(w); + const auto e = v.dot(w); + const auto D = a*c - b*b; // always >= 0 + assert(D>=0); + const auto sc=D, sN=D, sD = D; // sc = sN / sD, default sD = D >= 0 + const auto tc=D, tN=D, tD = D; // tc = tN / tD, default tD = D >= 0 + + bool parallel = false; + // compute the line parameters of the two closest points + if (D==0) + { + // the lines are almost parallel + parallel = true; + sN = 0.0; // force using source point on segment S1 + sD = 1.0; // to prevent possible division by 0.0 later + tN = e; + tD = c; + } else + { + // get the closest points on the infinite lines + sN = (b*e - c*d); + tN = (a*e - b*d); + if (sN < 0.0) + { + // sc < 0 => the s=0 edge is visible + sN = 0.0; + tN = e; + tD = c; + } else if (sN > sD) + { // sc > 1 => the s=1 edge is visible + sN = sD; + tN = e + b; + tD = c; + } + } + + if (tN < 0.0) + { + // tc < 0 => the t=0 edge is visible + tN = 0.0; + // recompute sc for this edge + if (-d < 0.0) + { + sN = 0.0; + }else if (-d > a) + { + sN = sD; + }else + { + sN = -d; + sD = a; + } + }else if (tN > tD) + { + // tc > 1 => the t=1 edge is visible + tN = tD; + // recompute sc for this edge + if ((-d + b) < 0.0) + { + sN = 0; + }else if ((-d + b) > a) + { + sN = sD; + }else + { + sN = (-d + b); + sD = a; + } + } + // finally do the division to get sc and tc + sc = (abs(sN) == 0 ? 0.0 : sN / sD); + tc = (abs(tN) == 0 ? 0.0 : tN / tD); + + // get the difference of the two closest points + P1 = S1.source() + sc*(S1.target()-S1.source()); + P2 = S2.source() + sc*(S2.target()-S2.source()); + Vector_3 dP = w + (sc * u) - (tc * v); // = S1(sc) - S2(tc) + assert(dP == (P1-P2)); + + dst = dP.squared_length(); // return the closest distance + return parallel; +} diff --git a/vendor/libigl/include/igl/copyleft/cgal/segment_segment_squared_distance.h b/vendor/libigl/include/igl/copyleft/cgal/segment_segment_squared_distance.h new file mode 100644 index 0000000000000000000000000000000000000000..5bfbfdcab5892bf396e565f220ecba212245f820 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/segment_segment_squared_distance.h @@ -0,0 +1,46 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_SEGMENT_SEGMENT_SQUARED_DISTANCE_H +#define IGL_COPYLEFT_CGAL_SEGMENT_SEGMENT_SQUARED_DISTANCE_H +#include "../../igl_inline.h" +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given two segments S1 and S2 find the points on each of closest + // approach and the squared distance thereof. + // + // Inputs: + // S1 first segment + // S2 second segment + // Outputs: + // P1 point on S1 closest to S2 + // P2 point on S2 closest to S1 + // d distance betwee P1 and S2 + // Returns true if the closest approach is unique. + template < typename Kernel> + IGL_INLINE bool segment_segment_squared_distance( + const CGAL::Segment_3 & S1, + const CGAL::Segment_3 & S2, + CGAL::Point_3 & P1, + CGAL::Point_3 & P2, + typename Kernel::FT & d + ); + + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "segment_segment_squared_distance.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/signed_distance_isosurface.cpp b/vendor/libigl/include/igl/copyleft/cgal/signed_distance_isosurface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eeb6c03c5ba0678d84175d19a09f32263a25d3a3 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/signed_distance_isosurface.cpp @@ -0,0 +1,138 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "signed_distance_isosurface.h" +#include "point_mesh_squared_distance.h" +#include "complex_to_mesh.h" + +#include "../../AABB.h" +#include "../../per_face_normals.h" +#include "../../per_edge_normals.h" +#include "../../per_vertex_normals.h" +#include "../../centroid.h" +#include "../../WindingNumberAABB.h" + +#include +#include +#include +#include +#include +// Axis-aligned bounding box tree for tet tri intersection +#include +#include +#include +#include + +IGL_INLINE bool igl::copyleft::cgal::signed_distance_isosurface( + const Eigen::MatrixXd & IV, + const Eigen::MatrixXi & IF, + const double level, + const double angle_bound, + const double radius_bound, + const double distance_bound, + const SignedDistanceType sign_type, + Eigen::MatrixXd & V, + Eigen::MatrixXi & F) +{ + using namespace std; + using namespace Eigen; + + // default triangulation for Surface_mesher + typedef CGAL::Surface_mesh_default_triangulation_3 Tr; + // c2t3 + typedef CGAL::Complex_2_in_triangulation_3 C2t3; + typedef Tr::Geom_traits GT;//Kernel + typedef GT::Sphere_3 Sphere_3; + typedef GT::Point_3 Point_3; + typedef GT::FT FT; + typedef std::function Function; + typedef CGAL::Implicit_surface_3 Surface_3; + + AABB tree; + tree.init(IV,IF); + + Eigen::MatrixXd FN,VN,EN; + Eigen::MatrixXi E; + Eigen::VectorXi EMAP; + WindingNumberAABB< Eigen::Vector3d, Eigen::MatrixXd, Eigen::MatrixXi > hier; + switch(sign_type) + { + default: + assert(false && "Unknown SignedDistanceType"); + case SIGNED_DISTANCE_TYPE_UNSIGNED: + // do nothing + break; + case SIGNED_DISTANCE_TYPE_DEFAULT: + case SIGNED_DISTANCE_TYPE_WINDING_NUMBER: + hier.set_mesh(IV,IF); + hier.grow(); + break; + case SIGNED_DISTANCE_TYPE_PSEUDONORMAL: + // "Signed Distance Computation Using the Angle Weighted Pseudonormal" + // [Bærentzen & Aanæs 2005] + per_face_normals(IV,IF,FN); + per_vertex_normals(IV,IF,PER_VERTEX_NORMALS_WEIGHTING_TYPE_ANGLE,FN,VN); + per_edge_normals( + IV,IF,PER_EDGE_NORMALS_WEIGHTING_TYPE_UNIFORM,FN,EN,E,EMAP); + break; + } + + Tr tr; // 3D-Delaunay triangulation + C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation + // defining the surface + const auto & IVmax = IV.colwise().maxCoeff(); + const auto & IVmin = IV.colwise().minCoeff(); + const double bbd = (IVmax-IVmin).norm(); + const double r = bbd/2.; + const auto & IVmid = 0.5*(IVmax + IVmin); + // Supposedly the implict needs to evaluate to <0 at cmid... + // http://doc.cgal.org/latest/Surface_mesher/classCGAL_1_1Implicit__surface__3.html + Point_3 cmid(IVmid(0),IVmid(1),IVmid(2)); + Function fun; + switch(sign_type) + { + default: + assert(false && "Unknown SignedDistanceType"); + case SIGNED_DISTANCE_TYPE_UNSIGNED: + fun = + [&tree,&IV,&IF,&level](const Point_3 & q) -> FT + { + int i; + RowVector3d c; + const double sd = tree.squared_distance( + IV,IF,RowVector3d(q.x(),q.y(),q.z()),i,c); + return sd-level; + }; + case SIGNED_DISTANCE_TYPE_DEFAULT: + case SIGNED_DISTANCE_TYPE_WINDING_NUMBER: + fun = + [&tree,&IV,&IF,&hier,&level](const Point_3 & q) -> FT + { + const double sd = signed_distance_winding_number( + tree,IV,IF,hier,Vector3d(q.x(),q.y(),q.z())); + return sd-level; + }; + break; + case SIGNED_DISTANCE_TYPE_PSEUDONORMAL: + fun = [&tree,&IV,&IF,&FN,&VN,&EN,&EMAP,&level](const Point_3 & q) -> FT + { + const double sd = + igl::signed_distance_pseudonormal( + tree,IV,IF,FN,VN,EN,EMAP,RowVector3d(q.x(),q.y(),q.z())); + return sd- level; + }; + break; + } + Sphere_3 bounding_sphere(cmid, (r+level)*(r+level)); + Surface_3 surface(fun,bounding_sphere); + CGAL::Surface_mesh_default_criteria_3 + criteria(angle_bound,radius_bound,distance_bound); + // meshing surface + CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Manifold_tag()); + // complex to (V,F) + return igl::copyleft::cgal::complex_to_mesh(c2t3,V,F); +} diff --git a/vendor/libigl/include/igl/copyleft/cgal/signed_distance_isosurface.h b/vendor/libigl/include/igl/copyleft/cgal/signed_distance_isosurface.h new file mode 100644 index 0000000000000000000000000000000000000000..149ea5e3d29d7e87311635b29bcb530c3f7b0f94 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/signed_distance_isosurface.h @@ -0,0 +1,54 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_SIGNED_DISTANCE_ISOSURFACE_H +#define IGL_COPYLEFT_CGAL_SIGNED_DISTANCE_ISOSURFACE_H +#include "../../igl_inline.h" +#include "../../signed_distance.h" +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // SIGNED_DISTANCE_ISOSURFACE Compute the contour of an iso-level of the + // signed distance field to a given mesh. + // + // Inputs: + // IV #IV by 3 list of input mesh vertex positions + // IF #IF by 3 list of input triangle indices + // level iso-level to contour in world coords, negative is inside. + // angle_bound lower bound on triangle angles (mesh quality) (e.g. 28) + // radius_bound upper bound on triangle size (mesh density?) (e.g. 0.02) + // distance_bound cgal mysterious parameter (mesh density?) (e.g. 0.01) + // sign_type method for computing distance _sign_ (see + // ../signed_distance.h) + // Outputs: + // V #V by 3 list of input mesh vertex positions + // F #F by 3 list of input triangle indices + // + IGL_INLINE bool signed_distance_isosurface( + const Eigen::MatrixXd & IV, + const Eigen::MatrixXi & IF, + const double level, + const double angle_bound, + const double radius_bound, + const double distance_bound, + const SignedDistanceType sign_type, + Eigen::MatrixXd & V, + Eigen::MatrixXi & F); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "signed_distance_isosurface.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/slice.cpp b/vendor/libigl/include/igl/copyleft/cgal/slice.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2e274a2f2caeca72b19b6c5dbba0eeb67a9b27bc --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/slice.cpp @@ -0,0 +1,12 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "../../slice.h" +#ifdef IGL_STATIC_LIBRARY +#undef IGL_STATIC_LIBRARY +#include "../../slice.cpp" +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/slice_mask.cpp b/vendor/libigl/include/igl/copyleft/cgal/slice_mask.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ec920e0d197365497984a27764b04d1e8f595380 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/slice_mask.cpp @@ -0,0 +1,15 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "../../slice_mask.h" +#include +#include +#ifdef IGL_STATIC_LIBRARY +#undef IGL_STATIC_LIBRARY +#include "../../slice_mask.cpp" +template void igl::slice_mask, -1, 3, 0, -1, 3>, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::DenseBase, -1, 3, 0, -1, 3> > const&, Eigen::Array const&, int, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/snap_rounding.cpp b/vendor/libigl/include/igl/copyleft/cgal/snap_rounding.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4eb2a8f457b31cd3f375d515d6cfa923fb626876 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/snap_rounding.cpp @@ -0,0 +1,212 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "snap_rounding.h" +#include "resolve_intersections.h" +#include "subdivide_segments.h" +#include "../../remove_unreferenced.h" +#include "../../unique.h" +#include +#include +#include +#include +#include + +template < + typename DerivedV, + typename DerivedE, + typename DerivedVI, + typename DerivedEI, + typename DerivedJ> +IGL_INLINE void igl::copyleft::cgal::snap_rounding( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & VI, + Eigen::PlainObjectBase & EI, + Eigen::PlainObjectBase & J) +{ + using namespace Eigen; + using namespace igl; + using namespace igl::copyleft::cgal; + using namespace std; + // Exact scalar type + typedef CGAL::Epeck Kernel; + typedef Kernel::FT EScalar; + typedef CGAL::Segment_2 Segment_2; + typedef CGAL::Point_2 Point_2; + typedef CGAL::Vector_2 Vector_2; + typedef Matrix MatrixXE; + // Convert vertex positions to exact kernel + + MatrixXE VE; + { + VectorXi IM; + resolve_intersections(V,E,VE,EI,J,IM); + for_each( + EI.data(), + EI.data()+EI.size(), + [&IM](typename DerivedEI::Scalar& i){i=IM(i);}); + VectorXi _; + remove_unreferenced( MatrixXE(VE), DerivedEI(EI), VE,EI,_); + } + + // find all hot pixels + //// southwest and north east corners + //const RowVector2i SW( + // round(VE.col(0).minCoeff()), + // round(VE.col(1).minCoeff())); + //const RowVector2i NE( + // round(VE.col(0).maxCoeff()), + // round(VE.col(1).maxCoeff())); + + // https://github.com/CGAL/cgal/issues/548 + // Round an exact scalar to the nearest integer. A priori can't just round + // double. Suppose e=0.5+ε but double(e)<0.5 + // + // Inputs: + // e exact number + // Outputs: + // i closest integer + const auto & round = [](const EScalar & e)->int + { + const double d = CGAL::to_double(e); + // get an integer that's near the closest int + int i = std::round(d); + EScalar di_sqr = CGAL::square((e-EScalar(i))); + const auto & search = [&i,&di_sqr,&e](const int dir) + { + while(true) + { + const int j = i+dir; + const EScalar dj_sqr = CGAL::square((e-EScalar(j))); + if(dj_sqr < di_sqr) + { + i = j; + di_sqr = dj_sqr; + }else + { + break; + } + } + }; + // Try to increase/decrease int + search(1); + search(-1); + return i; + }; + vector hot; + for(int i = 0;i _1,_2; + igl::unique(vector(hot),hot,_1,_2); + } + + // find all segments intersecting hot pixels + // split edge at closest point to hot pixel center + vector> steiner(EI.rows()); + // initialize each segment with endpoints + for(int i = 0;i hits; + for(int j = 0;j<4;j++) + { + const Segment_2 & sj = wall[j]; + if(CGAL::do_intersect(si,sj)) + { + CGAL::Object result = CGAL::intersection(si,sj); + if(const Point_2 * p = CGAL::object_cast(&result)) + { + hits.push_back(*p); + }else if(const Segment_2 * s = CGAL::object_cast(&result)) + { + // add both endpoints + hits.push_back(s->vertex(0)); + hits.push_back(s->vertex(1)); + } + } + } + if(hits.size() == 0) + { + continue; + } + // centroid of hits + Vector_2 cen(0,0); + for(const Point_2 & hit : hits) + { + cen = Vector_2(cen.x()+hit.x(), cen.y()+hit.y()); + } + cen = Vector_2(cen.x()/EScalar(hits.size()),cen.y()/EScalar(hits.size())); + const Point_2 rcen(round(cen.x()),round(cen.y())); + // after all of that, don't add as a steiner unless it's going to round + // to h + if(rcen == h) + { + steiner[i].emplace_back(cen.x(),cen.y()); + } + } + } + { + DerivedJ prevJ = J; + VectorXi IM; + subdivide_segments(MatrixXE(VE),MatrixXi(EI),steiner,VE,EI,J,IM); + for_each(J.data(),J.data()+J.size(),[&prevJ](typename DerivedJ::Scalar & j){j=prevJ(j);}); + for_each( + EI.data(), + EI.data()+EI.size(), + [&IM](typename DerivedEI::Scalar& i){i=IM(i);}); + VectorXi _; + remove_unreferenced( MatrixXE(VE), DerivedEI(EI), VE,EI,_); + } + + + VI.resizeLike(VE); + for(int i = 0;i, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/snap_rounding.h b/vendor/libigl/include/igl/copyleft/cgal/snap_rounding.h new file mode 100644 index 0000000000000000000000000000000000000000..48d2757f1a9703259f103c16f5046bb9b4fea577 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/snap_rounding.h @@ -0,0 +1,51 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_SNAP_ROUNDING_H +#define IGL_COPYLEFT_CGAL_SNAP_ROUNDING_H + +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // SNAP_ROUNDING Snap a list of possible intersecting segments with + // endpoints in any precision to _the_ integer grid. + // + // Inputs: + // V #V by 2 list of vertex positions + // E #E by 2 list of segment indices into V + // Outputs: + // VI #VI by 2 list of output integer vertex positions, rounded copies + // of V are always the first #V vertices + // EI #EI by 2 list of segment indices into V, #EI ≥ #E + // J #EI list of indices into E revealing "parent segments" + template < + typename DerivedV, + typename DerivedE, + typename DerivedVI, + typename DerivedEI, + typename DerivedJ> + IGL_INLINE void snap_rounding( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & VI, + Eigen::PlainObjectBase & EI, + Eigen::PlainObjectBase & J); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "snap_rounding.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/string_to_mesh_boolean_type.cpp b/vendor/libigl/include/igl/copyleft/cgal/string_to_mesh_boolean_type.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8ff1a03c49773b03040e8b78f267ca75bfc68236 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/string_to_mesh_boolean_type.cpp @@ -0,0 +1,53 @@ +#include "string_to_mesh_boolean_type.h" +#include +#include +#include + +IGL_INLINE bool igl::copyleft::cgal::string_to_mesh_boolean_type( + const std::string & s, + MeshBooleanType & type) +{ + using namespace std; + string eff_s = s; + transform(eff_s.begin(), eff_s.end(), eff_s.begin(), ::tolower); + const auto & find_any = + [](const vector & haystack, const string & needle)->bool + { + return find(haystack.begin(), haystack.end(), needle) != haystack.end(); + }; + if(find_any({"union","unite","u","∪"},eff_s)) + { + type = MESH_BOOLEAN_TYPE_UNION; + }else if(find_any({"intersect","intersection","i","∩"},eff_s)) + { + type = MESH_BOOLEAN_TYPE_INTERSECT; + }else if( + find_any( + {"minus","subtract","difference","relative complement","m","\\"},eff_s)) + { + type = MESH_BOOLEAN_TYPE_MINUS; + }else if(find_any({"xor","symmetric difference","x","∆"},eff_s)) + { + type = MESH_BOOLEAN_TYPE_XOR; + }else if(find_any({"resolve"},eff_s)) + { + type = MESH_BOOLEAN_TYPE_RESOLVE; + }else + { + return false; + } + return true; +} + +IGL_INLINE igl::MeshBooleanType +igl::copyleft::cgal::string_to_mesh_boolean_type( + const std::string & s) +{ + MeshBooleanType type; +#ifndef NDEBUG + const bool ret = +#endif + string_to_mesh_boolean_type(s,type); + assert(ret && "Unknown MeshBooleanType name"); + return type; +} diff --git a/vendor/libigl/include/igl/copyleft/cgal/string_to_mesh_boolean_type.h b/vendor/libigl/include/igl/copyleft/cgal/string_to_mesh_boolean_type.h new file mode 100644 index 0000000000000000000000000000000000000000..4781099f1a762c1609ba9101ada13177dac3d3ba --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/string_to_mesh_boolean_type.h @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_STRING_TO_MESH_BOOLEAN_H +#define IGL_COPYLEFT_CGAL_STRING_TO_MESH_BOOLEAN_H + +#include "../../igl_inline.h" +#include "../../MeshBooleanType.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Convert string to boolean type + // + // Inputs: + // s string identifying type, one of the following: + // "union","intersect","minus","xor","resolve" + // Outputs: + // type type of boolean operation + // Returns true only on success + // + IGL_INLINE bool string_to_mesh_boolean_type( + const std::string & s, + MeshBooleanType & type); + // Returns type without error handling + IGL_INLINE MeshBooleanType string_to_mesh_boolean_type( + const std::string & s); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "string_to_mesh_boolean_type.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/subdivide_segments.cpp b/vendor/libigl/include/igl/copyleft/cgal/subdivide_segments.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ccfe04b1c767c909c598f275ae1748e150786272 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/subdivide_segments.cpp @@ -0,0 +1,142 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "subdivide_segments.h" +#include "row_to_point.h" +#include "assign_scalar.h" +#include "../../unique.h" +#include "../../list_to_matrix.h" +#include +#include +#include +#include +#include + +template < + typename DerivedV, + typename DerivedE, + typename Kernel, + typename DerivedVI, + typename DerivedEI, + typename DerivedJ, + typename DerivedIM> +IGL_INLINE void igl::copyleft::cgal::subdivide_segments( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & E, + const std::vector > > & _steiner, + Eigen::PlainObjectBase & VI, + Eigen::PlainObjectBase & EI, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM) +{ + using namespace Eigen; + using namespace igl; + using namespace std; + + // Exact scalar type + typedef Kernel K; + typedef typename Kernel::FT EScalar; + typedef CGAL::Segment_2 Segment_2; + typedef CGAL::Point_2 Point_2; + typedef Matrix MatrixXE; + + // non-const copy + std::vector > > steiner = _steiner; + + // Convert vertex positions to exact kernel + MatrixXE VE(V.rows(),V.cols()); + for(int i = 0;i S; + std::vector > vEI; + std::vector vJ; + for(int i = 0;i(VE,E(i,0)); + std::sort( + steiner[i].begin(), + steiner[i].end(), + [&s](const Point_2 & A, const Point_2 & B)->bool + { + return (A-s).squared_length() < (B-s).squared_length(); + }); + } + // remove duplicates + steiner[i].erase( + std::unique(steiner[i].begin(), steiner[i].end()), + steiner[i].end()); + { + int s = E(i,0); + // legs to each steiner in order + for(int j = 1;j vVES,_1; + for(int i = 0;i(VE,i)); + } + vVES.insert(vVES.end(),S.begin(),S.end()); + std::vector vA,vIM; + igl::unique(vVES,_1,vA,vIM); + // Push indices back into vVES + for_each(vIM.data(),vIM.data()+vIM.size(),[&vA](size_t & i){i=vA[i];}); + list_to_matrix(vIM,IM); + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::cgal::subdivide_segments, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::vector, std::allocator > >, std::allocator, std::allocator > > > > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::subdivide_segments, -1, -1, 0, -1, -1>, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, std::vector, std::allocator > >, std::allocator, std::allocator > > > > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/subdivide_segments.h b/vendor/libigl/include/igl/copyleft/cgal/subdivide_segments.h new file mode 100644 index 0000000000000000000000000000000000000000..cd7d41a00258ed175516c54bf91daa112db3ab9f --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/subdivide_segments.h @@ -0,0 +1,56 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_SUBDIVIDE_SEGMENTS_H +#define IGL_COPYLEFT_CGAL_SUBDIVIDE_SEGMENTS_H +#include "../../igl_inline.h" +#include +#include +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Insert steiner points to subdivide a given set of line segments + // + // Inputs: + // V #V by 2 list of vertex positions + // E #E by 2 list of segment indices into V + // steiner #E list of lists of unsorted steiner points (including + // endpoints) along the #E original segments + // Outputs: + // VI #VI by 2 list of output vertex positions, copies of V are always + // the first #V vertices + // EI #EI by 2 list of segment indices into V, #EI ≥ #E + // J #EI list of indices into E revealing "parent segments" + // IM #VI list of indices into VV of unique vertices. + template < + typename DerivedV, + typename DerivedE, + typename Kernel, + typename DerivedVI, + typename DerivedEI, + typename DerivedJ, + typename DerivedIM> + IGL_INLINE void subdivide_segments( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & E, + const std::vector > > & steiner, + Eigen::PlainObjectBase & VI, + Eigen::PlainObjectBase & EI, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & IM); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "subdivide_segments.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/submesh_aabb_tree.cpp b/vendor/libigl/include/igl/copyleft/cgal/submesh_aabb_tree.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4351ec0a92db20f701a9f47d4212807f2f44f2c9 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/submesh_aabb_tree.cpp @@ -0,0 +1,58 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "submesh_aabb_tree.h" +#include + +template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename Kernel> +IGL_INLINE void igl::copyleft::cgal::submesh_aabb_tree( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + CGAL::AABB_tree< + CGAL::AABB_traits< + Kernel, + CGAL::AABB_triangle_primitive< + Kernel, typename std::vector< + typename Kernel::Triangle_3 >::iterator > > > & tree, + std::vector & triangles, + std::vector & in_I) +{ + in_I.resize(F.rows(), false); + const size_t num_faces = I.rows(); + for (size_t i=0; i, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); +// generated by autoexplicit.sh +template void igl::copyleft::cgal::submesh_aabb_tree, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::PlainObjectBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); +template void igl::copyleft::cgal::submesh_aabb_tree, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::PlainObjectBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/submesh_aabb_tree.h b/vendor/libigl/include/igl/copyleft/cgal/submesh_aabb_tree.h new file mode 100644 index 0000000000000000000000000000000000000000..eec9c030f99a354fbe2efe5ff6d806b381ef6a0e --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/submesh_aabb_tree.h @@ -0,0 +1,64 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// +#ifndef IGL_COPYLET_CGAL_SUBMESH_AABB_TREE_H +#define IGL_COPYLET_CGAL_SUBMESH_AABB_TREE_H + +#include "../../igl_inline.h" +#include +#include + +#include +#include +#include +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Build an AABB tree for a submesh indicated by a face selection list I + // of a full mesh (V,F) + // + // Inputs: + // V #V by 3 array of vertices. + // F #F by 3 array of faces. + // I #I list of triangle indices to consider. + // Outputs: + // tree aabb containing triangles of (V,F(I,:)) + // triangles #I list of cgal triangles + // in_I #F list of whether in submesh + template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename Kernel> + IGL_INLINE void submesh_aabb_tree( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& I, + CGAL::AABB_tree< + CGAL::AABB_traits< + Kernel, + CGAL::AABB_triangle_primitive< + Kernel, typename std::vector< + typename Kernel::Triangle_3 >::iterator > > > & tree, + std::vector & triangles, + std::vector & in_I); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "submesh_aabb_tree.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/triangle_triangle_squared_distance.cpp b/vendor/libigl/include/igl/copyleft/cgal/triangle_triangle_squared_distance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c512f800003f5da0e01ebdcd15e0bb0cbd84c02 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/triangle_triangle_squared_distance.cpp @@ -0,0 +1,114 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "triangle_triangle_squared_distance.h" +#include "point_triangle_squared_distance.h" +#include +#include +#include + +template < typename Kernel> +IGL_INLINE bool igl::copyleft::cgal::triangle_triangle_squared_distance( + const CGAL::Triangle_3 & T1, + const CGAL::Triangle_3 & T2, + CGAL::Point_3 & P1, + CGAL::Point_3 & P2, + typename Kernel::FT & d) +{ + typedef CGAL::Point_3 Point_3; + typedef CGAL::Vector_3 Vector_3; + typedef CGAL::Triangle_3 Triangle_3; + typedef CGAL::Segment_3 Segment_3; + typedef typename Kernel::FT EScalar; + assert(!T1.is_degenerate()); + assert(!T2.is_degenerate()); + + bool unique = true; + if(CGAL::do_intersect(T1,T2)) + { + // intersecting triangles have zero (squared) distance + CGAL::Object result = CGAL::intersection(T1,T2); + // Some point on the intersection result + CGAL::Point_3 Q; + if(const Point_3 * p = CGAL::object_cast(&result)) + { + Q = *p; + }else if(const Segment_3 * s = CGAL::object_cast(&result)) + { + unique = false; + Q = s->source(); + }else if(const Triangle_3 *itri = CGAL::object_cast(&result)) + { + Q = s->vertex(0); + unique = false; + }else if(const std::vector *polyp = + CGAL::object_cast< std::vector >(&result)) + { + assert(polyp->size() > 0 && "intersection poly should not be empty"); + Q = polyp[0]; + unique = false; + }else + { + assert(false && "Unknown intersection result"); + } + P1 = Q; + P2 = Q; + d = 0; + return unique; + } + // triangles do not intersect: the points of closest approach must be on the + // boundary of one of the triangles + d = std::numeric_limits::infinity(); + const auto & vertices_face = [&unique]( + const Triangle_3 & T1, + const Triangle_3 & T2, + Point_3 & P1, + Point_3 & P2, + EScalar & d) + { + for(int i = 0;i<3;i++) + { + const Point_3 vi = T1.vertex(i); + Point_3 P2i; + EScalar di; + point_triangle_squared_distance(vi,T2,P2i,di); + if(di +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_TRIANGLE_TRIANGLE_SQUARED_DISTANCE_H +#define IGL_COPYLEFT_CGAL_TRIANGLE_TRIANGLE_SQUARED_DISTANCE_H +#include "../../igl_inline.h" +#include +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Given two triangles T1 and T2 find the points on each of closest + // approach and the squared distance thereof. + // + // Inputs: + // T1 first triangle + // T2 second triangle + // Outputs: + // P1 point on T1 closest to T2 + // P2 point on T2 closest to T1 + // d distance betwee P1 and T2 + // Returns true if the closest approach is unique. + template < typename Kernel> + IGL_INLINE bool triangle_triangle_squared_distance( + const CGAL::Triangle_3 & T1, + const CGAL::Triangle_3 & T2, + CGAL::Point_3 & P1, + CGAL::Point_3 & P2, + typename Kernel::FT & d); + } + } +} +#ifndef IGL_STATIC_LIBRARY +# include "triangle_triangle_squared_distance.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/triangulate.cpp b/vendor/libigl/include/igl/copyleft/cgal/triangulate.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8beb58e2866bdbce4685d91da553248f3e032058 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/triangulate.cpp @@ -0,0 +1,148 @@ +#include "triangulate.h" +#include "assign_scalar.h" +#include "../../list_to_matrix.h" +#include +#include +#include +#include +#include +#include +#include +#include + +template < + typename Kernel, + typename DerivedV, + typename DerivedE, + typename DerivedH, + typename DerivedV2, + typename DerivedF2> +IGL_INLINE void igl::copyleft::cgal::triangulate( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & E, + const Eigen::MatrixBase & H, + const bool retain_convex_hull, + Eigen::PlainObjectBase & TV, + Eigen::PlainObjectBase & TF) +{ + struct FaceInfo2 + { + FaceInfo2(){} + bool visited = false; + bool in_domain = true; + }; + + typedef Eigen::Index Index; + //typedef CGAL::Epeck Kernel; + typedef CGAL::Point_2 Point_2; + typedef CGAL::Segment_2 Segment_2; + typedef CGAL::Triangle_2 Triangle_2; + typedef CGAL::Triangulation_vertex_base_2 TVB_2; + typedef CGAL::Triangulation_face_base_with_info_2 TFB_2; + typedef CGAL::Constrained_triangulation_face_base_2 CTFB_2; + typedef CGAL::Triangulation_data_structure_2 TDS_2; + typedef CGAL::Exact_intersections_tag Itag; + typedef CGAL::Constrained_Delaunay_triangulation_2 CDT_2; + typedef CGAL::Constrained_triangulation_plus_2 CDT_plus_2; + typedef typename CDT_plus_2::Face_handle Face_handle; + + CDT_plus_2 cdt; + // Insert all points + std::vector points;points.reserve(V.rows()); + for(Eigen::Index i = 0;i queue; + queue.push(start); + while(!queue.empty()) + { + Face_handle fh = queue.front(); + queue.pop(); + if(!fh->info().visited) + { + fh->info().visited = true; + fh->info().in_domain = false; + for(int i = 0; i < 3; i++) + { + typename CDT_plus_2::Edge e(fh,i); + Face_handle n = fh->neighbor(i); + if(!n->info().visited && !cdt.is_constrained(e)) + { + queue.push(n); + } + } + } + } + }; + + // If _not_ meshsing convex hull, remove anything connected to infinite face + if(!retain_convex_hull) + { + remove_cc(cdt.infinite_face()); + } + // remove holes + for(Eigen::Index h = 0;h > vertices; + std::vector > faces; + // Read off vertices of the cdt, remembering index + std::map v2i; + size_t count=0; + for ( + auto itr = cdt.finite_vertices_begin(); + itr != cdt.finite_vertices_end(); + itr++) + { + vertices.push_back(itr->point()); + v2i[itr] = count; + count++; + } + // Read off faces and store index triples + for ( + auto itr = cdt.finite_faces_begin(); + itr != cdt.finite_faces_end(); + itr++) + { + if(itr->info().in_domain) + { + faces.push_back( + { v2i[itr->vertex(0)], v2i[itr->vertex(1)], v2i[itr->vertex(2)] }); + } + } + TV.resize(vertices.size(),2); + for(int v = 0;v, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, const bool , Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::triangulate, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, const bool , Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::triangulate, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, const bool , Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/triangulate.h b/vendor/libigl/include/igl/copyleft/cgal/triangulate.h new file mode 100644 index 0000000000000000000000000000000000000000..10d3bc36a966b2e78b9541f0d353bb8fad69b6d4 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/triangulate.h @@ -0,0 +1,57 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2021 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_TRIANGULATE_H +#define IGL_COPYLEFT_CGAL_TRIANGULATE_H + +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Triangulate the interior of a polygon using the triangle library. + // + // Inputs: + // V #V by 2 list of 2D vertex positions + // E #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygon + // H #H by 2 coordinates of points contained inside holes of the polygon + // retain_convex_hull whether to retain convex hull {true} or trim away + // all faces reachable from infinite by traversing across + // non-constrained edges {false}. {true → "c" flag in `triangle`} + // Outputs: + // V2 #V2 by 2 coordinates of the vertives of the generated triangulation + // F2 #F2 by 3 list of indices forming the faces of the generated triangulation + // + // See also: igl::triangle::triangulate + template < + typename Kernel, + typename DerivedV, + typename DerivedE, + typename DerivedH, + typename DerivedV2, + typename DerivedF2> + IGL_INLINE void triangulate( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & E, + const Eigen::MatrixBase & H, + const bool retain_convex_hull, + Eigen::PlainObjectBase & V2, + Eigen::PlainObjectBase & F2); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "triangulate.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/trim_with_solid.cpp b/vendor/libigl/include/igl/copyleft/cgal/trim_with_solid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1e67da71e6cfb87643f6917446a538d3b5bb2445 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/trim_with_solid.cpp @@ -0,0 +1,105 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "trim_with_solid.h" +#include "assign.h" +#include "intersect_other.h" +#include "point_solid_signed_squared_distance.h" + +#include "../../extract_manifold_patches.h" +#include "../../list_to_matrix.h" +#include "../../remove_unreferenced.h" +#include "../../slice_mask.h" + +#include + +#include + +template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedV, + typename DerivedF, + typename DerivedD, + typename DerivedJ> +IGL_INLINE void igl::copyleft::cgal::trim_with_solid( + const Eigen::PlainObjectBase & VA, + const Eigen::PlainObjectBase & FA, + const Eigen::PlainObjectBase & VB, + const Eigen::PlainObjectBase & FB, + Eigen::PlainObjectBase & Vd, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & D, + Eigen::PlainObjectBase & J) +{ + // resolve intersections using exact representation + typedef Eigen::Matrix MatrixX3E; + typedef Eigen::Matrix VectorXE; + typedef Eigen::Matrix RowVector3E; + MatrixX3E V; + Eigen::MatrixXi _1; + Eigen::VectorXi _2; + // Intersect A and B meshes and stitch together new faces + igl::copyleft::cgal::intersect_other( + VA,FA,VB,FB,{false,false,true},_1,V,F,J,_2); + // Partition result into manifold patches + Eigen::VectorXi P; + const size_t num_patches = igl::extract_manifold_patches(F,P); + // only keep faces from A + Eigen::Matrix A = J.array()< FA.rows(); + igl::slice_mask(Eigen::MatrixXi(F),A,1,F); + igl::slice_mask(Eigen::VectorXi(P),A,1,P); + igl::slice_mask(Eigen::VectorXi(J),A,1,J); + // Aggregate representative query points for each patch + std::vector flag(num_patches); + std::vector > vQ; + Eigen::VectorXi P2Q(num_patches); + for(int f = 0;f q = { + (V(F(f,0),0)+ V(F(f,1),0)+ V(F(f,2),0))/3., + (V(F(f,0),1)+ V(F(f,1),1)+ V(F(f,2),1))/3., + (V(F(f,0),2)+ V(F(f,1),2)+ V(F(f,2),2))/3.}; + vQ.emplace_back(q); + flag[p] = true; + } + } + MatrixX3E Q; + igl::list_to_matrix(vQ,Q); + VectorXE SP; + point_solid_signed_squared_distance(Q,VB,FB,SP); + Eigen::Matrix DP = SP.array()>0; + // distribute flag to all faces + D.resize(F.rows()); + for(int f = 0;f, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix + >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, + Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, + Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/trim_with_solid.h b/vendor/libigl/include/igl/copyleft/cgal/trim_with_solid.h new file mode 100644 index 0000000000000000000000000000000000000000..aa45d80f76fed7e4e9adbd35276b9b2ad7c4a858 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/trim_with_solid.h @@ -0,0 +1,63 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_TRIM_WITH_SOLID_H +#define IGL_COPYLEFT_CGAL_TRIM_WITH_SOLID_H + +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // TRIM_WITH_SOLID Given an arbitrary mesh (VA,FA) and the boundary mesh + // (VB,FB) of a solid (as defined in [Zhou et al. 2016]), Resolve intersections + // between A and B subdividing faces of A so that intersections with B exists + // only along edges and vertices (and coplanar faces). Then determine whether + // each of these faces is inside or outside of B. This can be used to extract + // the part of A inside or outside of B. + // + // Inputs: + // VA #VA by 3 list of mesh vertex positions of A + // FA #FA by 3 list of mesh triangle indices into VA + // VB #VB by 3 list of mesh vertex positions of B + // FB #FB by 3 list of mesh triangle indices into VB + // Outputs: + // V #V by 3 list of mesh vertex positions of output + // F #F by 3 list of mesh triangle indices into V + // D #F list of bools whether face is inside B + // J #F list of indices into FA revealing birth parent + // + template < + typename DerivedVA, + typename DerivedFA, + typename DerivedVB, + typename DerivedFB, + typename DerivedV, + typename DerivedF, + typename DerivedD, + typename DerivedJ> + IGL_INLINE void trim_with_solid( + const Eigen::PlainObjectBase & VA, + const Eigen::PlainObjectBase & FA, + const Eigen::PlainObjectBase & VB, + const Eigen::PlainObjectBase & FB, + Eigen::PlainObjectBase & Vd, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & D, + Eigen::PlainObjectBase & J); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "trim_with_solid.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/unique.cpp b/vendor/libigl/include/igl/copyleft/cgal/unique.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ebf98f307ee311f3e951db6525988fabb2a01aa --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/unique.cpp @@ -0,0 +1,15 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "../../unique.h" +#include +#include +#ifdef IGL_STATIC_LIBRARY +#undef IGL_STATIC_LIBRARY +#include "../../unique.cpp" +template void igl::unique >(std::vector, std::allocator > > const&, std::vector, std::allocator > >&, std::vector >&, std::vector >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/unique_rows.cpp b/vendor/libigl/include/igl/copyleft/cgal/unique_rows.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e4d946f7707eaf61fea029d4b4e5c5d2288fe60e --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/unique_rows.cpp @@ -0,0 +1,18 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "../../unique_rows.h" +#include +#include +#ifdef IGL_STATIC_LIBRARY +#undef IGL_STATIC_LIBRARY +#include "../../unique_rows.cpp" +template void igl::unique_rows, -1, -1, 0, -1, -1>, Eigen::Matrix, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::DenseBase, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::unique_rows, -1, -1, 1, -1, -1>, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::DenseBase, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::unique_rows, -1, 3, 0, -1, 3>, Eigen::Matrix, -1, 3, 0, -1, 3>, Eigen::Matrix, Eigen::Matrix >(Eigen::DenseBase, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif + diff --git a/vendor/libigl/include/igl/copyleft/cgal/wire_mesh.cpp b/vendor/libigl/include/igl/copyleft/cgal/wire_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5e3bf9bf360a4e2ff6dd522f03d8278953c03c97 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/wire_mesh.cpp @@ -0,0 +1,254 @@ +#include "wire_mesh.h" + +#include "../../list_to_matrix.h" +#include "../../slice.h" +#include "../../PI.h" +#include "convex_hull.h" +#include "coplanar.h" +#include "mesh_boolean.h" +#include +#include + +template < + typename DerivedWV, + typename DerivedWE, + typename Derivedth, + typename DerivedV, + typename DerivedF, + typename DerivedJ> +IGL_INLINE void igl::copyleft::cgal::wire_mesh( + const Eigen::MatrixBase & WV, + const Eigen::MatrixBase & WE, + const Eigen::MatrixBase & th, + const int poly_size, + const bool solid, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & J) +{ + assert((th.size()==1 || th.size()==WE.rows()) && + "th should be scalar or size of WE"); + + typedef typename DerivedWV::Scalar Scalar; + // Canonical polygon to place at each endpoint + typedef Eigen::Matrix MatrixX3S; + MatrixX3S PV(poly_size,3); + for(int p =0;p > > A(WV.rows()); + // Inputs: + // e index of edge + // c index of endpoint [0,1] + // p index of polygon vertex + // Returns index of corresponding vertex in V + const auto index = + [&PV,&WV](const int e, const int c, const int p)->int + { + return WV.rows() + e*2*PV.rows() + PV.rows()*c + p; + }; + const auto unindex = + [&PV,&WV](int v, int & e, int & c, int & p) + { + assert(v>=WV.rows()); + v = v-WV.rows(); + e = v/(2*PV.rows()); + v = v-e*(2*PV.rows()); + c = v/(PV.rows()); + v = v-c*(PV.rows()); + p = v; + }; + + // Count each vertex's indicident edges. + std::vector nedges(WV.rows(), 0); + for(int e = 0;e RowVector3S; + const RowVector3S ev = WV.row(WE(e,1))-WV.row(WE(e,0)); + const Scalar len = ev.norm(); + // Unit edge vector + const RowVector3S uv = ev.normalized(); + Eigen::Quaternion q; + q = q.FromTwoVectors(RowVector3S(0,0,1),uv); + // loop over polygon vertices + for(int p = 0;p 1); + // Move to endpoint, offset by amount + V.row(index(e,c,p)) = + qp+WV.row(WE(e,c)) + dist*dir*uv; + } + } + } + + std::vector > vF; + std::vector vJ; + const auto append_hull = + [&V,&vF,&vJ,&unindex,&WV](const Eigen::VectorXi & I, const int j) + { + MatrixX3S Vv; + igl::slice(V,I,1,Vv); + if(coplanar(Vv)) + { + return; + } + Eigen::MatrixXi Fv; + convex_hull(Vv,Fv); + for(int f = 0;f face(I(Fv(f,0)), I(Fv(f,1)), I(Fv(f,2))); + //const bool on_vertex = (face +IGL_INLINE void igl::copyleft::cgal::wire_mesh( + const Eigen::MatrixBase & WV, + const Eigen::MatrixBase & WE, + const double th, + const int poly_size, + const bool solid, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & J) +{ + return wire_mesh( + WV,WE,(Eigen::VectorXd(1,1)< +IGL_INLINE void igl::copyleft::cgal::wire_mesh( + const Eigen::MatrixBase & WV, + const Eigen::MatrixBase & WE, + const double th, + const int poly_size, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & J) +{ + return wire_mesh(WV,WE,th,poly_size,true,V,F,J); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::copyleft::cgal::wire_mesh, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, double, int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/cgal/wire_mesh.h b/vendor/libigl/include/igl/copyleft/cgal/wire_mesh.h new file mode 100644 index 0000000000000000000000000000000000000000..f88bc9eddefa9d7b5fb4f2aca1cc77b6f341dff4 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/cgal/wire_mesh.h @@ -0,0 +1,83 @@ +#ifndef IGL_COPYLEFT_CGAL_WIRE_MESH_H +#define IGL_COPYLEFT_CGAL_WIRE_MESH_H +#include "../../igl_inline.h" +#include +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Construct a "wire" or "wireframe" or "strut" surface mesh, given a + // one-dimensional network of straight edges. + // + // Inputs: + // WV #WV by 3 list of vertex positions + // WE #WE by 2 list of edge indices into WV + // th #WE diameter thicknesses of wire edges + // poly_size number of sides on each wire (e.g., 4 would produce wires by + // connecting rectangular prisms). + // solid whether to resolve self-intersections to + // create a "solid" output mesh (cf., [Zhou et al. 2016] + // Outputs: + // V #V by 3 list of output vertices + // F #F by 3 list of output triangle indices into V + // J #F list of indices into [0,#WV+#WE) revealing "birth simplex" of + // output faces J(j) < #WV means the face corresponds to the J(j)th + // vertex in WV. J(j) >= #WV means the face corresponds to the + // (J(j)-#WV)th edge in WE. + template < + typename DerivedWV, + typename DerivedWE, + typename Derivedth, + typename DerivedV, + typename DerivedF, + typename DerivedJ> + IGL_INLINE void wire_mesh( + const Eigen::MatrixBase & WV, + const Eigen::MatrixBase & WE, + const Eigen::MatrixBase & th, + const int poly_size, + const bool solid, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & J); + template < + typename DerivedWV, + typename DerivedWE, + typename DerivedV, + typename DerivedF, + typename DerivedJ> + IGL_INLINE void wire_mesh( + const Eigen::MatrixBase & WV, + const Eigen::MatrixBase & WE, + const double th, + const int poly_size, + const bool solid, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & J); + // Default with solid=true + template < + typename DerivedWV, + typename DerivedWE, + typename DerivedV, + typename DerivedF, + typename DerivedJ> + IGL_INLINE void wire_mesh( + const Eigen::MatrixBase & WV, + const Eigen::MatrixBase & WE, + const double th, + const int poly_size, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & J); + + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "wire_mesh.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/comiso/frame_field.cpp b/vendor/libigl/include/igl/copyleft/comiso/frame_field.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c3549eeffc0aca0bdfc69773f38a650ee16aca3b --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/comiso/frame_field.cpp @@ -0,0 +1,688 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "frame_field.h" + +#include +#include +#include +#include +#include + +namespace igl +{ +namespace copyleft +{ +namespace comiso +{ + +class FrameInterpolator +{ +public: + // Init + IGL_INLINE FrameInterpolator(const Eigen::MatrixXd& _V, const Eigen::MatrixXi& _F); + IGL_INLINE ~FrameInterpolator(); + + // Reset constraints (at least one constraint must be present or solve will fail) + IGL_INLINE void resetConstraints(); + + IGL_INLINE void setConstraint(const int fid, const Eigen::VectorXd& v); + + IGL_INLINE void interpolateSymmetric(); + + // Generate the frame field + IGL_INLINE void solve(); + + // Convert the frame field in the canonical representation + IGL_INLINE void frame2canonical(const Eigen::MatrixXd& TP, const Eigen::RowVectorXd& v, double& theta, Eigen::VectorXd& S); + + // Convert the canonical representation in a frame field + IGL_INLINE void canonical2frame(const Eigen::MatrixXd& TP, const double theta, const Eigen::VectorXd& S, Eigen::RowVectorXd& v); + + IGL_INLINE Eigen::MatrixXd getFieldPerFace(); + + IGL_INLINE void PolarDecomposition(Eigen::MatrixXd V, Eigen::MatrixXd& U, Eigen::MatrixXd& P); + + // Symmetric + Eigen::MatrixXd S; + std::vector S_c; + + // ------------------------------------------------- + + // Face Topology + Eigen::MatrixXi TT, TTi; + + // Two faces are consistent if their representative vector are taken modulo PI + std::vector edge_consistency; + Eigen::MatrixXi edge_consistency_TT; + +private: + IGL_INLINE double mod2pi(double d); + IGL_INLINE double modpi2(double d); + IGL_INLINE double modpi(double d); + + // Convert a direction on the tangent space into an angle + IGL_INLINE double vector2theta(const Eigen::MatrixXd& TP, const Eigen::RowVectorXd& v); + + // Convert an angle in a vector in the tangent space + IGL_INLINE Eigen::RowVectorXd theta2vector(const Eigen::MatrixXd& TP, const double theta); + + // Interpolate the cross field (theta) + IGL_INLINE void interpolateCross(); + + // Compute difference between reference frames + IGL_INLINE void computek(); + + // Compute edge consistency + IGL_INLINE void compute_edge_consistency(); + + // Cross field direction + Eigen::VectorXd thetas; + std::vector thetas_c; + + // Edge Topology + Eigen::MatrixXi EV, FE, EF; + std::vector isBorderEdge; + + // Angle between two reference frames + // R(k) * t0 = t1 + Eigen::VectorXd k; + + // Mesh + Eigen::MatrixXd V; + Eigen::MatrixXi F; + + // Normals per face + Eigen::MatrixXd N; + + // Reference frame per triangle + std::vector TPs; + +}; + +FrameInterpolator::FrameInterpolator(const Eigen::MatrixXd& _V, const Eigen::MatrixXi& _F) +{ + using namespace std; + using namespace Eigen; + + V = _V; + F = _F; + + assert(V.rows() > 0); + assert(F.rows() > 0); + + + // Generate topological relations + igl::triangle_triangle_adjacency(F,TT,TTi); + igl::edge_topology(V,F, EV, FE, EF); + + // Flag border edges + isBorderEdge.resize(EV.rows()); + for(unsigned i=0; i 3*(igl::PI/4.0); + + // Copy it into edge_consistency_TT + int i1 = -1; + int i2 = -1; + for (unsigned i=0; i<3; ++i) + { + if (TT(fid0,i) == fid1) + i1 = i; + if (TT(fid1,i) == fid0) + i2 = i; + } + assert(i1 != -1); + assert(i2 != -1); + + edge_consistency_TT(fid0,i1) = edge_consistency[eid]; + edge_consistency_TT(fid1,i2) = edge_consistency[eid]; + } + } +} + +void FrameInterpolator::computek() +{ + using namespace std; + using namespace Eigen; + + k.resize(EF.rows()); + + // For every non-border edge + for (unsigned eid=0; eid(); + + assert(tmp(0) - ref1(0) < (0.000001)); + assert(tmp(1) - ref1(1) < (0.000001)); + + k[eid] = ktemp; + } + } + +} + + + void FrameInterpolator::frame2canonical(const Eigen::MatrixXd& TP, const Eigen::RowVectorXd& v, double& theta, Eigen::VectorXd& S_v) +{ + using namespace std; + using namespace Eigen; + + RowVectorXd v0 = v.segment<3>(0); + RowVectorXd v1 = v.segment<3>(3); + + // Project onto the tangent plane + Vector2d vp0 = TP * v0.transpose(); + Vector2d vp1 = TP * v1.transpose(); + + // Assemble matrix + MatrixXd M(2,2); + M << vp0, vp1; + + if (M.determinant() < 0) + M.col(1) = -M.col(1); + + assert(M.determinant() > 0); + + // cerr << "M: " << M << endl; + + MatrixXd R,S; + PolarDecomposition(M,R,S); + + // Finally, express the cross field as an angle + theta = atan2(R(1,0),R(0,0)); + + MatrixXd R2(2,2); + R2 << cos(theta), -sin(theta), sin(theta), cos(theta); + + assert((R2-R).norm() < 10e-8); + + // Convert into rotation invariant form + S = R * S * R.inverse(); + + // Copy in vector form + S_v = VectorXd(3); + S_v << S(0,0), S(0,1), S(1,1); +} + + void FrameInterpolator::canonical2frame(const Eigen::MatrixXd& TP, const double theta, const Eigen::VectorXd& S_v, Eigen::RowVectorXd& v) +{ + using namespace std; + using namespace Eigen; + + assert(S_v.size() == 3); + + MatrixXd S_temp(2,2); + S_temp << S_v(0), S_v(1), S_v(1), S_v(2); + + // Convert angle in vector in the tangent plane + // Vector2d vp(cos(theta),sin(theta)); + + // First reconstruct R + MatrixXd R(2,2); + + R << cos(theta), -sin(theta), sin(theta), cos(theta); + + // Rotation invariant reconstruction + MatrixXd M = S_temp * R; + + Vector2d vp0(M(0,0),M(1,0)); + Vector2d vp1(M(0,1),M(1,1)); + + // Unproject the vectors + RowVectorXd v0 = vp0.transpose() * TP; + RowVectorXd v1 = vp1.transpose() * TP; + + v.resize(6); + v << v0, v1; +} + +void FrameInterpolator::solve() +{ + interpolateCross(); + interpolateSymmetric(); +} + +void FrameInterpolator::interpolateSymmetric() +{ + using namespace std; + using namespace Eigen; + + // Generate uniform Laplacian matrix + typedef Eigen::Triplet triplet; + std::vector triplets; + + // Variables are stacked as x1,y1,z1,x2,y2,z2 + triplets.reserve(3*4*F.rows()); + + MatrixXd b = MatrixXd::Zero(3*F.rows(),1); + + // Build L and b + for (unsigned eid=0; eid L(3*F.rows(),3*F.rows()); + L.setFromTriplets(triplets.begin(), triplets.end()); + + triplets.clear(); + + // Add soft constraints + double w = 100000; + for (unsigned fid=0; fid < F.rows(); ++fid) + { + if (S_c[fid]) + { + for (unsigned i=0;i<3;++i) + { + triplets.push_back(triplet(3*fid + i,3*fid + i,w)); + b(3*fid + i) += w*S(fid,i); + } + } + } + + SparseMatrix soft(3*F.rows(),3*F.rows()); + soft.setFromTriplets(triplets.begin(), triplets.end()); + + SparseMatrix M; + + M = L + soft; + + // Solve Lx = b; + + SparseLU > solver; + + solver.compute(M); + + if(solver.info()!=Success) + { + std::cerr << "LU failed - frame_interpolator.cpp" << std::endl; + assert(0); + } + + MatrixXd x; + x = solver.solve(b); + + if(solver.info()!=Success) + { + std::cerr << "Linear solve failed - frame_interpolator.cpp" << std::endl; + assert(0); + } + + S = MatrixXd::Zero(F.rows(),3); + + // Copy back the result + for (unsigned i=0;i svd(V,Eigen::ComputeFullU | Eigen::ComputeFullV); + + U = svd.matrixU() * svd.matrixV().transpose(); + P = svd.matrixV() * svd.singularValues().asDiagonal() * svd.matrixV().transpose(); +} + +} +} +} + +IGL_INLINE void igl::copyleft::comiso::frame_field( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::VectorXi& b, + const Eigen::MatrixXd& bc1, + const Eigen::MatrixXd& bc2, + Eigen::MatrixXd& FF1, + Eigen::MatrixXd& FF2 + ) + +{ + using namespace std; + using namespace Eigen; + + assert(b.size() > 0); + + // Init Solver + FrameInterpolator field(V,F); + + for (unsigned i=0; i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COMISO_FRAMEFIELD_H +#define IGL_COMISO_FRAMEFIELD_H + +#include +#include +#include +#include + +namespace igl +{ +namespace copyleft +{ +namespace comiso +{ +// Generate a piecewise-constant frame-field field from a sparse set of constraints on faces +// using the algorithm proposed in: +// Frame Fields: Anisotropic and Non-Orthogonal Cross Fields +// Daniele Panozzo, Enrico Puppo, Marco Tarini, Olga Sorkine-Hornung, +// ACM Transactions on Graphics (SIGGRAPH, 2014) +// +// Inputs: +// V #V by 3 list of mesh vertex coordinates +// F #F by 3 list of mesh faces (must be triangles) +// b #B by 1 list of constrained face indices +// bc1 #B by 3 list of the constrained first representative vector of the frame field (up to permutation and sign) +// bc2 #B by 3 list of the constrained second representative vector of the frame field (up to permutation and sign) +// +// Outputs: +// FF1 #F by 3 the first representative vector of the frame field (up to permutation and sign) +// FF2 #F by 3 the second representative vector of the frame field (up to permutation and sign) +// +// TODO: it now supports only soft constraints, should be extended to support both hard and soft constraints +IGL_INLINE void frame_field( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::VectorXi& b, + const Eigen::MatrixXd& bc1, + const Eigen::MatrixXd& bc2, + Eigen::MatrixXd& FF1, + Eigen::MatrixXd& FF2 + ); +} +} +} + +#ifndef IGL_STATIC_LIBRARY +# include "frame_field.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/comiso/miq.cpp b/vendor/libigl/include/igl/copyleft/comiso/miq.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5adde44168b8d3c5f017f74f2198f0c36eb8ee99 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/comiso/miq.cpp @@ -0,0 +1,1543 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo , Olga Diamanti , Kevin Walliman +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "miq.h" +#include "../../local_basis.h" +#include "../../triangle_triangle_adjacency.h" +#include "../../cut_mesh.h" +#include "../../LinSpaced.h" + +// includes for VertexIndexing +#include "../../HalfEdgeIterator.h" +#include "../../is_border_vertex.h" +#include "../../vertex_triangle_adjacency.h" + +// includes for PoissonSolver +#include "../../slice_into.h" +#include "../../grad.h" +#include "../../cotmatrix.h" +#include "../../doublearea.h" +#include +#include +#include +#include + +// +#include "igl/cross_field_mismatch.h" +#include "../../comb_frame_field.h" +#include "../../comb_cross_field.h" +#include "../../cut_mesh_from_singularities.h" +#include "../../find_cross_field_singularities.h" +#include "../../compute_frame_field_bisectors.h" +#include "../../rotate_vectors.h" + +#ifndef NDEBUG +#include +#endif +#include +#include "../../matlab_format.h" + +#define DEBUGPRINT 0 + + +namespace igl { +namespace copyleft { +namespace comiso { + struct SeamInfo + { + int v0,v0p; + unsigned int integerVar; + int mismatch; + + IGL_INLINE SeamInfo(int _v0, + int _v0p, + int _mismatch, + unsigned int _integerVar); + + IGL_INLINE SeamInfo(const SeamInfo &S1); + }; + + struct MeshSystemInfo + { + MeshSystemInfo() + { + num_vert_variables = 0; + num_integer_cuts = 0; + } + ////number of vertices variables + unsigned int num_vert_variables; + ///num of integer for cuts + unsigned int num_integer_cuts; + ///this are used for drawing purposes + std::vector edgeSeamInfo; + }; + + + template + class VertexIndexing + { + public: + // Input: + const Eigen::PlainObjectBase &V; + const Eigen::PlainObjectBase &F; + const Eigen::PlainObjectBase &Vcut; + const Eigen::PlainObjectBase &Fcut; + const Eigen::PlainObjectBase &TT; + const Eigen::PlainObjectBase &TTi; + + const Eigen::Matrix &mismatch; + const Eigen::Matrix &singular; // bool + const Eigen::Matrix &seams; // 3 bool + + + ///this handle for mesh TODO: move with the other global variables + MeshSystemInfo systemInfo; + + IGL_INLINE VertexIndexing(const Eigen::PlainObjectBase &_V, + const Eigen::PlainObjectBase &_F, + const Eigen::PlainObjectBase &_Vcut, + const Eigen::PlainObjectBase &_Fcut, + const Eigen::PlainObjectBase &_TT, + const Eigen::PlainObjectBase &_TTi, + const Eigen::Matrix &_mismatch, + const Eigen::Matrix &_singular, + const Eigen::Matrix &_seams + ); + + // provide information about every vertex per seam + IGL_INLINE void initSeamInfo(); + + + private: + struct VertexInfo{ + int v; // vertex index (according to V) + int f0, k0; // face and local edge information of the edge that connects this vertex to the previous vertex (previous in the vector) + int f1, k1; // face and local edge information of the other face corresponding to the same edge + VertexInfo(int _v, int _f0, int _k0, int _f1, int _k1) : + v(_v), f0(_f0), k0(_k0), f1(_f1), k1(_k1){} + bool operator==(VertexInfo const& other){ + return other.v == v; + } + }; + + IGL_INLINE void getSeamInfo(int f0, + int f1, + int indexE, + int &v0, int &v1, + int &v0p, int &v1p, + int &_mismatch); + + IGL_INLINE std::vector > getVerticesPerSeam(); + }; + + + template + class PoissonSolver + { + private: + + // Penalization term for integer variables used in mixedIntegerSolve + const double PENALIZATION = 0.000001; + + public: + IGL_INLINE void solvePoisson(Eigen::VectorXd stiffness, + double gradientSize = 0.1, + double gridResolution = 1., + bool directRound = true, + unsigned int localIter = 0, + bool doRound = true, + bool singularityRound = true, + const std::vector &roundVertices = std::vector(), + const std::vector> &hardFeatures = std::vector >()); + + IGL_INLINE PoissonSolver(const Eigen::PlainObjectBase &_V, + const Eigen::PlainObjectBase &_F, + const Eigen::PlainObjectBase &_Vcut, + const Eigen::PlainObjectBase &_Fcut, + const Eigen::PlainObjectBase &_TT, + const Eigen::PlainObjectBase &_TTi, + const Eigen::PlainObjectBase &_PD1, + const Eigen::PlainObjectBase &_PD2, + const Eigen::Matrix&_singular, + const MeshSystemInfo &_systemInfo + ); + + const Eigen::PlainObjectBase &V; + const Eigen::PlainObjectBase &F; + const Eigen::PlainObjectBase &Vcut; + const Eigen::PlainObjectBase &Fcut; + const Eigen::PlainObjectBase &TT; + const Eigen::PlainObjectBase &TTi; + const Eigen::PlainObjectBase &PD1; + const Eigen::PlainObjectBase &PD2; + const Eigen::Matrix &singular; // bool + + const MeshSystemInfo &systemInfo; + + // Internal: + Eigen::VectorXd Handle_Stiffness; + std::vector > VF; + std::vector > VFi; + Eigen::MatrixXd UV; // this is probably useless + + // Output: + // per wedge UV coordinates, 6 coordinates (1 face) per row + Eigen::MatrixXd WUV; + // per vertex UV coordinates, Vcut.rows() x 2 + Eigen::MatrixXd UV_out; + + // Matrices + Eigen::SparseMatrix Lhs; + Eigen::SparseMatrix Constraints; + Eigen::VectorXd rhs; + Eigen::VectorXd constraints_rhs; + ///vector of unknowns + std::vector< double > X; + + ////REAL PART + ///number of fixed vertex + unsigned int n_fixed_vars; + + ///the number of REAL variables for vertices + unsigned int n_vert_vars; + + ///total number of variables of the system, + ///do not consider constraints, but consider integer vars + unsigned int num_total_vars; + + //////INTEGER PART + ///the total number of integer variables + unsigned int n_integer_vars; + + ///CONSTRAINT PART + ///number of cuts constraints + unsigned int num_cut_constraint; + + // number of user-defined constraints + unsigned int num_userdefined_constraint; + + ///total number of constraints equations + unsigned int num_constraint_equations; + + ///vector of blocked vertices + std::vector Hard_constraints; + + ///vector of indexes to round + std::vector ids_to_round; + + ///vector of indexes to round + std::vector > userdefined_constraints; + + ///boolean that is true if rounding to integer is needed + bool integer_rounding; + + ///START COMMON MATH FUNCTIONS + ///return the complex encoding the rotation + ///for a given mismatch interval + IGL_INLINE std::complex getRotationComplex(int interval); + ///END COMMON MATH FUNCTIONS + + ///START FIXING VERTICES + ///set a given vertex as fixed + IGL_INLINE void addFixedVertex(int v); + + ///find vertex to fix in case we're using + ///a vector field NB: multiple components not handled + IGL_INLINE void findFixedVertField(); + + ///find hard constraint depending if using or not + ///a vector field + IGL_INLINE void findFixedVert(); + + IGL_INLINE int getFirstVertexIndex(int v); + + ///fix the vertices which are flagged as fixed + IGL_INLINE void fixBlockedVertex(); + ///END FIXING VERTICES + + ///HANDLING SINGULARITY + //set the singularity round to integer location + IGL_INLINE void addSingularityRound(); + + IGL_INLINE void addToRoundVertices(std::vector ids); + + ///START GENERIC SYSTEM FUNCTIONS + //build the Laplacian matrix cycling over all range maps + //and over all faces + IGL_INLINE void buildLaplacianMatrix(double vfscale = 1); + + ///find different sized of the system + IGL_INLINE void findSizes(); + + IGL_INLINE void allocateSystem(); + + ///intitialize the whole matrix + IGL_INLINE void initMatrix(); + + ///map back coordinates after that + ///the system has been solved + IGL_INLINE void mapCoords(); + ///END GENERIC SYSTEM FUNCTIONS + + ///set the constraints for the inter-range cuts + IGL_INLINE void buildSeamConstraintsExplicitTranslation(); + + ///set the constraints for the inter-range cuts + IGL_INLINE void buildUserDefinedConstraints(); + + ///call of the mixed integer solver + IGL_INLINE void mixedIntegerSolve(double coneGridRes = 1, + bool directRound = true, + unsigned int localIter = 0); + + IGL_INLINE void clearUserConstraint(); + + IGL_INLINE void addSharpEdgeConstraint(int fid, int vid); + + }; + + template + class MIQ_class + { + private: + const Eigen::PlainObjectBase &V; + const Eigen::PlainObjectBase &F; + DerivedV Vcut; + DerivedF Fcut; + Eigen::MatrixXd UV_out; + DerivedF FUV_out; + + // internal + DerivedF TT; + DerivedF TTi; + + // Stiffness per face + Eigen::VectorXd stiffnessVector; + DerivedV B1, B2, B3; + + public: + IGL_INLINE MIQ_class(const Eigen::PlainObjectBase &V_, + const Eigen::PlainObjectBase &F_, + const Eigen::PlainObjectBase &PD1_combed, + const Eigen::PlainObjectBase &PD2_combed, + const Eigen::Matrix &mismatch, + const Eigen::Matrix &singular, + const Eigen::Matrix &seams, + Eigen::PlainObjectBase &UV, + Eigen::PlainObjectBase &FUV, + double gradientSize = 30.0, + double stiffness = 5.0, + bool directRound = false, + unsigned int iter = 5, + unsigned int localIter = 5, + bool doRound = true, + bool singularityRound = true, + std::vector roundVertices = std::vector(), + std::vector > hardFeatures = std::vector >()); + + + IGL_INLINE void extractUV(Eigen::PlainObjectBase &UV_out, + Eigen::PlainObjectBase &FUV_out); + + private: + IGL_INLINE int NumFlips(const Eigen::MatrixXd& WUV); + + IGL_INLINE double Distortion(int f, double h, const Eigen::MatrixXd& WUV); + + IGL_INLINE double LaplaceDistortion(int f, double h, const Eigen::MatrixXd& WUV); + + IGL_INLINE bool updateStiffeningJacobianDistorsion(double grad_size, const Eigen::MatrixXd& WUV); + + IGL_INLINE bool IsFlipped(const Eigen::Vector2d &uv0, + const Eigen::Vector2d &uv1, + const Eigen::Vector2d &uv2); + + IGL_INLINE bool IsFlipped(int i, const Eigen::MatrixXd& WUV); + + }; +}; +}; +} + +IGL_INLINE igl::copyleft::comiso::SeamInfo::SeamInfo(int _v0, + int _v0p, + int _mismatch, + unsigned int _integerVar) +{ + v0=_v0; + v0p=_v0p; + integerVar=_integerVar; + mismatch=_mismatch; +} + +IGL_INLINE igl::copyleft::comiso::SeamInfo::SeamInfo(const SeamInfo &S1) +{ + v0=S1.v0; + v0p=S1.v0p; + integerVar=S1.integerVar; + mismatch=S1.mismatch; +} + + +template +IGL_INLINE igl::copyleft::comiso::VertexIndexing::VertexIndexing(const Eigen::PlainObjectBase &_V, + const Eigen::PlainObjectBase &_F, + const Eigen::PlainObjectBase &_Vcut, + const Eigen::PlainObjectBase &_Fcut, + const Eigen::PlainObjectBase &_TT, + const Eigen::PlainObjectBase &_TTi, + const Eigen::Matrix &_mismatch, + const Eigen::Matrix &_singular, + const Eigen::Matrix &_seams + ): +V(_V), +F(_F), +Vcut(_Vcut), +Fcut(_Fcut), +TT(_TT), +TTi(_TTi), +mismatch(_mismatch), +singular(_singular), +seams(_seams) +{ + #ifdef DEBUG_PRINT + cerr< +IGL_INLINE void igl::copyleft::comiso::VertexIndexing::getSeamInfo(const int f0, + const int f1, + const int indexE, + int &v0, int &v1, + int &v0p, int &v1p, + int &_mismatch) +{ + int edgef0 = indexE; + v0 = Fcut(f0,edgef0); + v1 = Fcut(f0,(edgef0+1)%3); + ////get the index on opposite side + assert(TT(f0,edgef0) == f1); + int edgef1 = TTi(f0,edgef0); + v1p = Fcut(f1,edgef1); + v0p = Fcut(f1,(edgef1+1)%3); + + _mismatch = mismatch(f0,edgef0); + assert(F(f0,edgef0) == F(f1,((edgef1+1)%3))); + assert(F(f0,((edgef0+1)%3)) == F(f1,edgef1)); +} + +template +IGL_INLINE std::vector::VertexInfo> > igl::copyleft::comiso::VertexIndexing::getVerticesPerSeam() +{ + // Return value + std::vector >verticesPerSeam; + + // for every vertex, keep track of their adjacent vertices on seams. + // regular vertices have two neighbors on a seam, start- and endvertices may have any other numbers of neighbors (e.g. 1 or 3) + std::vector > VVSeam(V.rows()); + Eigen::MatrixXi F_hit = Eigen::MatrixXi::Zero(F.rows(), 3); + for (unsigned int f=0; f startVertexIndices; + std::vector isStartVertex(V.rows()); + for (unsigned int i=0;isize(); + + // explore every seam to which this vertex is a start vertex + // note: a vertex can never be a start vertex and a regular vertex simultaneously + for (size_t j = 0; j < neighborSize; j++) + { + std::vector thisSeam; // temporary container + + // Create vertexInfo struct for start vertex + VertexInfo startVertex = VertexInfo(element, -1, -1, -1, -1);// -1 values are arbitrary (will never be used) + VertexInfo currentVertex = startVertex; + // Add start vertex to the seam + thisSeam.push_back(currentVertex); + + // advance on the seam + auto currentVertexNeighbors = startVertexNeighbors; + auto nextVertex = currentVertexNeighbors->front(); + currentVertexNeighbors->pop_front(); + + // bogus initialization due to lack of def. constructor + VertexInfo prevVertex = startVertex; + while (true) + { + // move to the next vertex + prevVertex = currentVertex; + currentVertex = nextVertex; + currentVertexNeighbors = &VVSeam[nextVertex.v]; + + // add current vertex to this seam + thisSeam.push_back(currentVertex); + + // remove the previous vertex + auto it = std::find(currentVertexNeighbors->begin(), currentVertexNeighbors->end(), prevVertex); + assert(it != currentVertexNeighbors->end()); + currentVertexNeighbors->erase(it); + + if (currentVertexNeighbors->size() == 1 && !isStartVertex[currentVertex.v]) + { + nextVertex = currentVertexNeighbors->front(); + currentVertexNeighbors->pop_front(); + } + else + break; + } + verticesPerSeam.push_back(thisSeam); + } + } + + return verticesPerSeam; +} + +template +IGL_INLINE void igl::copyleft::comiso::VertexIndexing::initSeamInfo() +{ + auto verticesPerSeam = getVerticesPerSeam(); + systemInfo.edgeSeamInfo.clear(); + unsigned int integerVar = 0; + // Loop over each seam + for(auto seam : verticesPerSeam){ + //choose initial side of the seam such that the start vertex corresponds to Fcut(f, k) and the end vertex corresponds to Fcut(f, (k+1)%3) and not vice versa. + int priorVertexIdx; + if(seam.size() > 2){ + auto v1 = seam[1]; + auto v2 = seam[2]; + if(Fcut(v1.f0, (v1.k0+1) % 3) == Fcut(v2.f0, v2.k0) || Fcut(v1.f0, (v1.k0+1) % 3) == Fcut(v2.f1, v2.k1)){ + priorVertexIdx = Fcut(v1.f0, v1.k0); + } + else{ + priorVertexIdx = Fcut(v1.f1, v1.k1); + assert(Fcut(v1.f1, (v1.k1+1) % 3) == Fcut(v2.f0, v2.k0) || Fcut(v1.f1, (v1.k1+1) % 3) == Fcut(v2.f1, v2.k1)); + } + } + else{ + auto v1 = seam[1]; + priorVertexIdx = Fcut(v1.f0, v1.k0); + } + + // Loop over each vertex of the seam + for(auto it=seam.begin()+1; it != seam.end(); ++it){ + auto vertex = *it; + // choose the correct side of the seam + int f,k,ff; + if(priorVertexIdx == Fcut(vertex.f0, vertex.k0)){ + f = vertex.f0; ff = vertex.f1; + k = vertex.k0; + } + else{ + f = vertex.f1; ff = vertex.f0; + k = vertex.k1; + assert(priorVertexIdx == Fcut(vertex.f1, vertex.k1)); + } + + int vtx0,vtx0p,vtx1,vtx1p; + int MM; + getSeamInfo(f, ff, k, vtx0, vtx1, vtx0p, vtx1p, MM); + systemInfo.edgeSeamInfo.push_back(SeamInfo(vtx0,vtx0p,MM,integerVar)); + if(it == seam.end() -1){ + systemInfo.edgeSeamInfo.push_back(SeamInfo(vtx1,vtx1p,MM,integerVar)); + } + priorVertexIdx = vtx1; + } + // use the same integer for each seam + integerVar++; + } + systemInfo.num_integer_cuts = integerVar; + +#ifndef NDEBUG + int totalNVerticesOnSeams = 0; + for(auto const & seam : verticesPerSeam){ + totalNVerticesOnSeams += seam.size(); + } + assert(systemInfo.edgeSeamInfo.size() == totalNVerticesOnSeams); +#endif +} + + + +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::solvePoisson(Eigen::VectorXd stiffness, + double gradientSize, + double gridResolution, + bool directRound, + unsigned int localIter, + bool doRound, + bool singularityRound, + const std::vector &roundVertices, + const std::vector> &hardFeatures) +{ + Handle_Stiffness = stiffness; + + //initialization of flags and data structures + integer_rounding=doRound; + + ids_to_round.clear(); + + clearUserConstraint(); + // copy the user constraints number + for (const auto & element : hardFeatures) + { + addSharpEdgeConstraint(element[0], element[1]); + } + + ///Initializing Matrix + clock_t t0 = clock(); + + ///initialize the matrix ALLOCATING SPACE + initMatrix(); + if (DEBUGPRINT) + printf("\n ALLOCATED THE MATRIX \n"); + + ///build the Laplacian system + buildLaplacianMatrix(gradientSize); + + // add seam constraints + buildSeamConstraintsExplicitTranslation(); + + // add user defined constraints + buildUserDefinedConstraints(); + + ////add the Lagrange multiplier + fixBlockedVertex(); + + if (DEBUGPRINT) + printf("\n BUILT THE MATRIX \n"); + + if (integer_rounding) + addToRoundVertices(roundVertices); + + if (singularityRound) + addSingularityRound(); + + clock_t t1 = clock(); + if (DEBUGPRINT) printf("\n time:%ld \n",t1-t0); + if (DEBUGPRINT) printf("\n SOLVING \n"); + + mixedIntegerSolve(gridResolution, directRound, localIter); + + clock_t t2 = clock(); + if (DEBUGPRINT) printf("\n time:%ld \n",t2-t1); + if (DEBUGPRINT) printf("\n ASSIGNING COORDS \n"); + + mapCoords(); + + clock_t t3 = clock(); + if (DEBUGPRINT) printf("\n time:%ld \n",t3-t2); + if (DEBUGPRINT) printf("\n FINISHED \n"); +} + +template +IGL_INLINE igl::copyleft::comiso::PoissonSolver +::PoissonSolver(const Eigen::PlainObjectBase &_V, + const Eigen::PlainObjectBase &_F, + const Eigen::PlainObjectBase &_Vcut, + const Eigen::PlainObjectBase &_Fcut, + const Eigen::PlainObjectBase &_TT, + const Eigen::PlainObjectBase &_TTi, + const Eigen::PlainObjectBase &_PD1, + const Eigen::PlainObjectBase &_PD2, + const Eigen::Matrix&_singular, + const MeshSystemInfo &_systemInfo +): +V(_V), +F(_F), +Vcut(_Vcut), +Fcut(_Fcut), +TT(_TT), +TTi(_TTi), +PD1(_PD1), +PD2(_PD2), +singular(_singular), +systemInfo(_systemInfo) +{ + n_fixed_vars = 0; + n_vert_vars = 0; + num_total_vars = 0; + n_integer_vars = 0; + num_cut_constraint = 0; + num_userdefined_constraint = 0; + num_constraint_equations = 0; + integer_rounding = false; + UV = Eigen::MatrixXd(V.rows(),2); + WUV = Eigen::MatrixXd(F.rows(),6); + UV_out = Eigen::MatrixXd(Vcut.rows(),2); + igl::vertex_triangle_adjacency(V,F,VF,VFi); +} + +///START COMMON MATH FUNCTIONS +///return the complex encoding the rotation +///for a given mismatch interval +template +IGL_INLINE std::complex igl::copyleft::comiso::PoissonSolver::getRotationComplex( + int interval) +{ + assert((interval>=0)&&(interval<4)); + + switch(interval) + { + case 0:return {1,0}; + case 1:return {0,1}; + case 2: return {-1,0}; + default:return {0,-1}; + } +} + +///END COMMON MATH FUNCTIONS + +///START FIXING VERTICES +///set a given vertex as fixed +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::addFixedVertex(int v) +{ + n_fixed_vars++; + Hard_constraints.push_back(v); +} + +///find vertex to fix in case we're using +///a vector field NB: multiple components not handled +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::findFixedVertField() +{ + Hard_constraints.clear(); + + n_fixed_vars=0; + //fix the first singularity + for (unsigned int v=0;v +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::findFixedVert() +{ + Hard_constraints.clear(); + findFixedVertField(); +} + +template +IGL_INLINE int igl::copyleft::comiso::PoissonSolver::getFirstVertexIndex(int v) +{ + return Fcut(VF[v][0],VFi[v][0]); +} + +///fix the vertices which are flagged as fixed +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::fixBlockedVertex() +{ + int offset_row = num_cut_constraint*2; + + unsigned int constr_num = 0; + for (unsigned int i=0;ivertex_index[0]; + int index = getFirstVertexIndex(v); + + ///multiply times 2 because of uv + int indexvert = index*2; + + ///find the first free row to add the constraint + int indexRow = offset_row + constr_num * 2; + int indexCol = indexRow; + + ///add fixing constraint LHS + Constraints.coeffRef(indexRow, indexvert) += 1; + Constraints.coeffRef(indexRow+1,indexvert+1) += 1; + + ///add fixing constraint RHS + constraints_rhs[indexCol] = UV(v,0); + constraints_rhs[indexCol+1] = UV(v,1); + + constr_num++; + } + assert(constr_num==n_fixed_vars); +} +///END FIXING VERTICES + +///HANDLING SINGULARITY +//set the singularity round to integer location +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::addSingularityRound() +{ + for (unsigned int v=0;v +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::addToRoundVertices(std::vector ids) +{ + for(auto index : ids) + { + if (index < 0 || index >= V.rows()) + std::cerr << "WARNING: Ignored round vertex constraint, vertex " << index << " does not exist in the mesh." << std::endl; + int index0 = getFirstVertexIndex(index); + ids_to_round.push_back( index0 * 2 ); + ids_to_round.push_back((index0 * 2)+1); + } +} + +///START GENERIC SYSTEM FUNCTIONS +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::buildLaplacianMatrix(double vfscale) +{ + Eigen::VectorXi idx = igl::LinSpaced(Vcut.rows(), 0, 2*Vcut.rows()-2); + Eigen::VectorXi idx2 = igl::LinSpaced(Vcut.rows(), 1, 2*Vcut.rows()-1); + + // get gradient matrix + Eigen::SparseMatrix G(Fcut.rows() * 3, Vcut.rows()); + igl::grad(Vcut, Fcut, G); + + // get triangle weights + Eigen::VectorXd dblA(Fcut.rows()); + igl::doublearea(Vcut, Fcut, dblA); + + // compute intermediate result + Eigen::SparseMatrix G2; + G2 = G.transpose() * dblA.replicate<3,1>().asDiagonal() * Handle_Stiffness.replicate<3,1>().asDiagonal(); + + /// Compute LHS + Eigen::SparseMatrix Cotmatrix; + Cotmatrix = 0.5 * G2 * G; + igl::slice_into(Cotmatrix, idx, idx, Lhs); + igl::slice_into(Cotmatrix, idx2, idx2, Lhs); + + /// Compute RHS + // reshape nrosy vectors + const Eigen::MatrixXd u = Eigen::Map(PD1.data(),Fcut.rows()*3,1); // this mimics a reshape at the cost of a copy. + const Eigen::MatrixXd v = Eigen::Map(PD2.data(),Fcut.rows()*3,1); // this mimics a reshape at the cost of a copy. + + // multiply with weights + Eigen::VectorXd rhs1 = G2 * u * 0.5 * vfscale; + Eigen::VectorXd rhs2 = -G2 * v * 0.5 * vfscale; + igl::slice_into(rhs1, idx, 1, rhs); + igl::slice_into(rhs2, idx2, 1, rhs); +} + +///find different sized of the system +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::findSizes() +{ + ///find the vertex that need to be fixed + findFixedVert(); + + ///REAL PART + n_vert_vars = systemInfo.num_vert_variables; + + ///INTEGER PART + ///the total number of integer variables + n_integer_vars = systemInfo.num_integer_cuts; + + ///CONSTRAINT PART + num_cut_constraint = systemInfo.edgeSeamInfo.size(); + + num_constraint_equations = num_cut_constraint * 2 + n_fixed_vars * 2 + num_userdefined_constraint; + + ///total variable of the system + num_total_vars = (n_vert_vars+n_integer_vars) * 2; + + ///initialize matrix size + + if (DEBUGPRINT) printf("\n*** SYSTEM VARIABLES *** \n"); + if (DEBUGPRINT) printf("* NUM REAL VERTEX VARIABLES %ud \n",n_vert_vars); + + if (DEBUGPRINT) printf("\n*** INTEGER VARIABLES *** \n"); + if (DEBUGPRINT) printf("* NUM INTEGER VARIABLES %ud \n",n_integer_vars); + + if (DEBUGPRINT) printf("\n*** CONSTRAINTS *** \n "); + if (DEBUGPRINT) printf("* NUM FIXED CONSTRAINTS %ud\n",n_fixed_vars); + if (DEBUGPRINT) printf("* NUM CUTS CONSTRAINTS %ud\n",num_cut_constraint); + if (DEBUGPRINT) printf("* NUM USER DEFINED CONSTRAINTS %ud\n",num_userdefined_constraint); + + if (DEBUGPRINT) printf("\n*** TOTAL SIZE *** \n"); + if (DEBUGPRINT) printf("* TOTAL VARIABLE SIZE (WITH INTEGER TRASL) %ud \n",num_total_vars); + if (DEBUGPRINT) printf("* TOTAL CONSTRAINTS %ud \n",num_constraint_equations); +} + +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::allocateSystem() +{ + Lhs.resize(n_vert_vars * 2, n_vert_vars * 2); + Constraints.resize(num_constraint_equations, num_total_vars); + rhs.resize(n_vert_vars * 2); + constraints_rhs.resize(num_constraint_equations); + + printf("\n INITIALIZED SPARSE MATRIX OF %ud x %ud \n",n_vert_vars*2, n_vert_vars*2); + printf("\n INITIALIZED SPARSE MATRIX OF %ud x %ud \n",num_constraint_equations, num_total_vars); + printf("\n INITIALIZED VECTOR OF %ud x 1 \n",n_vert_vars*2); + printf("\n INITIALIZED VECTOR OF %ud x 1 \n",num_constraint_equations); +} + +///intitialize the whole matrix +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::initMatrix() +{ + findSizes(); + allocateSystem(); +} + +///map back coordinates after that +///the system has been solved +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::mapCoords() +{ + ///map coords to faces + for (unsigned int f=0;f +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::buildSeamConstraintsExplicitTranslation() +{ + ///current constraint row + int constr_row = 0; + + for (unsigned int i=0; i rot = getRotationComplex(interval); + + ///get the integer variable + unsigned int integerVar = n_vert_vars + systemInfo.edgeSeamInfo[i].integerVar; + + if (integer_rounding) + { + ids_to_round.push_back(integerVar*2); + ids_to_round.push_back(integerVar*2+1); + } + + // cross boundary compatibility conditions + Constraints.coeffRef(constr_row, 2*p0) += rot.real(); + Constraints.coeffRef(constr_row, 2*p0+1) += -rot.imag(); + Constraints.coeffRef(constr_row+1, 2*p0) += rot.imag(); + Constraints.coeffRef(constr_row+1, 2*p0+1) += rot.real(); + + Constraints.coeffRef(constr_row, 2*p0p) += -1; + Constraints.coeffRef(constr_row+1, 2*p0p+1) += -1; + + Constraints.coeffRef(constr_row, 2*integerVar) += 1; + Constraints.coeffRef(constr_row+1, 2*integerVar+1) += 1; + + constraints_rhs[constr_row] = 0; + constraints_rhs[constr_row+1] = 0; + + constr_row += 2; + } + +} + +///set the constraints for the inter-range cuts +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::buildUserDefinedConstraints() +{ + /// the user defined constraints are at the end + unsigned int constr_row = num_cut_constraint*2 + n_fixed_vars*2; + + assert(num_userdefined_constraint == userdefined_constraints.size()); + + for (unsigned int i = 0; i < num_userdefined_constraint; i++) + { + for (unsigned int j = 0; j < userdefined_constraints[i].size()-1; ++j) + { + Constraints.coeffRef(constr_row, j) = userdefined_constraints[i][j]; + } + + constraints_rhs[constr_row] = userdefined_constraints[i][userdefined_constraints[i].size()-1]; + constr_row +=1; + } +} + +///call of the mixed integer solver +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::mixedIntegerSolve(double coneGridRes, + bool directRound, + unsigned int localIter) +{ + X = std::vector((n_vert_vars+n_integer_vars)*2); + if (DEBUGPRINT) + printf("\n ALLOCATED X \n"); + + ///variables part + const int sizeMatrix = (n_vert_vars + n_integer_vars) * 2; + const int scalarSize = n_vert_vars * 2; + + ///matrix A + gmm::col_matrix< gmm::wsvector< double > > A(sizeMatrix,sizeMatrix); // lhs matrix variables + + ///constraints part + int CsizeX = num_constraint_equations; + int CsizeY = sizeMatrix+1; + gmm::row_matrix< gmm::wsvector< double > > C(CsizeX,CsizeY); // constraints + + if (DEBUGPRINT) + printf("\n ALLOCATED QMM STRUCTURES \n"); + + std::vector B(sizeMatrix,0); // rhs + + if (DEBUGPRINT) + printf("\n ALLOCATED RHS STRUCTURES \n"); + + //// copy LHS + for (int k=0; k < Lhs.outerSize(); ++k){ + for (Eigen::SparseMatrix::InnerIterator it(Lhs,k); it; ++it){ + int row = it.row(); + int col = it.col(); + A(row, col) += it.value(); + } + } + //// copy Constraints + for (int k=0; k < Constraints.outerSize(); ++k){ + for (Eigen::SparseMatrix::InnerIterator it(Constraints,k); it; ++it){ + int row = it.row(); + int col = it.col(); + C(row, col) += it.value(); + } + } + + if (DEBUGPRINT) + printf("\n SET %d INTEGER VALUES \n",n_integer_vars); + + int offline_index = scalarSize; + for(unsigned int i = 0; i < n_integer_vars*2; ++i) + { + int index=offline_index+i; + A(index, index) = PENALIZATION; + } + + if (DEBUGPRINT) + printf("\n SET RHS \n"); + + // copy RHS + for(unsigned int i = 0; i < scalarSize; ++i) + { + B[i] = rhs[i] * coneGridRes; + } + + // copy constraint RHS + if (DEBUGPRINT) + printf("\n SET %d CONSTRAINTS \n",num_constraint_equations); + + for(unsigned int i = 0; i < num_constraint_equations; ++i) + { + C(i, sizeMatrix) = -constraints_rhs[i] * coneGridRes; + } + + COMISO::ConstrainedSolver solver; + + solver.misolver().set_local_iters(localIter); + + solver.misolver().set_direct_rounding(directRound); + + std::sort(ids_to_round.begin(),ids_to_round.end()); + auto new_end=std::unique(ids_to_round.begin(),ids_to_round.end()); + long int dist = distance(ids_to_round.begin(),new_end); + ids_to_round.resize(dist); + + solver.solve( C, A, X, B, ids_to_round, 0.0, false, false); +} + +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::clearUserConstraint() +{ + num_userdefined_constraint = 0; + userdefined_constraints.clear(); +} + +template +IGL_INLINE void igl::copyleft::comiso::PoissonSolver::addSharpEdgeConstraint(int fid, int vid) +{ + // prepare constraint + std::vector c(systemInfo.num_vert_variables*2 + 1, 0); + + int v1 = Fcut(fid,vid); + int v2 = Fcut(fid,(vid+1)%3); + + Eigen::Matrix e = Vcut.row(v2) - Vcut.row(v1); + e = e.normalized(); + + double d1 = fabs(e.dot(PD1.row(fid).normalized())); + double d2 = fabs(e.dot(PD2.row(fid).normalized())); + + int offset = 0; + + if (d1>d2) + offset = 1; + + ids_to_round.push_back((v1 * 2) + offset); + ids_to_round.push_back((v2 * 2) + offset); + + // add constraint + c[(v1 * 2) + offset] = 1; + c[(v2 * 2) + offset] = -1; + + // add to the user-defined constraints + num_userdefined_constraint++; + userdefined_constraints.push_back(c); + +} + + + +template +IGL_INLINE igl::copyleft::comiso::MIQ_class::MIQ_class( + const Eigen::PlainObjectBase &V_, + const Eigen::PlainObjectBase &F_, + const Eigen::PlainObjectBase &PD1_combed, + const Eigen::PlainObjectBase &PD2_combed, + const Eigen::Matrix &mismatch, + const Eigen::Matrix &singular, + const Eigen::Matrix &seams, + Eigen::PlainObjectBase &UV, + Eigen::PlainObjectBase &FUV, + double gradientSize, + double stiffness, + bool directRound, + unsigned int iter, + unsigned int localIter, + bool doRound, + bool singularityRound, + std::vector roundVertices, + std::vector > hardFeatures): +V(V_), +F(F_) +{ + igl::cut_mesh(V, F, seams, Vcut, Fcut); + + igl::local_basis(V,F,B1,B2,B3); + igl::triangle_triangle_adjacency(F,TT,TTi); + + // Prepare indexing for the linear system + VertexIndexing VInd(V, F, Vcut, Fcut, TT, TTi, mismatch, singular, seams); + + VInd.initSeamInfo(); + + // Assemble the system and solve + PoissonSolver PSolver(V, + F, + Vcut, + Fcut, + TT, + TTi, + PD1_combed, + PD2_combed, + singular, + VInd.systemInfo); + stiffnessVector = Eigen::VectorXd::Constant(F.rows(),1); + + + if (iter > 0) // do stiffening + { + for (unsigned int i=0;i +IGL_INLINE void igl::copyleft::comiso::MIQ_class::extractUV(Eigen::PlainObjectBase &UV_out, + Eigen::PlainObjectBase &FUV_out) +{ + UV_out = this->UV_out; + FUV_out = this->FUV_out; +} + +template +IGL_INLINE int igl::copyleft::comiso::MIQ_class::NumFlips(const Eigen::MatrixXd& WUV) +{ + int numFl=0; + for (unsigned int i=0;i +IGL_INLINE double igl::copyleft::comiso::MIQ_class::Distortion(int f, double h, const Eigen::MatrixXd& WUV) +{ + assert(h > 0); + + Eigen::Vector2d uv0,uv1,uv2; + + uv0 << WUV(f,0), WUV(f,1); + uv1 << WUV(f,2), WUV(f,3); + uv2 << WUV(f,4), WUV(f,5); + + Eigen::Matrix p0 = Vcut.row(Fcut(f,0)); + Eigen::Matrix p1 = Vcut.row(Fcut(f,1)); + Eigen::Matrix p2 = Vcut.row(Fcut(f,2)); + + Eigen::Matrix norm = (p1 - p0).cross(p2 - p0); + double area2 = norm.norm(); + double area2_inv = 1.0 / area2; + norm *= area2_inv; + + if (area2 > 0) + { + // Singular values of the Jacobian + Eigen::Matrix neg_t0 = norm.cross(p2 - p1); + Eigen::Matrix neg_t1 = norm.cross(p0 - p2); + Eigen::Matrix neg_t2 = norm.cross(p1 - p0); + + Eigen::Matrix diffu = (neg_t0 * uv0(0) +neg_t1 *uv1(0) + neg_t2 * uv2(0) )*area2_inv; + Eigen::Matrix diffv = (neg_t0 * uv0(1) + neg_t1*uv1(1) + neg_t2*uv2(1) )*area2_inv; + + // first fundamental form + double I00 = diffu.dot(diffu); // guaranteed non-neg + double I01 = diffu.dot(diffv); // I01 = I10 + double I11 = diffv.dot(diffv); // guaranteed non-neg + + // eigenvalues of a 2x2 matrix + // [a00 a01] + // [a10 a11] + // 1/2 * [ (a00 + a11) +/- sqrt((a00 - a11)^2 + 4 a01 a10) ] + double trI = I00 + I11; // guaranteed non-neg + double diffDiag = I00 - I11; // guaranteed non-neg + double sqrtDet = sqrt(std::max(0.0, diffDiag*diffDiag + + 4 * I01 * I01)); // guaranteed non-neg + double sig1 = 0.5 * (trI + sqrtDet); // higher singular value + double sig2 = 0.5 * (trI - sqrtDet); // lower singular value + + // Avoid sig2 < 0 due to numerical error + if (fabs(sig2) < 1.0e-8) + sig2 = 0; + + assert(sig1 >= 0); + assert(sig2 >= 0); + + if (sig2 < 0) { + printf("Distortion will be NaN! sig1^2 is negative (%lg)\n", + sig2); + } + + // The singular values of the Jacobian are the sqrts of the + // eigenvalues of the first fundamental form. + sig1 = sqrt(sig1); + sig2 = sqrt(sig2); + + // distortion + double tao = IsFlipped(f,WUV) ? -1 : 1; + double factor = tao / h; + double lam = fabs(factor * sig1 - 1) + fabs(factor * sig2 - 1); + return lam; + } + else { + return 10; // something "large" + } +} + +//////////////////////////////////////////////////////////////////////////// +// Approximate the distortion Laplacian using a uniform Laplacian on +// the dual mesh: +// ___________ +// \-1 / \-1 / +// \ / 3 \ / +// \-----/ +// \-1 / +// \ / +// +// @param[in] f facet on which to compute distortion Laplacian +// @param[in] h scaling factor applied to cross field +// @return distortion Laplacian for f +/////////////////////////////////////////////////////////////////////////// +template +IGL_INLINE double igl::copyleft::comiso::MIQ_class::LaplaceDistortion(const int f, double h, const Eigen::MatrixXd& WUV) +{ + double mydist = Distortion(f, h, WUV); + double lapl=0; + for (int i=0;i<3;i++) + { + if (TT(f,i) != -1) + lapl += (mydist - Distortion(TT(f,i), h, WUV)); + } + return lapl; +} + +template +IGL_INLINE bool igl::copyleft::comiso::MIQ_class::updateStiffeningJacobianDistorsion(double grad_size, const Eigen::MatrixXd& WUV) +{ + bool flipped = NumFlips(WUV)>0; + + if (!flipped) + return false; + + double maxL=0; + double maxD=0; + + if (flipped) + { + const double c = 1.0; + const double d = 5.0; + + for (unsigned int i = 0; i < Fcut.rows(); ++i) + { + double dist=Distortion(i,grad_size,WUV); + if (dist > maxD) + maxD=dist; + + double absLap=fabs(LaplaceDistortion(i, grad_size,WUV)); + if (absLap > maxL) + maxL = absLap; + + double stiffDelta = std::min(c * absLap, d); + + stiffnessVector[i]+=stiffDelta; + } + } + printf("Maximum Distorsion %4.4f \n",maxD); + printf("Maximum Laplacian %4.4f \n",maxL); + return flipped; +} + +template +IGL_INLINE bool igl::copyleft::comiso::MIQ_class::IsFlipped(const Eigen::Vector2d &uv0, + const Eigen::Vector2d &uv1, + const Eigen::Vector2d &uv2) +{ + Eigen::Vector2d e0 = (uv1-uv0); + Eigen::Vector2d e1 = (uv2-uv0); + + double Area = e0(0)*e1(1) - e0(1)*e1(0); + return (Area<=0); +} + +template +IGL_INLINE bool igl::copyleft::comiso::MIQ_class::IsFlipped( + const int i, const Eigen::MatrixXd& WUV) +{ + Eigen::Vector2d uv0,uv1,uv2; + uv0 << WUV(i,0), WUV(i,1); + uv1 << WUV(i,2), WUV(i,3); + uv2 << WUV(i,4), WUV(i,5); + + return (IsFlipped(uv0,uv1,uv2)); +} + + + + +template +IGL_INLINE void igl::copyleft::comiso::miq( + const Eigen::PlainObjectBase &V, + const Eigen::PlainObjectBase &F, + const Eigen::PlainObjectBase &PD1_combed, + const Eigen::PlainObjectBase &PD2_combed, + const Eigen::Matrix &mismatch, + const Eigen::Matrix &singular, + const Eigen::Matrix &seams, + Eigen::PlainObjectBase &UV, + Eigen::PlainObjectBase &FUV, + double gradientSize, + double stiffness, + bool directRound, + unsigned int iter, + unsigned int localIter, + bool doRound, + bool singularityRound, + const std::vector &roundVertices, + const std::vector> &hardFeatures) +{ + gradientSize = gradientSize/(V.colwise().maxCoeff()-V.colwise().minCoeff()).norm(); + + igl::copyleft::comiso::MIQ_class miq(V, + F, + PD1_combed, + PD2_combed, + mismatch, + singular, + seams, + UV, + FUV, + gradientSize, + stiffness, + directRound, + iter, + localIter, + doRound, + singularityRound, + roundVertices, + hardFeatures); + + miq.extractUV(UV,FUV); +} + +template +IGL_INLINE void igl::copyleft::comiso::miq( + const Eigen::PlainObjectBase &V, + const Eigen::PlainObjectBase &F, + const Eigen::PlainObjectBase &PD1, + const Eigen::PlainObjectBase &PD2, + Eigen::PlainObjectBase &UV, + Eigen::PlainObjectBase &FUV, + double gradientSize, + double stiffness, + bool directRound, + unsigned int iter, + unsigned int localIter, + bool doRound, + bool singularityRound, + const std::vector &roundVertices, + const std::vector> &hardFeatures) +{ + + DerivedV BIS1, BIS2; + igl::compute_frame_field_bisectors(V, F, PD1, PD2, BIS1, BIS2); + + DerivedV BIS1_combed, BIS2_combed; + igl::comb_cross_field(V, F, BIS1, BIS2, BIS1_combed, BIS2_combed); + + DerivedF Handle_MMatch; + igl::cross_field_mismatch(V, F, BIS1_combed, BIS2_combed, true, Handle_MMatch); + + Eigen::Matrix isSingularity, singularityIndex; + igl::find_cross_field_singularities(V, F, Handle_MMatch, isSingularity, singularityIndex); + + Eigen::Matrix Handle_Seams; + igl::cut_mesh_from_singularities(V, F, Handle_MMatch, Handle_Seams); + + DerivedV PD1_combed, PD2_combed; + igl::comb_frame_field(V, F, PD1, PD2, BIS1_combed, BIS2_combed, PD1_combed, PD2_combed); + + igl::copyleft::comiso::miq(V, + F, + PD1_combed, + PD2_combed, + Handle_MMatch, + isSingularity, + Handle_Seams, + UV, + FUV, + gradientSize, + stiffness, + directRound, + iter, + localIter, + doRound, + singularityRound, + roundVertices, + hardFeatures); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::copyleft::comiso::miq, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &, double, double, bool, unsigned int, unsigned int, bool, bool, const std::vector &, const std::vector> &); +template void igl::copyleft::comiso::miq, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::Matrix const &, Eigen::Matrix const &, Eigen::Matrix const &, Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &, double, double, bool, unsigned int, unsigned int, bool, bool, const std::vector &, const std::vector> &); +template void igl::copyleft::comiso::miq, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > const &, Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &, double, double, bool, unsigned int, unsigned int, bool, bool, const std::vector &, const std::vector> &); +#endif diff --git a/vendor/libigl/include/igl/copyleft/comiso/miq.h b/vendor/libigl/include/igl/copyleft/comiso/miq.h new file mode 100644 index 0000000000000000000000000000000000000000..80b4db9c1f28d81d968c1b24ab0019d82d4ae375 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/comiso/miq.h @@ -0,0 +1,124 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo , Olga Diamanti , Kevin Walliman +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COMISO_MIQ_H +#define IGL_COMISO_MIQ_H +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace comiso + { + // Global seamless parametrization aligned with a given per-face Jacobian (PD1, PD2). + // The algorithm is based on + // "Mixed-Integer Quadrangulation" by D. Bommes, H. Zimmer, L. Kobbelt + // ACM SIGGRAPH 2009, Article No. 77 (http://dl.acm.org/citation.cfm?id=1531383) + // We thank Nico Pietroni for providing a reference implementation of MIQ + // on which our code is based. + + // Limitations: + // - Due to the way of handling of hardFeatures the algorithm may fail in difficult cases. + // - Meshes with boundaries are not hendled properly i.e., jagged edges along the boundary are possible + + // Input: + // V #V by 3 list of mesh vertex 3D positions + // F #F by 3 list of faces indices in V + // PD1 #V by 3 first line of the Jacobian per triangle + // PD2 #V by 3 second line of the Jacobian per triangle + // (optional, if empty it will be a vector in the tangent plane orthogonal to PD1) + // gradientSize global scaling for the gradient (controls the quads resolution) + // stiffness weight for the stiffness iterations (Reserved but not used!) + // directRound greedily round all integer variables at once (greatly improves optimization speed but lowers quality) + // iter stiffness iterations (0 = no stiffness) + // localIter number of local iterations for the integer rounding + // doRound enables the integer rounding (disabling it could be useful for debugging) + // singularityRound set true/false to decide if the singularities' coordinates should be rounded to the nearest integers + // roundVertices id of additional vertices that should be snapped to integer coordinates + // hardFeatures #H by 2 list of pairs of vertices that belongs to edges that should be snapped to integer coordinates + // + // Output: + // UV #UV by 2 list of vertices in 2D + // FUV #FUV by 3 list of face indices in UV + // + template + IGL_INLINE void miq( + const Eigen::PlainObjectBase &V, + const Eigen::PlainObjectBase &F, + const Eigen::PlainObjectBase &PD1, + const Eigen::PlainObjectBase &PD2, + Eigen::PlainObjectBase &UV, + Eigen::PlainObjectBase &FUV, + double gradientSize = 30.0, + double stiffness = 5.0, + bool directRound = false, + unsigned int iter = 5, + unsigned int localIter = 5, + bool doRound = true, + bool singularityRound = true, + const std::vector &roundVertices = std::vector(), + const std::vector> &hardFeatures = std::vector >()); + + // Helper function that allows to directly provided pre-combed bisectors for an already cut mesh + + // Input: + // V #V by 3 list of mesh vertex 3D positions + // F #F by 3 list of faces indices in V + + // Additional Input: + // PD1_combed #F by 3 first combed Jacobian + // PD2_combed #F by 3 second combed Jacobian + // mismatch #F by 3 list of per-corner integer PI/2 rotations + // singular #V list of flag that denotes if a vertex is singular or not + // seams #F by 3 list of per-corner flag that denotes seams + + // Input: + // gradientSize global scaling for the gradient (controls the quads resolution) + // stiffness weight for the stiffness iterations (Reserved but not used!) + // directRound greedily round all integer variables at once (greatly improves optimization speed but lowers quality) + // iter stiffness iterations (0 = no stiffness) + // localIter number of local iterations for the integer rounding + // doRound enables the integer rounding (disabling it could be useful for debugging) + // singularityRound set true/false to decide if the singularities' coordinates should be rounded to the nearest integers + // roundVertices id of additional vertices that should be snapped to integer coordinates + // hardFeatures #H by 2 list of pairs of vertices that belongs to edges that should be snapped to integer coordinates + + // Output: + // UV #UV by 2 list of vertices in 2D + // FUV #FUV by 3 list of face indices in UV + // + template + IGL_INLINE void miq( + const Eigen::PlainObjectBase &V, + const Eigen::PlainObjectBase &F, + const Eigen::PlainObjectBase &PD1_combed, + const Eigen::PlainObjectBase &PD2_combed, + const Eigen::Matrix &mismatch, + const Eigen::Matrix &singular, + const Eigen::Matrix &seams, + Eigen::PlainObjectBase &UV, + Eigen::PlainObjectBase &FUV, + double gradientSize = 30.0, + double stiffness = 5.0, + bool directRound = false, + unsigned int iter = 5, + unsigned int localIter = 5, + bool doRound = true, + bool singularityRound = true, + const std::vector &roundVertices = std::vector(), + const std::vector> &hardFeatures = std::vector >()); + }; +}; +}; +#ifndef IGL_STATIC_LIBRARY +#include "miq.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/comiso/nrosy.cpp b/vendor/libigl/include/igl/copyleft/comiso/nrosy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1b2c4d74ef07f213b95a4060e7bbf143c7f26d86 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/comiso/nrosy.cpp @@ -0,0 +1,783 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "nrosy.h" + +#include +#include +#include +#include + +#include +#include "../../PI.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace igl +{ +namespace copyleft +{ + +namespace comiso +{ +class NRosyField +{ +public: + // Init + IGL_INLINE NRosyField(const Eigen::MatrixXd& _V, const Eigen::MatrixXi& _F); + + // Generate the N-rosy field + // N degree of the rosy field + // round separately: round the integer variables one at a time, slower but higher quality + IGL_INLINE void solve(int N = 4); + + // Set a hard constraint on fid + // fid: face id + // v: direction to fix (in 3d) + IGL_INLINE void setConstraintHard(int fid, const Eigen::Vector3d& v); + + // Set a soft constraint on fid + // fid: face id + // w: weight of the soft constraint, clipped between 0 and 1 + // v: direction to fix (in 3d) + IGL_INLINE void setConstraintSoft(int fid, double w, const Eigen::Vector3d& v); + + // Set the ratio between smoothness and soft constraints (0 -> smoothness only, 1 -> soft constr only) + IGL_INLINE void setSoftAlpha(double alpha); + + // Reset constraints (at least one constraint must be present or solve will fail) + IGL_INLINE void resetConstraints(); + + // Return the current field + IGL_INLINE Eigen::MatrixXd getFieldPerFace(); + + // Compute singularity indexes + IGL_INLINE void findCones(int N); + + // Return the singularities + IGL_INLINE Eigen::VectorXd getSingularityIndexPerVertex(); + +private: + // Compute angle differences between reference frames + IGL_INLINE void computek(); + + // Remove useless matchings + IGL_INLINE void reduceSpace(); + + // Prepare the system matrix + IGL_INLINE void prepareSystemMatrix(int N); + + // Solve with roundings using CoMIso + IGL_INLINE void solveRoundings(); + + // Convert a vector in 3d to an angle wrt the local reference system + IGL_INLINE double convert3DtoLocal(unsigned fid, const Eigen::Vector3d& v); + + // Convert an angle wrt the local reference system to a 3d vector + IGL_INLINE Eigen::Vector3d convertLocalto3D(unsigned fid, double a); + + // Compute the per vertex angle defect + IGL_INLINE Eigen::VectorXd angleDefect(); + + // Temporary variable for the field + Eigen::VectorXd angles; + + // Hard constraints + Eigen::VectorXd hard; + std::vector isHard; + + // Soft constraints + Eigen::VectorXd soft; + Eigen::VectorXd wSoft; + double softAlpha; + + // Face Topology + Eigen::MatrixXi TT, TTi; + + // Edge Topology + Eigen::MatrixXi EV, FE, EF; + std::vector isBorderEdge; + + // Per Edge information + // Angle between two reference frames + Eigen::VectorXd k; + + // Jumps + Eigen::VectorXi p; + std::vector pFixed; + + // Mesh + Eigen::MatrixXd V; + Eigen::MatrixXi F; + + // Normals per face + Eigen::MatrixXd N; + + // Singularity index + Eigen::VectorXd singularityIndex; + + // Reference frame per triangle + std::vector TPs; + + // System stuff + Eigen::SparseMatrix A; + Eigen::VectorXd b; + Eigen::VectorXi tag_t; + Eigen::VectorXi tag_p; + +}; + +} // NAMESPACE COMISO +} // NAMESPACE COPYLEFT +} // NAMESPACE IGL + +igl::copyleft::comiso::NRosyField::NRosyField(const Eigen::MatrixXd& _V, const Eigen::MatrixXi& _F) +{ + V = _V; + F = _F; + + assert(V.rows() > 0); + assert(F.rows() > 0); + + // Generate topological relations + igl::triangle_triangle_adjacency(F,TT,TTi); + igl::edge_topology(V,F, EV, FE, EF); + + // Flag border edges + isBorderEdge.resize(EV.rows()); + for(unsigned i=0; i= 0 && alpha < 1); + softAlpha = alpha; +} + + +void igl::copyleft::comiso::NRosyField::prepareSystemMatrix(const int N) +{ + double Nd = N; + + // Minimize the MIQ energy + // Energy on edge ij is + // (t_i - t_j + kij + pij*(2*pi/N))^2 + // Partial derivatives: + // t_i: 2 ( t_i - t_j + kij + pij*(2*pi/N)) = 0 + // t_j: 2 (-t_i + t_j - kij - pij*(2*pi/N)) = 0 + // pij: 4pi/N ( t_i - t_j + kij + pij*(2*pi/N)) = 0 + // + // t_i t_j pij kij + // t_i [ 2 -2 4pi/N 2 ] + // t_j [ -2 2 -4pi/N -2 ] + // pij [ 4pi/N -4pi/N 2*(2pi/N)^2 4pi/N ] + + // Count and tag the variables + tag_t = Eigen::VectorXi::Constant(F.rows(),-1); + std::vector id_t; + size_t count = 0; + for(unsigned i=0; i id_p; + for(unsigned i=0; i > T; + T.reserve(3 * 4 * count_p); + + for(auto eid : id_p) + { + int i = EF(eid, 0); + int j = EF(eid, 1); + bool isFixed_i = isHard[i]; + bool isFixed_j = isHard[j]; + bool isFixed_p = pFixed[eid]; + int row; + // (i)-th row: t_i [ 2 -2 4pi/N 2 ] + if (!isFixed_i) + { + row = tag_t[i]; + T.emplace_back(row, tag_t[i], 2); + if (isFixed_j) + b(row) += 2 * hard[j]; + else + T.emplace_back(row, tag_t[j], -2); + if (isFixed_p) + b(row) += -((4. * igl::PI) / Nd) * p[eid]; + else + T.emplace_back(row, tag_p[eid], ((4. * igl::PI) / Nd)); + b(row) += -2 * k[eid]; + assert(hard[i] == hard[i]); + assert(hard[j] == hard[j]); + assert(p[eid] == p[eid]); + assert(k[eid] == k[eid]); + assert(b(row) == b(row)); + } + // (j)+1 -th row: t_j [ -2 2 -4pi/N -2 ] + if (!isFixed_j) + { + row = tag_t[j]; + T.emplace_back(row, tag_t[j], 2); + if (isFixed_i) + b(row) += 2 * hard[i]; + else + T.emplace_back(row, tag_t[i], -2); + if (isFixed_p) + b(row) += ((4. * igl::PI) / Nd) * p[eid]; + else + T.emplace_back(row, tag_p[eid], -((4. * igl::PI) / Nd)); + b(row) += 2 * k[eid]; + assert(k[eid] == k[eid]); + assert(b(row) == b(row)); + } + // (r*3)+2 -th row: pij [ 4pi/N -4pi/N 2*(2pi/N)^2 4pi/N ] + if (!isFixed_p) + { + row = tag_p[eid]; + T.emplace_back(row, tag_p[eid], (2. * pow(((2. * igl::PI) / Nd), 2))); + if (isFixed_i) + b(row) += -(4. * igl::PI) / Nd * hard[i]; + else + T.emplace_back(row, tag_t[i], (4. * igl::PI) / Nd); + if (isFixed_j) + b(row) += (4. * igl::PI) / Nd * hard[j]; + else + T.emplace_back(row,tag_t[j], -(4. * igl::PI) / Nd); + b(row) += - (4 * igl::PI)/Nd * k[eid]; + assert(k[eid] == k[eid]); + assert(b(row) == b(row)); + } + } + + A.resize(count_t + count_p, count_t + count_p); + A.setFromTriplets(T.begin(), T.end()); + + // Soft constraints + bool addSoft = false; + + for(unsigned i=0; i > TSoft; + TSoft.reserve(2 * count_p); + + for(unsigned i=0; i ASoft(count_t + count_p, count_t + count_p); + ASoft.setFromTriplets(TSoft.begin(), TSoft.end()); + + A = (1.0 - softAlpha) * A + softAlpha * ASoft; + b = b * (1.0 - softAlpha) + bSoft * softAlpha; + } +} + +void igl::copyleft::comiso::NRosyField::solveRoundings() +{ + unsigned n = A.rows(); + + gmm::col_matrix< gmm::wsvector< double > > gmm_A(n, n); + std::vector gmm_b(n); + std::vector ids_to_round; + std::vector x(n); + + // Copy A + for (int k=0; k::InnerIterator it(A, k); it; ++it) + { + gmm_A(it.row(),it.col()) += it.value(); + } + + // Copy b + for(unsigned int i = 0; i < n;++i) + gmm_b[i] = b[i]; + + // Set variables to round + ids_to_round.clear(); + for(unsigned i=0; i > gmm_C(0, n); + + COMISO::ConstrainedSolver cs; + cs.solve(gmm_C, gmm_A, x, gmm_b, ids_to_round, 0.0, false, true); + + // Copy the result back + for(unsigned i=0; i igl::PI) + ktemp -= 2*igl::PI; + + // just to be sure, rotate ref0 using angle ktemp... + Eigen::MatrixXd R2(2,2); + R2 << std::cos(-ktemp), -std::sin(-ktemp), std::sin(-ktemp), std::cos(-ktemp); + + tmp = R2*ref0.head<2>(); + + assert(tmp(0) - ref1(0) < 1e-10); + assert(tmp(1) - ref1(1) < 1e-10); + + k[eid] = ktemp; + } + } + +} + +void igl::copyleft::comiso::NRosyField::reduceSpace() +{ + // All variables are free in the beginning + for(unsigned int i = 0; i < EV.rows(); ++i) + pFixed[i] = false; + + std::vector visited(EV.rows(), false); + std::vector starting(EV.rows(), false); + + std::queue q; + for(unsigned int i = 0; i < F.rows(); ++i) + if (isHard[i] || wSoft[i] != 0) + { + q.push(i); + starting[i] = true; + } + + // Reduce the search space (see MI paper) + while (!q.empty()) + { + int c = q.front(); + q.pop(); + + visited[c] = true; + for(int i=0; i<3; ++i) + { + int eid = FE(c,i); + int fid = TT(c,i); + + // skip borders + if (fid != -1) + { + assert((EF(eid,0) == c && EF(eid,1) == fid) || (EF(eid,1) == c && EF(eid,0) == fid)); + // for every neighbouring face + if (!visited[fid] && !starting[fid]) + { + pFixed[eid] = true; + p[eid] = 0; + visited[fid] = true; + q.push(fid); + } + } + else + { + // fix borders + pFixed[eid] = true; + p[eid] = 0; + } + } + } + + // Force matchings between fixed faces + for(unsigned int i = 0; i < F.rows();++i) + { + if (isHard[i]) + { + for(unsigned int j = 0; j < 3; ++j) + { + int fid = TT(i,j); + if ((fid!=-1) && (isHard[fid])) + { + // i and fid are adjacent and fixed + int eid = FE(i,j); + int fid0 = EF(eid,0); + int fid1 = EF(eid,1); + + pFixed[eid] = true; + p[eid] = (int)std::round(2.0 / igl::PI * (hard(fid1) - hard(fid0) - k(eid))); + } + } + } + } +} + +double igl::copyleft::comiso::NRosyField::convert3DtoLocal(unsigned fid, const Eigen::Vector3d& v) +{ + // Project onto the tangent plane + Eigen::Vector2d vp = TPs[fid] * v; + + // Convert to angle + return std::atan2(vp(1), vp(0)); +} + +Eigen::Vector3d igl::copyleft::comiso::NRosyField::convertLocalto3D(unsigned fid, double a) +{ + Eigen::Vector2d vp(std::cos(a), std::sin(a)); + return vp.transpose() * TPs[fid]; +} + +Eigen::VectorXd igl::copyleft::comiso::NRosyField::angleDefect() +{ + Eigen::VectorXd A = Eigen::VectorXd::Constant(V.rows(), 2*igl::PI); + + for (unsigned int i = 0; i < F.rows(); ++i) + { + for (int j = 0; j < 3; ++j) + { + Eigen::VectorXd a = V.row(F(i,(j+1)%3)) - V.row(F(i,j)); + Eigen::VectorXd b = V.row(F(i,(j+2)%3)) - V.row(F(i,j)); + double t = a.transpose() * b; + if(a.norm() > 0. && b.norm() > 0.) + t /= (a.norm() * b.norm()); + else + throw std::runtime_error("igl::copyleft::comiso::NRosyField::angleDefect: Division by zero!"); + A(F(i, j)) -= std::acos(std::max(std::min(t, 1.), -1.)); + } + } + + return A; +} + +void igl::copyleft::comiso::NRosyField::findCones(int N) +{ + // Compute I0, see http://www.graphics.rwth-aachen.de/media/papers/bommes_zimmer_2009_siggraph_011.pdf for details + + singularityIndex = Eigen::VectorXd::Zero(V.rows()); + + // first the k + for (unsigned i = 0; i < EV.rows(); ++i) + { + if (!isBorderEdge[i]) + { + singularityIndex(EV(i, 0)) += k(i); + singularityIndex(EV(i, 1)) -= k(i); + } + } + + // then the A + Eigen::VectorXd A = angleDefect(); + singularityIndex += A; + // normalize + singularityIndex /= (2 * igl::PI); + + // round to integer (remove numerical noise) + for (unsigned i = 0; i < singularityIndex.size(); ++i) + singularityIndex(i) = round(singularityIndex(i)); + + for (unsigned i = 0; i < EV.rows(); ++i) + { + if (!isBorderEdge[i]) + { + singularityIndex(EV(i, 0)) += double(p(i)) / double(N); + singularityIndex(EV(i, 1)) -= double(p(i)) / double(N); + } + } + + // Clear the vertices on the edges + for (unsigned i = 0; i < EV.rows(); ++i) + { + if (isBorderEdge[i]) + { + singularityIndex(EV(i,0)) = 0; + singularityIndex(EV(i,1)) = 0; + } + } +} + +Eigen::VectorXd igl::copyleft::comiso::NRosyField::getSingularityIndexPerVertex() +{ + return singularityIndex; +} + +IGL_INLINE void igl::copyleft::comiso::nrosy( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::VectorXi& b, + const Eigen::MatrixXd& bc, + const Eigen::VectorXi& b_soft, + const Eigen::VectorXd& w_soft, + const Eigen::MatrixXd& bc_soft, + const int N, + const double soft, + Eigen::MatrixXd& R, + Eigen::VectorXd& S + ) +{ + // Init solver + igl::copyleft::comiso::NRosyField solver(V, F); + + // Add hard constraints + for (unsigned i = 0; i < b.size(); ++i) + solver.setConstraintHard(b(i), bc.row(i)); + + // Add soft constraints + for (unsigned i = 0; i < b_soft.size(); ++i) + solver.setConstraintSoft(b_soft(i), w_soft(i), bc_soft.row(i)); + + // Set the soft constraints global weight + solver.setSoftAlpha(soft); + + // Interpolate + solver.solve(N); + + // Copy the result back + R = solver.getFieldPerFace(); + + // Extract singularity indices + S = solver.getSingularityIndexPerVertex(); +} + + +IGL_INLINE void igl::copyleft::comiso::nrosy( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::VectorXi& b, + const Eigen::MatrixXd& bc, + const int N, + Eigen::MatrixXd& R, + Eigen::VectorXd& S + ) +{ + // Init solver + igl::copyleft::comiso::NRosyField solver(V, F); + + // Add hard constraints + for (unsigned i= 0; i < b.size(); ++i) + solver.setConstraintHard(b(i), bc.row(i)); + + // Interpolate + solver.solve(N); + + // Copy the result back + R = solver.getFieldPerFace(); + + // Extract singularity indices + S = solver.getSingularityIndexPerVertex(); +} diff --git a/vendor/libigl/include/igl/copyleft/comiso/nrosy.h b/vendor/libigl/include/igl/copyleft/comiso/nrosy.h new file mode 100644 index 0000000000000000000000000000000000000000..0de0ea343e376803aaf4889d036e294db395ef37 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/comiso/nrosy.h @@ -0,0 +1,70 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COMISO_NROSY_H +#define IGL_COMISO_NROSY_H + +#include +#include +#include "../../igl_inline.h" + +namespace igl +{ + namespace copyleft + { + namespace comiso + { + // Generate a N-RoSy field from a sparse set of constraints + // + // Inputs: + // V #V by 3 list of mesh vertex coordinates + // F #F by 3 list of mesh faces (must be triangles) + // b #B by 1 list of constrained face indices + // bc #B by 3 list of representative vectors for the constrained + // faces + // b_soft #S by 1 b for soft constraints + // w_soft #S by 1 weight for the soft constraints (0-1) + // bc_soft #S by 3 bc for soft constraints + // N the degree of the N-RoSy vector field + // soft the strength of the soft constraints w.r.t. smoothness + // (0 -> smoothness only, 1->constraints only) + // Outputs: + // R #F by 3 the representative vectors of the interpolated field + // S #V by 1 the singularity index for each vertex (0 = regular) + IGL_INLINE void nrosy( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::VectorXi& b, + const Eigen::MatrixXd& bc, + const Eigen::VectorXi& b_soft, + const Eigen::VectorXd& w_soft, + const Eigen::MatrixXd& bc_soft, + int N, + double soft, + Eigen::MatrixXd& R, + Eigen::VectorXd& S + ); + //wrapper for the case without soft constraints + IGL_INLINE void nrosy( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::VectorXi& b, + const Eigen::MatrixXd& bc, + int N, + Eigen::MatrixXd& R, + Eigen::VectorXd& S + ); + + } +} +} + +#ifndef IGL_STATIC_LIBRARY +# include "nrosy.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/marching_cubes.cpp b/vendor/libigl/include/igl/copyleft/marching_cubes.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b6364aee562f05639a56d95cbc672493cae66cff --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/marching_cubes.cpp @@ -0,0 +1,551 @@ +/*===========================================================================*\ + * * + * IsoEx * + * Copyright (C) 2002 by Computer Graphics Group, RWTH Aachen * + * www.rwth-graphics.de * + * * + *---------------------------------------------------------------------------* + * * + * License * + * * + * This library is free software; you can redistribute it and/or modify it * + * under the terms of the GNU Library General Public License as published * + * by the Free Software Foundation, version 2. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * + * * + \*===========================================================================*/ + +#include "marching_cubes.h" +#include "marching_cubes_tables.h" + +#include + + +extern const int edgeTable[256]; +extern const int triTable[256][2][17]; +extern const int polyTable[8][16]; + + +template +class MarchingCubes +{ + struct EdgeKey + { + EdgeKey(unsigned i0, unsigned i1) : i0_(i0), i1_(i1) {} + + bool operator==(const EdgeKey& _rhs) const + { + return i0_ == _rhs.i0_ && i1_ == _rhs.i1_; + } + + unsigned i0_, i1_; + }; + + struct EdgeHash + { + std::size_t operator()(const EdgeKey& key) const { + std::size_t seed = 0; + seed ^= key.i0_ + 0x9e3779b9 + (seed<<6) + (seed>>2); // Copied from boost::hash_combine + seed ^= key.i1_ + 0x9e3779b9 + (seed<<6) + (seed>>2); + return std::hash()(seed); + } + }; + + typedef std::unordered_map MyMap; + typedef typename MyMap::const_iterator MyMapIterator; + +public: + // Dense index grid version + MarchingCubes(const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const unsigned x_res, + const unsigned y_res, + const unsigned z_res, + const double isovalue, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces) + { + assert(values.cols() == 1); + assert(points.cols() == 3); + + if(x_res <2 || y_res<2 ||z_res<2) + return; + faces.resize(10000,3); + int num_faces = 0; + + vertices.resize(10000,3); + int num_vertices = 0; + + unsigned n_cubes = (x_res-1) * (y_res-1) * (z_res-1); + assert(unsigned(points.rows()) == x_res * y_res * z_res); + + unsigned int offsets_[8]; + offsets_[0] = 0; + offsets_[1] = 1; + offsets_[2] = 1 + x_res; + offsets_[3] = x_res; + offsets_[4] = x_res*y_res; + offsets_[5] = 1 + x_res*y_res; + offsets_[6] = 1 + x_res + x_res*y_res; + offsets_[7] = x_res + x_res*y_res; + + for (unsigned cube_it =0 ; cube_it < n_cubes; ++cube_it) + { + unsigned corner[8]; + // get point indices of corner vertices + for (int i=0; i<8; ++i) + { + // get cube coordinates + unsigned int _idx = cube_it; + unsigned int X(x_res-1), Y(y_res-1); + unsigned int x = _idx % X; _idx /= X; + unsigned int y = _idx % Y; _idx /= Y; + unsigned int z = _idx; + // transform to point coordinates + _idx = x + y*x_res + z*x_res*y_res; + // add offset + corner[i] = _idx + offsets_[i]; + } + add_cube(values,points,isovalue,corner,vertices,num_vertices,faces,num_faces,edge2vertex); + } + vertices.conservativeResize(num_vertices, Eigen::NoChange); + faces.conservativeResize(num_faces, Eigen::NoChange); + } + + // Sparse index grid version + MarchingCubes(const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const Eigen::MatrixBase &cubes, + const double isovalue, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces) + { + assert(values.cols() == 1); + assert(points.cols() == 3); + assert(cubes.cols() == 8); + + if(cubes.rows() == 0) + { + return; + } + + faces.resize(10000,3); + int num_faces = 0; + + vertices.resize(10000,3); + int num_vertices = 0; + + + unsigned n_cubes = cubes.rows(); + + for (unsigned cube_it =0 ; cube_it < n_cubes; ++cube_it) + { + typedef Eigen::Matrix CubeIndexVector; + + CubeIndexVector corner = cubes.row(cube_it); + add_cube(values,points,isovalue,corner.data(),vertices,num_vertices,faces,num_faces,edge2vertex); + } + vertices.conservativeResize(num_vertices, Eigen::NoChange); + faces.conservativeResize(num_faces, Eigen::NoChange); + } + + // Dense index grid function version + template + MarchingCubes( + const std::function< DerivedValue(const DerivedPoint & ) > & value_fun, + const Eigen::MatrixBase &points, + const unsigned x_res, + const unsigned y_res, + const unsigned z_res, + const double isovalue, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces) + { + assert(points.cols() == 3); + + if(x_res <2 || y_res<2 ||z_res<2) + return; + faces.resize(10000,3); + int num_faces = 0; + + vertices.resize(10000,3); + int num_vertices = 0; + + unsigned n_cubes = (x_res-1) * (y_res-1) * (z_res-1); + assert(unsigned(points.rows()) == x_res * y_res * z_res); + + unsigned int offsets_[8]; + offsets_[0] = 0; + offsets_[1] = 1; + offsets_[2] = 1 + x_res; + offsets_[3] = x_res; + offsets_[4] = x_res*y_res; + offsets_[5] = 1 + x_res*y_res; + offsets_[6] = 1 + x_res + x_res*y_res; + offsets_[7] = x_res + x_res*y_res; + + for (unsigned cube_it =0 ; cube_it < n_cubes; ++cube_it) + { + unsigned corner[8]; + // get point indices of corner vertices + for (int i=0; i<8; ++i) + { + // get cube coordinates + unsigned int _idx = cube_it; + unsigned int X(x_res-1), Y(y_res-1); + unsigned int x = _idx % X; _idx /= X; + unsigned int y = _idx % Y; _idx /= Y; + unsigned int z = _idx; + // transform to point coordinates + _idx = x + y*x_res + z*x_res*y_res; + // add offset + corner[i] = _idx + offsets_[i]; + } + add_cube(value_fun,points,isovalue,corner,vertices,num_vertices,faces,num_faces,edge2vertex); + } + vertices.conservativeResize(num_vertices, Eigen::NoChange); + faces.conservativeResize(num_faces, Eigen::NoChange); + } + + template + static void add_cube( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const double isovalue, + const CubeIndexType corner[], + Eigen::PlainObjectBase &vertices, + int &num_vertices, + Eigen::PlainObjectBase &faces, + int & num_faces, + MyMap &edge2vertex) + { + typedef typename DerivedFaces::Scalar SampleScalar; + SampleScalar samples[12]; + unsigned char cubetype(0); + + // determine cube type + for (int i=0; i<8; ++i) + { + if (values(corner[i]) > isovalue) + { + cubetype |= (1< faces.rows()) + { + faces.conservativeResize(faces.rows()+10000, Eigen::NoChange); + } + faces.row(num_faces-1) << + samples[triTable[cubetype][0][i ]], + samples[triTable[cubetype][0][i+1]], + samples[triTable[cubetype][0][i+2]]; + } + }; + + template + static void add_cube( + const std::function< DerivedValue(const DerivedPoint & ) > & value_fun, + const Eigen::MatrixBase &points, + const double isovalue, + const CubeIndexType corner[], + Eigen::PlainObjectBase &vertices, + int &num_vertices, + Eigen::PlainObjectBase &faces, + int & num_faces, + MyMap &edge2vertex) + { + typedef typename DerivedFaces::Scalar SampleScalar; + SampleScalar samples[12]; + unsigned char cubetype(0); + + // determine cube type + for (int i=0; i<8; ++i) + { + if (value_fun(points.row(corner[i])) > isovalue) + { + cubetype |= (1< faces.rows()) + { + faces.conservativeResize(faces.rows()+10000, Eigen::NoChange); + } + faces.row(num_faces-1) << + samples[triTable[cubetype][0][i ]], + samples[triTable[cubetype][0][i+1]], + samples[triTable[cubetype][0][i+2]]; + } + }; + + static typename DerivedFaces::Scalar add_vertex( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const double isovalue, + unsigned int i0, + unsigned int i1, + Eigen::PlainObjectBase &vertices, + int &num_vertices, + MyMap &edge2vertex) + { + // find vertex if it has been computed already + MyMapIterator it = edge2vertex.find(EdgeKey(i0, i1)); + if (it != edge2vertex.end()) + { + return it->second; + } + + // generate new vertex + const Eigen::Matrix & p0 = points.row(i0); + const Eigen::Matrix & p1 = points.row(i1); + typename DerivedValues::Scalar s0 = fabs(values(i0)-isovalue); + typename DerivedValues::Scalar s1 = fabs(values(i1)-isovalue); + typename DerivedValues::Scalar t = s0 / (s0+s1); + num_vertices++; + if (num_vertices > vertices.rows()) + { + vertices.conservativeResize(vertices.rows()+10000, Eigen::NoChange); + } + // + // Linear interpolation based on linearly interpolating values + vertices.row(num_vertices-1) = ((1.0f-t)*p0 + t*p1).template cast(); + edge2vertex[EdgeKey(i0, i1)] = num_vertices-1; + return num_vertices-1; + } + + template + static typename DerivedFaces::Scalar add_vertex( + const std::function< DerivedValue(const DerivedPoint & ) > & value_fun, + const Eigen::MatrixBase &points, + const double isovalue, + unsigned int i0, + unsigned int i1, + Eigen::PlainObjectBase &vertices, + int &num_vertices, + MyMap &edge2vertex) + { + // find vertex if it has been computed already + MyMapIterator it = edge2vertex.find(EdgeKey(i0, i1)); + if (it != edge2vertex.end()) + { + return it->second; + } + num_vertices++; + if (num_vertices > vertices.rows()) + { + vertices.conservativeResize(vertices.rows()+10000, Eigen::NoChange); + } + + // generate new vertex + typedef Eigen::Matrix RowVector3S; + const RowVector3S & p0 = points.row(i0); + const RowVector3S & p1 = points.row(i1); + // Linear interpolation based on linearly interpolating values + //typename DerivedValues::Scalar s0 = fabs(value_fun(points.row(i0))-isovalue); + //typename DerivedValues::Scalar s1 = fabs(value_fun(points.row(i1))-isovalue); + //typename DerivedValues::Scalar t = s0 / (s0+s1); + const DerivedValue v1 = value_fun(p1); + double t0 = (v1>isovalue)?0:1; + double t1 = (v1>isovalue)?1:0; + double t; + for(int j = 0;j<10;j++) + { + t = 0.5*(t0+t1); + const double val = value_fun( ((1.0f-t)*p0 + t*p1) ); + if( val > isovalue ) + { + t1 = t; + }else + { + t0 = t; + } + } + vertices.row(num_vertices-1) = ((1.0f-t)*p0 + t*p1).template cast(); + + edge2vertex[EdgeKey(i0, i1)] = num_vertices-1; + return num_vertices-1; + } + + // maps an edge to the sample vertex generated on it + MyMap edge2vertex; +}; + + +template +IGL_INLINE void igl::copyleft::marching_cubes( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const unsigned x_res, + const unsigned y_res, + const unsigned z_res, + const double isovalue, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces) +{ + typedef Eigen::MatrixXi Shim; /* DerivedIndices shim type is unused in this instantiation*/ + MarchingCubes + mc(values, points, x_res, y_res, z_res, isovalue, vertices, faces); +} + +template < + typename DerivedValue, + typename DerivedPoint, + typename DerivedPoints, + typename DerivedVertices, + typename DerivedFaces> +IGL_INLINE void igl::copyleft::marching_cubes( + const std::function< DerivedValue(const DerivedPoint & ) > & value_fun, + const Eigen::MatrixBase &points, + const unsigned x_res, + const unsigned y_res, + const unsigned z_res, + const double isovalue, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces) +{ + MarchingCubes< + Eigen::Matrix, /* unnecessary */ + DerivedPoints, DerivedVertices, + Eigen::Matrix, /* unnecessary */ + DerivedFaces> mc(value_fun, points, x_res, y_res, z_res, isovalue, vertices, faces); +} + +template +IGL_INLINE void igl::copyleft::marching_cubes( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const unsigned x_res, + const unsigned y_res, + const unsigned z_res, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces) +{ + typedef Eigen::MatrixXi Shim; /* DerivedIndices shim type is unused in this instantiation*/ + MarchingCubes + mc(values, points, x_res, y_res, z_res, 0.0 /*isovalue*/, vertices, faces); +} + +template +IGL_INLINE void igl::copyleft::marching_cubes( + const Eigen::MatrixBase& values, + const Eigen::MatrixBase& points, + const Eigen::MatrixBase& indices, + const double isovalue, + Eigen::PlainObjectBase& vertices, + Eigen::PlainObjectBase &faces) +{ + MarchingCubes mc(values, points, indices, isovalue, vertices, faces); +} + +template +IGL_INLINE void igl::copyleft::marching_cubes( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const Eigen::MatrixBase & indices, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces) +{ + MarchingCubes mc(values, points, indices, 0.0 /*isovalue*/, vertices, faces); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, const Eigen::MatrixBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(const Eigen::MatrixBase >&,const Eigen::MatrixBase >&,const Eigen::MatrixBase >&,Eigen::PlainObjectBase >&,Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(const Eigen::MatrixBase >&,const Eigen::MatrixBase >&,const Eigen::MatrixBase >&,Eigen::PlainObjectBase >&,Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(const Eigen::MatrixBase >&,const Eigen::MatrixBase >&,const Eigen::MatrixBase >&,Eigen::PlainObjectBase >&,Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::marching_cubes, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned int, unsigned int, unsigned int, double, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/marching_cubes.h b/vendor/libigl/include/igl/copyleft/marching_cubes.h new file mode 100644 index 0000000000000000000000000000000000000000..985eb3ac84c48c0da67fd89cdd9f2fd77e5ffe39 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/marching_cubes.h @@ -0,0 +1,128 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_MARCHINGCUBES_H +#define IGL_COPYLEFT_MARCHINGCUBES_H +#include "../igl_inline.h" + +#include +namespace igl +{ + namespace copyleft + { + // marching_cubes( values, points, x_res, y_res, z_res, isovalue, vertices, faces ) + // + // performs marching cubes reconstruction on a grid defined by values, and + // points, and generates a mesh defined by vertices and faces + // + // Input: + // values #number_of_grid_points x 1 array -- the scalar values of an + // implicit function defined on the grid points (<0 in the inside of the + // surface, 0 on the border, >0 outside) + // points #number_of_grid_points x 3 array -- 3-D positions of the grid + // points, ordered in x,y,z order: + // points[index] = the point at (x,y,z) where : + // x = (index % (xres -1), + // y = (index / (xres-1)) %(yres-1), + // z = index / (xres -1) / (yres -1) ). + // where x,y,z index x, y, z dimensions + // i.e. index = x + y*xres + z*xres*yres + // xres resolutions of the grid in x dimension + // yres resolutions of the grid in y dimension + // zres resolutions of the grid in z dimension + // isovalue the isovalue of the surface to reconstruct + // Output: + // vertices #V by 3 list of mesh vertex positions + // faces #F by 3 list of mesh triangle indices + // + // See also: igl::marching_cubes + template + IGL_INLINE void marching_cubes( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const unsigned x_res, + const unsigned y_res, + const unsigned z_res, + const double isovalue, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces); + template < + typename DerivedValue, + typename DerivedPoint, + typename DerivedPoints, + typename DerivedVertices, + typename DerivedFaces> + IGL_INLINE void marching_cubes( + const std::function< DerivedValue(const DerivedPoint & ) > & value_fun, + const Eigen::MatrixBase &points, + const unsigned x_res, + const unsigned y_res, + const unsigned z_res, + const double isovalue, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces); + + // Overload of the above function where the isovalue defaults to 0.0 + template + IGL_INLINE void marching_cubes( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const unsigned x_res, + const unsigned y_res, + const unsigned z_res, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces); + + + + // marching_cubes( values, points, indices, vertices, faces ) + // + // Perform marching cubes reconstruction on the sparse grid cells defined by (indices, points). + // The indices parameter is an nx8 dense array of index values into the points and values arrays. + // Each row of indices represents a cube for which to generate vertices and faces over. + // + // Input: + // values #number_of_grid_points x 1 array -- the scalar values of an + // implicit function defined on the grid points (<0 in the inside of the + // surface, 0 on the border, >0 outside) + // points #number_of_grid_points x 3 array -- 3-D positions of the grid + // points, ordered in x,y,z order: + // indices #cubes x 8 array -- one row for each cube where each value is + // the index of a vertex in points and a scalar in values. + // i.e. points[indices[i, j]] = the position of the j'th vertex of the i'th cube + // Output: + // vertices #V by 3 list of mesh vertex positions + // faces #F by 3 list of mesh triangle indices + // Note: The winding direction of the cube indices will affect the output winding of the faces + // + template + IGL_INLINE void marching_cubes( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const Eigen::MatrixBase &indices, + const double isovalue, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces); + + // Overload of the above function where the isovalue defaults to 0.0 + template + IGL_INLINE void marching_cubes( + const Eigen::MatrixBase &values, + const Eigen::MatrixBase &points, + const Eigen::MatrixBase &indices, + Eigen::PlainObjectBase &vertices, + Eigen::PlainObjectBase &faces); + + } + +} + +#ifndef IGL_STATIC_LIBRARY +# include "marching_cubes.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/marching_cubes_tables.h b/vendor/libigl/include/igl/copyleft/marching_cubes_tables.h new file mode 100644 index 0000000000000000000000000000000000000000..4bba533c32dcbc5119fcf86d083afe1cb9d2ac0f --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/marching_cubes_tables.h @@ -0,0 +1,917 @@ +/*===========================================================================*\ + * * + * IsoEx * + * Copyright (C) 2002 by Computer Graphics Group, RWTH Aachen * + * www.rwth-graphics.de * + * * + *---------------------------------------------------------------------------* + * * + * License * + * * + * This library is free software; you can redistribute it and/or modify it * + * under the terms of the GNU Library General Public License as published * + * by the Free Software Foundation, version 2. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * + * * + \*===========================================================================*/ + +//============================================================================= +#ifndef IGL_ISOEX_MC_TABLES_HH +#define IGL_ISOEX_MC_TABLES_HH +//============================================================================= + + +//int edgeTable[256]; +//int triTable[256][2][17]; +//int polyTable[8][16]; + +const int edgeTable[256]= +{ + 0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c, + 0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00, + 0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c, + 0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90, + 0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c, + 0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30, + 0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac, + 0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0, + 0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c, + 0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60, + 0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc, + 0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0, + 0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c, + 0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950, + 0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc , + 0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0, + 0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc, + 0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0, + 0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c, + 0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650, + 0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc, + 0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0, + 0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c, + 0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460, + 0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac, + 0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0, + 0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c, + 0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230, + 0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c, + 0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190, + 0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c, + 0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0 +}; + + +//----------------------------------------------------------------------------- + + +const int triTable[256][2][17] = +{{{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 1, 9, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 2, 10, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 10, 9, 8, 3, 2 , -1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 0, 8, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 10 */ + {{1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 1, 9, 0, 2, 3,11, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 9, 8, 11, 2, 1,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 3, 11,10, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 8, 11, 10, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 11,10, 9, 0, 3, -1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 15 */ + {{9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 8, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 4, 7, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 7, 3, 1, 9, 4, -1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 20 */ + {{1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 1, 2,10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 3, 0, 4, 7, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 2,10, 9, 0, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1, -1}, + {1, 6, 7, 3, 2,10, 9, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 25 */ + {{11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 5, 2, 0, 4, 7,11,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {3, 3, 3, 3, 9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1}}, + + {{4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 1, 9, 11, 11,9,4,7, -1, -1, -1, -1, -1 ,-1}}, + + {{3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 3, 11,10, 1, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1, -1}, + {1, 6, 1, 0, 4, 7,11,10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 30 */ + {{4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1, -1}, + {2, 3, 5, 4, 7, 8, 0, 3, 11, 10, 9, -1, -1, -1, -1, -1, -1}}, + + {{4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 4, 7,11,10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 0, 1, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 35 */ + {{8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 3, 1, 5, 4, 8,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 1, 2,10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {3, 3, 3, 3, 3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1}}, + + {{5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 4, 0, 2,10, 5,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 10, 5, 3, 4, 8, 3, 5, -1, -1, -1, -1, -1, -1}}, + + /* 40 */ + {{9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 0, 8, 11, 2, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 0, 1, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1, -1}, + {1, 6, 2, 1, 5, 4, 8,11, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + { 2, 4, 3, 3,11,10, 1, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1}}, + + /* 45 */ + {{4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1, -1}, + {2, 3, 5, 4, 9, 5, 1, 0, 8,11, 10, -1, -1, -1, -1, -1, -1}}, + + {{5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1, -1}, + {1, 6, 5, 4, 0, 3,11, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 5, 4, 8, 11, 10,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 7, 8, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 5, 7, 3, 0, 9,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 50 */ + {{0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 1, 5, 7, 8, 0,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 3, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 7, 8, 9, 5,10, 1, 2, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1, -1}, + { 2, 3, 5,10, 1, 2, 0, 9, 5, 7, 3,-1, -1, -1, -1, -1, -1}}, + + {{8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1, -1}, + {1, 6, 2,10, 5, 7, 8, 0,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 55 */ + {{2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 2,10, 5, 7, 3,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 7, 8, 9, 5, 3,11, 2, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1, -1}, + {1, 6, 2, 0, 9, 5, 7,11, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1, -1}, + {2, 3, 5, 2, 3,11, 8, 0, 1, 5, 7, -1, -1, -1, -1, -1, -1}}, + + {{11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5,11, 2, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 60 */ + {{9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1, -1}, + {2, 4, 4, 3,11, 10, 1, 5, 7, 8, 9, -1, -1, -1, -1, -1, -1}}, + + {{5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1, -1}, + {1, 7, 5, 7, 11,10, 1, 0, 9, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1, -1}, + {1, 7, 11,10,5, 7, 8, 0,3, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 4, 5, 7, 11,10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 3,10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 65 */ + {{0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 1, 9, 8, 3, 5,10, 6, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 1, 2, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 1, 2, 6, 5, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1}}, + + /* 70 */ + {{9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 0, 2, 6, 5, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1, -1}, + {1, 6, 2, 6, 5, 9, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 2, 3,11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + { 2, 4, 3, 0, 8, 11, 2, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {3, 3, 3, 3, 0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1}}, + + /* 75 */ + {{5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1, -1}, + {2, 3, 5, 5,10, 6, 2, 1, 9, 8,11, -1, -1, -1, -1, -1, -1}}, + + {{6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 5, 1, 3, 11,6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1, -1}, + {1, 6, 5, 1, 0, 8,11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, -1}, + {2, 4, 4, 3, 11, 6, 0, 5, 9, 0, 6, -1, -1, -1, -1}}, + + {{6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 6, 5, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 80 */ + {{5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 5,10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 4, 7, 3, 0, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {3, 3, 3, 3, 1, 9, 0, 5,10, 6, 8, 4, 7, -1, -1, -1, -1}}, + + {{10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1, -1}, + { 2, 3, 5,10, 6, 5, 9, 4, 7, 3, 1,-1, -1, -1, -1, -1, -1}}, + + {{6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 1, 2, 6, 5, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1}}, + + /* 85 */ + {{1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 6, 5, 1, 3, 0, 4, 7, -1, -1, -1, -1, -1, -1}}, + + {{8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1, -1}, + {2, 3, 5, 8, 4, 7, 5, 9, 0, 2, 6, -1, -1, -1, -1, -1, -1}}, + + {{7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1, -1}, + {1, 7, 7, 3, 2, 6, 5, 9, 4,-1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {3, 3, 3, 3, 3,11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1}}, + + {{5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1, -1}, + {2, 3, 5, 5,10, 6, 7,11, 2, 0, 4, -1, -1, -1, -1, -1, -1}}, + + /* 90 */ + {{0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1}, + {4, 3, 3, 3, 3, 0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6}}, + + {{9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1, -1}, + {3, 4, 4, 3, 2, 1, 9,11, 4, 7, 11, 9, 5, 10, 6, -1, -1}}, + + {{8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1, -1}, + {2, 3, 5, 8, 4, 7, 11, 6, 5, 1, 3, -1, -1, -1, -1, -1, -1}}, + + {{5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1, -1}, + {1, 7, 5, 1, 0, 4, 7,11, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1, -1}, + {3, 4, 4, 3, 0, 6, 5, 9, 3, 11, 6, 0, 8, 4, 7, -1, -1}}, + + /* 95 */ + {{6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1, -1}, + {2, 4, 4, 9, 4, 7, 11, 6, 5, 9, 11,-1, -1, -1, -1, -1, -1}}, + + {{10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 4, 4, 9, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 4, 9,10, 6, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 5, 6, 4, 0, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1}, + {1, 6, 1,10, 6, 4, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 100 */ + {{1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 2, 6, 4, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1, -1}, + {2, 3, 5, 3, 0, 8, 9, 1, 2, 6, 4, -1, -1, -1, -1, -1, -1}}, + + {{0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 2, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 8, 3, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + { 2, 4, 3, 10, 6, 4, 9,11, 2, 3, -1, -1, -1, -1, -1, -1, -1}}, + + /* 105 */ + {{0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 11, 8, 0, 10, 6, 4, 9, -1, -1, -1, -1, -1, -1}}, + + {{3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1}, + {2, 3, 5, 3,11, 2, 1, 10,6, 4, 0, -1, -1, -1, -1, -1, -1}}, + + {{6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1, -1}, + {1, 7, 6, 4, 8,11, 2, 1,10, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1, -1}, + {1, 6, 3,11, 6, 4, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1, -1}, + {1, 7, 8,11, 6, 4, 9, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 110 */ + {{3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 3,11, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 8, 11, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 8, 9,10, 6, 7,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1, -1}, + {1, 6, 0, 9, 10, 6, 7, 3, -1,-1,-1, -1, -1, -1, -1, -1, -1}}, + + {{10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1, -1}, + { 2, 4, 4, 8, 0, 1, 7, 10, 6, 7, 1,-1, -1, -1, -1, -1, -1}}, + + /* 115 */ + {{10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 5, 10, 6, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1, -1}, + {1, 6, 1, 2, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1, -1}, + {1, 7, 2, 6, 7, 3, 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 7, 8, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 7, 3, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 120 */ + {{2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1, -1}, + {2, 3, 5, 2, 3,11, 6, 7, 8, 9,10, -1, -1, -1, -1, -1, -1}}, + + {{2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1, -1}, + {1, 7, 2, 0, 9,10,6, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1, -1}, + {3, 4, 4, 3, 8, 0, 1, 7, 10, 6, 7, 1, 11, 2, 3, -1, -1}}, + + {{11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1, -1}, + { 2, 4, 4, 11, 2, 1,7, 1, 10, 6, 7,-1, -1, -1, -1, -1, -1}}, + + {{8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1, -1}, + {1, 7, 8, 9, 1, 3, 11, 6, 7,-1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 125 */ + {{0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1, -1}, + {2, 4, 4, 0, 3,11, 6, 7, 8, 0, 6, -1, -1, -1, -1, -1, -1}}, + + {{7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 130 */ + {{0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 1, 9, 8, 3,11, 7, 6, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 2, 3, 3,10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {3, 3, 3, 3, 1, 2,10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1}}, + + {{2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 2, 10, 9, 0, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}}, + + /* 135 */ + {{6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1, -1}, + {2, 3, 5, 6, 11, 7, 3, 2,10, 9, 8, -1, -1, -1, -1, -1, -1}}, + + {{7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 2, 3, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 6, 2, 0, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 2, 3, 7, 6, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1, -1}, + {1, 6, 6, 2, 1, 9, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 140 */ + {{10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 5, 1, 3, 7, 6,10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, -1}, + { 2, 4, 4, 10, 1, 7, 6, 8, 7, 1, 0,-1, -1, -1, -1, -1, -1}}, + + {{0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1, -1}, + {1, 6,10, 9, 0, 3, 7, 6,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 7, 6, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 6, 11, 8, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 145 */ + {{3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 0, 4, 6,11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 6,11, 8, 4, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1, -1}, + {1, 6, 6,11, 3, 1, 9, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 6, 11, 8, 4, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1, -1}, + {2, 3, 5, 1, 2, 10,11, 3,0,4, 6, -1, -1, -1, -1, -1, -1}}, + + /* 150 */ + {{4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1, -1}, + {2, 4, 4, 4, 6, 11, 8, 2,10, 9, 0, -1, -1, -1, -1, -1, -1}}, + + {{10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1, -1}, + {1, 7, 10,9, 4, 6, 11, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 4, 6, 2, 3, 8,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 4, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1, -1}, + {2, 3, 5, 1, 9, 0, 3, 8, 4, 6, 2, -1, -1, -1, -1, -1, -1}}, + + /* 155 */ + {{1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 1, 9, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1, -1}, + {1, 6, 1, 3, 8, 4, 6,10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 5,10, 1,0,4,6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1, -1}, + {1, 7, 4, 6, 10, 9, 0,3, 8, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 4, 4, 6, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 160 */ + {{4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {3, 3, 3, 3, 0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1}}, + + {{5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 0, 1, 5, 4, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}}, + + {{11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1, -1}, + { 2, 3, 5,11, 7, 6, 4, 8, 3, 1, 5,-1, -1, -1, -1, -1, -1}}, + + {{9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {3, 3, 3, 3, 9, 5, 4,10, 1, 2, 7, 6, 11, -1, -1, -1, -1}}, + + /* 165 */ + {{6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1, -1}, + {4, 3, 3, 3, 3, 6,11, 7, 1, 2,10, 0, 8, 3, 4, 9, 5}}, + + {{7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1, -1}, + {2, 3, 5, 7, 6, 11, 10, 5, 4, 0, 2,-1, -1, -1, -1, -1, -1}}, + + {{3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1, -1}, + {3, 4, 4, 3, 5, 3, 2,10, 4, 8, 3, 5, 6, 11, 7, 6, -1}}, + + {{7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 4, 3, 2, 3, 7, 6, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1, -1}, + {2, 3, 5, 9, 5, 4, 8, 7, 6, 2, 0, -1, -1, -1, -1, -1, -1}}, + + /* 170 */ + {{3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1, -1}, + {2, 4, 4, 3, 7, 6, 2, 0, 1, 5, 4, -1, -1, -1, -1, -1, -1}}, + + {{6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1, -1}, + {1, 7, 6, 2, 1, 5, 4, 8, 7,-1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1, -1}, + {2, 3, 5, 9, 5, 4, 6,10, 1, 3, 7,-1, -1, -1, -1, -1, -1}}, + + {{1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1, -1}, + {3, 4, 4, 3, 0, 8, 7, 1, 6, 10, 1, 7, 9, 5, 4, -1, -1}}, + + {{4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1, -1}, + {1, 7, 4, 0, 3, 7, 6, 10, 5, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 175 */ + {{7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1, -1}, + {2, 4, 4, 4, 8, 10, 5, 7, 6,10, 8, -1, -1, -1, -1, -1, -1}}, + + {{6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5,11, 8, 9, 5, 6,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, -1}, + {2, 4, 4, 0, 9, 5, 6, 6,11, 3, 0, -1, -1, -1, -1, -1, -1}}, + + {{0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1, -1}, + {1, 6, 0, 1, 5, 6,11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 6,11, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /*180 */ + {{1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1, -1}, + {2, 3, 5, 1, 2, 10, 5, 6,11, 8, 9, -1, -1, -1, -1, -1, -1}}, + + {{0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1, -1}, + {3, 4, 4, 3, 11, 3,0, 6, 9, 5, 6, 0, 2, 10, 1, 2, 10}}, + + {{11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1, -1}, + { 1, 7,11, 8, 0, 2,10, 5, 6,-1, -1, -1, -1, -1, -1, -1, -1}}, + + {{6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1, -1}, + {2, 4, 4, 6,11, 3, 5, 10, 5, 3, 2, -1, -1, -1, -1, -1, -1}}, + + {{5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1, -1}, + {1, 6, 2, 3, 8, 9, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 185 */ + {{9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 9, 5, 6, 2, 0,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1, -1}, + {1, 7, 1, 5, 6, 2, 3, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 1, 5, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1, -1}, + {1, 7, 1, 3, 8, 9, 5, 6,10, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1, -1}, + { 2, 4, 4, 5, 6, 0, 9, 10, 1, 0, 6, -1, -1, -1, -1, -1, -1}}, + + /* 190 */ + {{0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 3,10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 4, 5,10, 11, 7,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + { 2, 4, 3, 5,10,11, 7, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1}}, + + {{5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + { 2, 4, 3, 5, 10, 11, 7, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1}}, + + /* 195 */ + {{10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1, -1}, + { 2, 4, 4, 10, 11, 7, 5, 1, 9, 8, 3, -1, -1, -1, -1, -1, -1}}, + + {{11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 5, 7, 5, 1, 2,11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1, -1}, + {2, 3, 5, 0, 8, 3, 2,11, 7, 5,1, -1, -1, -1, -1, -1, -1}}, + + {{9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1, -1}, + {1, 6, 2,11, 7, 5, 9, 0,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1, -1}, + {1, 7, 7, 5, 9, 8, 3, 2,11,-1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 200 */ + {{2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 3, 7, 5,10, 2,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1, -1}, + {1, 6, 5,10, 2, 0, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1, -1}, + {2, 3, 5, 9, 0, 1, 10, 2, 3, 7, 5, -1, -1, -1, -1, -1, -1}}, + + {{9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1, -1}, + {1, 7, 9, 8, 7, 5,10, 2, 1,-1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 3, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 205 */ + {{0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 0, 8, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 9, 0, 3, 7, 5,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 7, 5, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 10,11, 8, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1, -1}, + {1, 6, 0, 4, 5,10,11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 210 */ + {{0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1, -1}, + {2, 3, 5, 0, 1, 9, 4, 5, 10, 11, 8, -1, -1, -1, -1, -1, -1}}, + + {{10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1, -1}, + { 1, 7,10, 11, 3, 1, 9,4, 5,-1, -1, -1, -1, -1, -1, -1}}, + + {{2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1, -1}, + {1, 6, 2,11, 8, 4, 5, 1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1, -1}, + {1, 7, 0, 4, 5, 1, 2, 11, 3,-1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1, -1}, + {1, 7, 0, 2,11, 8, 4, 5, 9, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 215 */ + {{9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 3, 5, 10, 4, 5, 3, 8,-1, -1, -1, -1, -1, -1}}, + + {{5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 5,10, 2, 0, 4,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1, -1}, + {3, 4, 4, 3, 3, 5, 10, 2, 8, 4, 5, 3, 0, 1, 9, -1, -1}}, + + {{5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1, -1}, + {1, 6,10, 2, 1, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 220 */ + {{8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 8, 4, 5, 1, 3,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 0, 4, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1, -1}, + {2, 4, 4, 0, 3, 5, 9, 8, 4, 5, 3, -1, -1, -1, -1, -1, -1}}, + + {{9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 9,10, 11, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 225 */ + {{0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1, -1}, + {2, 3, 5, 0, 8, 3, 7, 4, 9, 10, 11, -1, -1, -1, -1, -1, -1}}, + + {{1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1, -1}, + {1, 6, 1, 10,11, 7, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1, -1}, + {1, 7, 3, 1,10,11, 7, 4, 8, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 11, 9, 1, 4, 9, 11, 7, -1, -1, -1, -1, -1, -1}}, + + {{9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1, -1}, + {3, 4, 4, 3, 1, 2, 11, 9, 7, 4, 9,11, 8, 3, 0, 8, 3}}, + + /* 230 */ + {{11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + { 1, 5, 11, 7, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1, -1}, + { 2, 4, 4, 11, 7, 4, 2, 3, 2, 4, 8,-1, -1, -1, -1, -1, -1}}, + + {{2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1, -1}, + {1, 6, 2, 3, 7, 4, 9,10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1, -1}, + {1, 7, 9,10, 2, 0, 8, 7, 4,-1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1, -1}, + {1, 7, 3, 7, 4, 0, 1,10, 2, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 235 */ + {{1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {2, 3, 3, 1,10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 4, 9, 1, 3, 7,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1, -1}, + {2, 4, 4, 8, 7, 1, 0, 4, 9, 1, 7, -1, -1, -1, -1, -1, -1}}, + + {{4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 3, 7, 4, 0,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 240 */ + {{9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 8, 9, 10,11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 3, 0, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 0, 1, 10,11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 3, 1,10, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 1, 2, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 245 */ + {{3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1, -1}, + {2, 4, 4, 2,11, 9, 1, 3, 0, 9, 11, -1, -1, -1, -1, -1,-1}}, + + {{0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 0, 2,11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 5, 2, 3, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 2, 0, 9,10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + /* 250 */ + {{2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 3, 8, 10, 1, 10, 8, 0, -1, -1, -1, -1, -1, -1}}, + + {{1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 4, 1, 3, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {1, 3, 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}} +}; + + +//----------------------------------------------------------------------------- + + +const int polyTable[8][16] = +{ + {-1}, + {-1}, + {-1}, + {0, 1, 2, -1}, + {0, 1, 2, 2, 3, 0, -1}, + {0, 1, 2, 0, 2, 4, 4, 2, 3, -1}, + {0, 1, 2, 2, 3, 4, 4, 5, 0, 0, 2, 4, -1}, + {0, 1, 5, 0, 5, 6, 1, 2, 5, 4, 5, 3, 2, 3, 5, -1} +}; + + +//============================================================================= + + +//============================================================================= +#endif // ISOEX_MC_TABLES_HH defined +//============================================================================= diff --git a/vendor/libigl/include/igl/copyleft/opengl2/render_to_tga.cpp b/vendor/libigl/include/igl/copyleft/opengl2/render_to_tga.cpp new file mode 100644 index 0000000000000000000000000000000000000000..452eade7c9a16dbc16ae0d489c4323e905ecc30a --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/opengl2/render_to_tga.cpp @@ -0,0 +1,88 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "render_to_tga.h" +#include "tga.h" + +#include "../../opengl2/gl.h" + +#include + +IGL_INLINE bool igl::opengl::render_to_tga( + const std::string tga_file, + const int width, + const int height, + const bool alpha) +{ + + size_t components = 3; + GLenum format = GL_BGR; + if(alpha) + { + format = GL_BGRA; + components = 4; + } + GLubyte * cmap = NULL; + + // OpenGL by default tries to read data in multiples of 4, if our data is + // only RGB or BGR and the width is not divible by 4 then we need to alert + // opengl + if((width % 4) != 0 && + (format == GL_RGB || + format == GL_BGR)) + { + glPixelStorei(GL_PACK_ALIGNMENT, 1); + } + GLubyte *pixels; + pixels = (unsigned char *) malloc (width * height * components); + glReadPixels( + 0, + 0, + width, + height, + format, + GL_UNSIGNED_BYTE, + pixels); + + // set up generic image struct + gliGenericImage * genericImage; + genericImage = (gliGenericImage*) malloc(sizeof(gliGenericImage)); + genericImage->width = width; + genericImage->height = height; + genericImage->format = format; + genericImage->components = components; + genericImage->pixels = pixels; + // CMAP is not supported, but we need to put something here + genericImage->cmapEntries = 0; + genericImage->cmapFormat = GL_BGR; + genericImage->cmap = cmap; + + // write pixels to tga file + FILE * imgFile; + // "-" as output file name is code for write to stdout + if(tga_file.compare("-") == 0) + { + imgFile = stdout; + }else{ + imgFile = fopen(tga_file.c_str(),"w"); + if(NULL==imgFile) + { + printf("IOError: %s could not be opened...\n",tga_file.c_str()); + free(genericImage); + return false; + } + } + + writeTGA(genericImage,imgFile); + + free(genericImage); + return fclose(imgFile) == 0; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/copyleft/opengl2/render_to_tga.h b/vendor/libigl/include/igl/copyleft/opengl2/render_to_tga.h new file mode 100644 index 0000000000000000000000000000000000000000..d792c1e3131b5b92797981977c303389bcb687d4 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/opengl2/render_to_tga.h @@ -0,0 +1,38 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_RENDER_TO_TGA_H +#define IGL_OPENGL_RENDER_TO_TGA_H +#include "../../igl_inline.h" +#include + +namespace igl +{ + namespace opengl + { + // Render current open GL image to .tga file + // Inputs: + // tga_file path to output .tga file + // width width of scene and resulting image + // height height of scene and resulting image + /// alpha whether to include alpha channel + // Returns true only if no errors occurred + // + // See also: png/render_to_png which is slower but writes .png files + IGL_INLINE bool render_to_tga( + const std::string tga_file, + const int width, + const int height, + const bool alpha); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "render_to_tga.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/opengl2/texture_from_tga.cpp b/vendor/libigl/include/igl/copyleft/opengl2/texture_from_tga.cpp new file mode 100644 index 0000000000000000000000000000000000000000..717a6734cb2531faabccdf91ea19de4aafc6071e --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/opengl2/texture_from_tga.cpp @@ -0,0 +1,68 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "texture_from_tga.h" +#include "tga.h" +#include + +IGL_INLINE bool igl::opengl::texture_from_tga(const std::string tga_file, GLuint & id) +{ + using namespace std; + + // read pixels to tga file + FILE * imgFile; + // "-" as input file name is code for read from stdin + imgFile = fopen(tga_file.c_str(),"r"); + if(NULL==imgFile) + { + printf("IOError: %s could not be opened...",tga_file.c_str()); + return false; + } + + // gliReadTGA annoyingly uses char * instead of const char * + size_t len = tga_file.length(); + char* tga_file_char = new char [ len + 1 ]; + strcpy( tga_file_char, tga_file.c_str() ); + // read image + gliGenericImage* img = gliReadTGA(imgFile, tga_file_char, 0, 0); + // clean up filename buffer + delete[] tga_file_char; + fclose( imgFile ); + + // set up texture mapping parameters and generate texture id + glGenTextures(1,&id); + glBindTexture(GL_TEXTURE_2D, id); + // Texture parameters + float empty[] = {1.0f,1.0f,1.0f,0.0f}; + glTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR,empty); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, + // GL_LINEAR_MIPMAP_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, + GL_LINEAR); + + // OpenGL by default tries to read data in multiples of 4, if our data is + // only RGB or BGR and the width is not divible by 4 then we need to alert + // opengl + if((img->width % 4) != 0 && + (img->format == GL_RGB || + img->format == GL_BGR)) + { + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + } + + // Load texture + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img->width, + img->height, 0, img->format, GL_UNSIGNED_BYTE, + img->pixels); + return id; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/copyleft/opengl2/texture_from_tga.h b/vendor/libigl/include/igl/copyleft/opengl2/texture_from_tga.h new file mode 100644 index 0000000000000000000000000000000000000000..8a5f704c7e36e007347d3b2da6bda51d40bed4c2 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/opengl2/texture_from_tga.h @@ -0,0 +1,33 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_TEXTURE_FROM_TGA_H +#define IGL_OPENGL_TEXTURE_FROM_TGA_H +#include "../../igl_inline.h" +#include "../../opengl2/gl.h" +#include + +namespace igl +{ + namespace opengl + { + // Read an image from a .tga file and use it as a texture + // + // Input: + // tga_file path to .tga file + // Output: + // id of generated openGL texture + // Returns true on success, false on failure + IGL_INLINE bool texture_from_tga(const std::string tga_file, GLuint & id); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "texture_from_tga.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/opengl2/tga.cpp b/vendor/libigl/include/igl/copyleft/opengl2/tga.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9fedbf228d964c2c6ed5118310208b7b409c6941 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/opengl2/tga.cpp @@ -0,0 +1,550 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// WARNING +// +// THIS DOES NOT DEAL WITH VERTICALLY FLIPPED DATA CORRECTLY +// +//////////////////////////////////////////////////////////////////////////////// + +/* This file is derived from (actually an earlier version of)... */ + +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * $Id: tga.cpp,v 1.1.2.5 2007-05-10 02:10:07 elif Exp $ + * TrueVision Targa loading and saving file filter for the Gimp. + * Targa code Copyright (C) 1997 Raphael FRANCOIS and Gordon Matzigkeit + * + * The Targa reading and writing code was written from scratch by + * Raphael FRANCOIS and Gordon Matzigkeit + * based on the TrueVision TGA File Format + * Specification, Version 2.0: + * + * + * + * It does not contain any code written for other TGA file loaders. + * Not even the RLE handling. ;) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "tga.h" +#include "../../opengl2/glext.h" +#include +#include +#include +#include + +static char error[256]; +static unsigned int _verbose = 0; +static int totbytes = 0; + +typedef struct { + unsigned char *statebuf; + int statelen; + int laststate; +} RLEstate; + +IGL_INLINE static int +std_fread(RLEstate * /*rleInfo*/, unsigned char *buf, size_t datasize, size_t nelems, FILE *fp) +{ + if (_verbose > 1) { + totbytes += nelems * datasize; + printf("TGA: std_fread %d (total %d)\n", + (int)(nelems * datasize), totbytes); + } + return fread(buf, datasize, nelems, fp); +} + +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) + +#define RLE_PACKETSIZE 0x80 + +/* Decode a bufferful of file. */ +IGL_INLINE static int +rle_fread(RLEstate *rleInfo, unsigned char *vbuf, size_t datasize, size_t nelems, FILE *fp) +{ + + unsigned char *buf = vbuf; + int j, k; + int buflen, count, bytes, curbytes; + unsigned char *p; + + /* Scale the buffer length. */ + buflen = nelems * datasize; + + j = 0; + curbytes = totbytes; + while (j < buflen) { + if (rleInfo->laststate < rleInfo->statelen) { + /* Copy bytes from our previously decoded buffer. */ + bytes = MIN(buflen - j, rleInfo->statelen - rleInfo->laststate); + memcpy(buf + j, rleInfo->statebuf + rleInfo->laststate, bytes); + j += bytes; + rleInfo->laststate += bytes; + + /* If we used up all of our state bytes, then reset them. */ + if (rleInfo->laststate >= rleInfo->statelen) { + rleInfo->laststate = 0; + rleInfo->statelen = 0; + } + + /* If we filled the buffer, then exit the loop. */ + if (j >= buflen) break; + } + + /* Decode the next packet. */ + count = fgetc(fp); + if (count == EOF) { + if (_verbose) printf("TGA: hit EOF while looking for count\n"); + return j / datasize; + } + + /* Scale the byte length to the size of the data. */ + bytes = ((count & ~RLE_PACKETSIZE) + 1) * datasize; + + if (j + bytes <= buflen) { + /* We can copy directly into the image buffer. */ + p = buf + j; + } else { +#ifdef PROFILE + printf("TGA: needed to use statebuf for %d bytes\n", buflen - j); +#endif + /* Allocate the state buffer if we haven't already. */ + if (!rleInfo->statebuf) { + rleInfo->statebuf = (unsigned char *) malloc(RLE_PACKETSIZE * datasize); + } + p = rleInfo->statebuf; + } + + if (count & RLE_PACKETSIZE) { + /* Fill the buffer with the next value. */ + if (fread(p, datasize, 1, fp) != 1) { + if (_verbose) { + printf("TGA: EOF while reading %d/%d element RLE packet\n", + bytes, (int)datasize); + } + return j / datasize; + } + + /* Optimized case for single-byte encoded data. */ + if (datasize == 1) { + memset(p + 1, *p, bytes - 1); + } else { + for (k = datasize; k < bytes; k += datasize) { + memcpy(p + k, p, datasize); + } + } + } else { + /* Read in the buffer. */ + if (fread(p, bytes, 1, fp) != 1) { + if (_verbose) { + printf("TGA: EOF while reading %d/%d element raw packet\n", + bytes, (int)datasize); + } + return j / datasize; + } + } + + if (_verbose > 1) { + totbytes += bytes; + if (_verbose > 2) { + printf("TGA: %s packet %d/%d\n", + (count & RLE_PACKETSIZE) ? "RLE" : "raw", + bytes, totbytes); + } + } + + /* We may need to copy bytes from the state buffer. */ + if (p == rleInfo->statebuf) { + rleInfo->statelen = bytes; + } else { + j += bytes; + } + } + + if (_verbose > 1) { + printf("TGA: rle_fread %d/%d (total %d)\n", + (int) ( nelems * datasize), totbytes - curbytes, totbytes); + } + return nelems; +} + +IGL_INLINE igl::opengl::gliGenericImage * +igl::opengl::gliReadTGA(FILE *fp, char *name, int /*hflip*/, int vflip) +{ + igl::opengl::TgaHeader tgaHeader; + igl::opengl::TgaFooter tgaFooter; + char horzrev, vertrev; + int width, height, bpp; + int start, end, dir; + int i, j, k; + int pelbytes, wbytes; + GLenum format; + int components; + RLEstate rleRec; + RLEstate *rleInfo; + int rle; + int index, colors, length; + GLubyte *cmap, *pixels, *data; + int (*myfread)(RLEstate *rleInfo, unsigned char*, size_t, size_t, FILE*); + igl::opengl::gliGenericImage *genericImage; + + /* Check the footer. */ + if (fseek(fp, 0L - sizeof(tgaFooter), SEEK_END) + || fread(&tgaFooter, sizeof(tgaFooter), 1, fp) != 1) { + sprintf(error, "TGA: Cannot read footer from \"%s\"", name); + if (_verbose) printf("%s\n", error); + return NULL; + } + + /* Check the signature. */ + if (memcmp(tgaFooter.signature, TGA_SIGNATURE, + sizeof(tgaFooter.signature)) == 0) { + if (_verbose) printf("TGA: found New TGA\n"); + } else { + if (_verbose) printf("TGA: found Original TGA\n"); + } + + if (fseek(fp, 0, SEEK_SET) || + fread(&tgaHeader, sizeof(tgaHeader), 1, fp) != 1) { + sprintf(error, "TGA: Cannot read header from \"%s\"", name); + if (_verbose) printf("%s\n", error); + return NULL; + } + + if (_verbose && tgaHeader.idLength) { + char *idString = (char*) malloc(tgaHeader.idLength); + + if (fread(idString, tgaHeader.idLength, 1, fp) != 1) { + sprintf(error, "TGA: Cannot read ID field in \"%s\"", name); + printf("%s\n", error); + } else { + printf("TGA: ID field: \"%*s\"\n", tgaHeader.idLength, idString); + } + free(idString); + } else { + /* Skip the image ID field. */ + if (tgaHeader.idLength && fseek(fp, tgaHeader.idLength, SEEK_CUR)) { + sprintf(error, "TGA: Cannot skip ID field in \"%s\"", name); + if (_verbose) printf("%s\n", error); + return NULL; + } + } + + /* Reassemble the multi-byte values correctly, regardless of + host endianness. */ + width = (tgaHeader.widthHi << 8) | tgaHeader.widthLo; + height = (tgaHeader.heightHi << 8) | tgaHeader.heightLo; + bpp = tgaHeader.bpp; + if (_verbose) { + printf("TGA: width=%d, height=%d, bpp=%d\n", width, height, bpp); + } + + horzrev = tgaHeader.descriptor & TGA_DESC_HORIZONTAL; + vertrev = tgaHeader.descriptor & TGA_DESC_VERTICAL; + //vertrev=0; + +// // JASON - we can force this stuff if we want +// if( hflip ) +// horzrev = 1; + if( vflip ) + vertrev = 1; + + if (_verbose && horzrev) printf("TGA: horizontal reversed\n"); + if (_verbose && vertrev) printf("TGA: vertical reversed\n"); + + rle = 0; + switch (tgaHeader.imageType) { + case TGA_TYPE_MAPPED_RLE: + rle = 1; + if (_verbose) printf("TGA: run-length encoded\n"); + case TGA_TYPE_MAPPED: + /* Test for alpha channel. */ + format = GL_COLOR_INDEX; + components = 1; + if (_verbose) { + printf("TGA: %d bit indexed image (%d bit palette)\n", + tgaHeader.colorMapSize, bpp); + } + break; + + case TGA_TYPE_GRAY_RLE: + rle = 1; + if (_verbose) printf("TGA: run-length encoded\n"); + case TGA_TYPE_GRAY: + format = GL_LUMINANCE; + components = 1; + if (_verbose) printf("TGA: %d bit grayscale image\n", bpp); + break; + + case TGA_TYPE_COLOR_RLE: + rle = 1; + if (_verbose) printf("TGA: run-length encoded\n"); + case TGA_TYPE_COLOR: + /* Test for alpha channel. */ + if (bpp == 32) { + format = GL_BGRA_EXT; + components = 4; + if (_verbose) { + printf("TGA: %d bit color image with alpha channel\n", bpp); + } + } else { + format = GL_BGR_EXT; + components = 3; + if (_verbose) printf("TGA: %d bit color image\n", bpp); + } + break; + + default: + sprintf(error, + "TGA: unrecognized image type %d\n", tgaHeader.imageType); + if (_verbose) printf("%s\n", error); + return NULL; + } + + if ((format == GL_BGRA_EXT && bpp != 32) || + (format == GL_BGR_EXT && bpp != 24) || + ((format == GL_LUMINANCE || format == GL_COLOR_INDEX) && bpp != 8)) { + /* FIXME: We haven't implemented bit-packed fields yet. */ + fprintf(stderr, "bpp %d, format %x\n", bpp, (unsigned int)format); + sprintf(error, "TGA: channel sizes other than 8 bits are unimplemented"); + if (_verbose) printf("%s\n", error); + return NULL; + } + + /* Check that we have a color map only when we need it. */ + if (format == GL_COLOR_INDEX) { + if (tgaHeader.colorMapType != 1) { + sprintf(error, "TGA: indexed image has invalid color map type %d\n", + tgaHeader.colorMapType); + if (_verbose) printf("%s\n", error); + return NULL; + } + } else if (tgaHeader.colorMapType != 0) { + sprintf(error, "TGA: non-indexed image has invalid color map type %d\n", + tgaHeader.colorMapType); + if (_verbose) printf("%s\n", error); + return NULL; + } + + if (tgaHeader.colorMapType == 1) { + /* We need to read in the colormap. */ + index = (tgaHeader.colorMapIndexHi << 8) | tgaHeader.colorMapIndexLo; + length = (tgaHeader.colorMapLengthHi << 8) | tgaHeader.colorMapLengthLo; + + if (_verbose) { + printf("TGA: reading color map (%d + %d) * (%d / 8)\n", + index, length, tgaHeader.colorMapSize); + } + if (length == 0) { + sprintf(error, "TGA: invalid color map length %d", length); + if (_verbose) printf("%s\n", error); + return NULL; + } + if (tgaHeader.colorMapSize != 24) { + /* We haven't implemented bit-packed fields yet. */ + sprintf(error, "TGA: channel sizes other than 8 bits are unimplemented"); + if (_verbose) printf("%s\n", error); + return NULL; + } + + pelbytes = tgaHeader.colorMapSize / 8; + colors = length + index; + cmap = (GLubyte*)malloc (colors * pelbytes); + + /* Zero the entries up to the beginning of the map. */ + memset(cmap, 0, index * pelbytes); + + /* Read in the rest of the colormap. */ + if (fread(cmap, pelbytes, length, fp) != (size_t) length) { + sprintf(error, "TGA: error reading colormap (ftell == %ld)\n", + ftell (fp)); + if (_verbose) printf("%s\n", error); + free(cmap); + return NULL; + } + + if (pelbytes >= 3) { + /* Rearrange the colors from BGR to RGB. */ + int tmp; + for (j = index; j < length * pelbytes; j += pelbytes) { + tmp = cmap[j]; + cmap[j] = cmap[j + 2]; + cmap[j + 2] = tmp; + } + } + } else { + colors = 0; + cmap = NULL; + } + + /* Allocate the data. */ + pelbytes = bpp / 8; + pixels = (unsigned char *) malloc (width * height * pelbytes); + + if (rle) { + rleRec.statebuf = 0; + rleRec.statelen = 0; + rleRec.laststate = 0; + rleInfo = &rleRec; + myfread = rle_fread; + } else { + rleInfo = NULL; + myfread = std_fread; + } + + wbytes = width * pelbytes; + + if (vertrev) { + start = 0; + end = height; + dir = 1; + } else { + /* We need to reverse loading order of rows. */ + start = height-1; + end = -1; + dir = -1; + } + + for (i = start; i != end; i += dir) { + data = pixels + i*wbytes; + + /* Suck in the data one row at a time. */ + if (myfread(rleInfo, data, pelbytes, width, fp) != width) { + /* Probably premature end of file. */ + if (_verbose) { + printf ("TGA: error reading (ftell == %ld, width=%d)\n", + ftell(fp), width); + } + return NULL; + } + + if (horzrev) { + /* We need to mirror row horizontally. */ + for (j = 0; j < width/2; j++) { + GLubyte tmp; + + for (k = 0; k < pelbytes; k++) { + tmp = data[j*pelbytes+k]; + data[j*pelbytes+k] = data[(width-j-1)*pelbytes+k]; + data[(width-j-1)*pelbytes+k] = tmp; + } + } + } + } + + if (rle) { + free(rleInfo->statebuf); + } + + if (fgetc (fp) != EOF) { + if (_verbose) printf ("TGA: too much input data, ignoring extra...\n"); + } + + genericImage = (igl::opengl::gliGenericImage*) malloc(sizeof(igl::opengl::gliGenericImage)); + genericImage->width = width; + genericImage->height = height; + genericImage->format = format; + genericImage->components = components; + genericImage->cmapEntries = colors; + genericImage->cmapFormat = GL_BGR_EXT; // XXX fix me + genericImage->cmap = cmap; + genericImage->pixels = pixels; + + return genericImage; +} + +IGL_INLINE int igl::opengl::gli_verbose(int new_verbose) +{ + _verbose = new_verbose; + return _verbose; +} + + + +// added 10/2005, Denis Zorin +// a very simple TGA output, supporting +// uncompressed luminance RGB and RGBA +// G22.2270 students: this is C (no C++) +// so this is not the style I would encourage +// you to use; I used it for consistency +// with the rest of the code in this file + + +// fixed header values for the subset of TGA we use for writing +unsigned char TGAHeaderColor[12] = + { 0,// 0 ID length = no id + 0,// 1 color map type = no color map + 2,// 2 image type = uncompressed true color + 0, 0, 0, 0, 0,// color map spec = empty + 0, 0, // x origin of image + 0, 0 // y origin of image + }; + +unsigned char TGAHeaderBW[12] = + { 0,// 0 ID length = no id + 0,// 1 color map type = no color map + 3,// 3 image type = uncompressed black and white + 0, 0, 0, 0, 0,// color map spec = empty + 0, 0, // x origin of image + 0, 0 // y origin of image + }; + +// this makes sure that +// image size is written in correct format +// and byte order (least first) +IGL_INLINE void write16bit(int n, FILE* fp) { + unsigned char bytes[] = { static_cast(n % 256), static_cast(n / 256) }; + fwrite(bytes, 2, sizeof(unsigned char),fp); +} + + + +IGL_INLINE void igl::opengl::writeTGA( igl::opengl::gliGenericImage* image, FILE *fp) { + + assert(!image->cmap); // we do not deal with color map images + + if(image->components == 3 || image->components == 4) + fwrite(TGAHeaderColor, 12, sizeof(unsigned char),fp); + else { + if(image->components == 1 ) + fwrite(TGAHeaderBW, 12, sizeof(unsigned char),fp); + else { fprintf(stderr,"Supported component number: 1,3 or 4\n"); exit(1); } + } + + write16bit(image->width,fp); + write16bit(image->height,fp); + switch (image->components ) { + case 1: + putc(8,fp); + break; + case 3: + putc(24,fp); + break; + case 4: + putc(32,fp); + break; + default: fprintf(stderr,"Supported component number: 1,3 or 4\n"); exit(1); + }; + + if(image-> components == 4) + putc(0x04,fp); // bottom left image (0x00) + 8 bit alpha (0x4) + else + putc(0x00,fp); + + fwrite(image->pixels, image->height*image->width*image->components, sizeof(char),fp); +} + diff --git a/vendor/libigl/include/igl/copyleft/opengl2/tga.h b/vendor/libigl/include/igl/copyleft/opengl2/tga.h new file mode 100644 index 0000000000000000000000000000000000000000..b69f35496a0022fd27afab054f726015fbf6902c --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/opengl2/tga.h @@ -0,0 +1,106 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_TGA_H +#define IGL_OPENGL_TGA_H +#include "../../igl_inline.h" + +#include "../../opengl2/gl.h" +// See license in tga.cpp +/* tga.h - interface for TrueVision (TGA) image file loader */ +#include +#ifdef _WIN32 +#include +#endif + +namespace igl +{ +namespace opengl +{ + +typedef struct { + + GLsizei width; + GLsizei height; + GLint components; + GLenum format; + + GLsizei cmapEntries; + GLenum cmapFormat; + GLubyte *cmap; + + GLubyte *pixels; + +} gliGenericImage; + +typedef struct { + unsigned char idLength; + unsigned char colorMapType; + + /* The image type. */ +#define TGA_TYPE_MAPPED 1 +#define TGA_TYPE_COLOR 2 +#define TGA_TYPE_GRAY 3 +#define TGA_TYPE_MAPPED_RLE 9 +#define TGA_TYPE_COLOR_RLE 10 +#define TGA_TYPE_GRAY_RLE 11 + unsigned char imageType; + + /* Color Map Specification. */ + /* We need to separately specify high and low bytes to avoid endianness + and alignment problems. */ + unsigned char colorMapIndexLo, colorMapIndexHi; + unsigned char colorMapLengthLo, colorMapLengthHi; + unsigned char colorMapSize; + + /* Image Specification. */ + unsigned char xOriginLo, xOriginHi; + unsigned char yOriginLo, yOriginHi; + + unsigned char widthLo, widthHi; + unsigned char heightLo, heightHi; + + unsigned char bpp; + + /* Image descriptor. + 3-0: attribute bpp + 4: left-to-right ordering + 5: top-to-bottom ordering + 7-6: zero + */ +#define TGA_DESC_ABITS 0x0f +#define TGA_DESC_HORIZONTAL 0x10 +#define TGA_DESC_VERTICAL 0x20 + unsigned char descriptor; + +} TgaHeader; + +typedef struct { + unsigned int extensionAreaOffset; + unsigned int developerDirectoryOffset; +#define TGA_SIGNATURE "TRUEVISION-XFILE" + char signature[16]; + char dot; + char null; +} TgaFooter; + +IGL_INLINE extern gliGenericImage *gliReadTGA(FILE *fp, char *name, int hflip, int vflip); +IGL_INLINE int gli_verbose(int new_verbose); +IGL_INLINE extern int gliVerbose(int newVerbose); + +IGL_INLINE void writeTGA( gliGenericImage* image, FILE *fp); + + + +} // end of igl namespace +} + +#ifndef IGL_STATIC_LIBRARY +# include "tga.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/progressive_hulls.cpp b/vendor/libigl/include/igl/copyleft/progressive_hulls.cpp new file mode 100644 index 0000000000000000000000000000000000000000..44738c8b2c2c5e1710821dfc9e6bef602d220953 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/progressive_hulls.cpp @@ -0,0 +1,31 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "progressive_hulls.h" +#include "progressive_hulls_cost_and_placement.h" +#include "../decimate.h" +#include "../max_faces_stopping_condition.h" +IGL_INLINE bool igl::copyleft::progressive_hulls( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const size_t max_m, + Eigen::MatrixXd & U, + Eigen::MatrixXi & G, + Eigen::VectorXi & J) +{ + int m = F.rows(); + Eigen::VectorXi I; + return decimate( + V, + F, + progressive_hulls_cost_and_placement, + max_faces_stopping_condition(m,(const int)m,max_m), + U, + G, + J, + I); +} diff --git a/vendor/libigl/include/igl/copyleft/progressive_hulls.h b/vendor/libigl/include/igl/copyleft/progressive_hulls.h new file mode 100644 index 0000000000000000000000000000000000000000..54e0580a07301a52218fb5c0c0023ca04dcdc34b --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/progressive_hulls.h @@ -0,0 +1,43 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_PROGRESSIVE_HULLS_H +#define IGL_COPYLEFT_PROGRESSIVE_HULLS_H +#include "../igl_inline.h" +#include + +namespace igl +{ + namespace copyleft + { + // Assumes (V,F) is a closed manifold mesh + // Collapses edges until desired number of faces is achieved but ensures + // that new vertices are placed outside all previous meshes as per + // "progressive hulls" in "Silhouette clipping" [Sander et al. 2000]. + // + // Inputs: + // V #V by dim list of vertex positions + // F #F by 3 list of face indices into V. + // max_m desired number of output faces + // Outputs: + // U #U by dim list of output vertex posistions (can be same ref as V) + // G #G by 3 list of output face indices into U (can be same ref as G) + // J #G list of indices into F of birth faces + // Returns true if m was reached (otherwise #G > m) + IGL_INLINE bool progressive_hulls( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const size_t max_m, + Eigen::MatrixXd & U, + Eigen::MatrixXi & G, + Eigen::VectorXi & J); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "progressive_hulls.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/progressive_hulls_cost_and_placement.cpp b/vendor/libigl/include/igl/copyleft/progressive_hulls_cost_and_placement.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6bd916906b11b722ade66e899d9375a443b82633 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/progressive_hulls_cost_and_placement.cpp @@ -0,0 +1,107 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "progressive_hulls_cost_and_placement.h" +#include "quadprog.h" +#include "../unique.h" +#include "../circulation.h" +#include +#include +#include + +IGL_INLINE void igl::copyleft::progressive_hulls_cost_and_placement( + const int e, + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXi & E, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI, + double & cost, + Eigen::RowVectorXd & p) +{ + using namespace Eigen; + using namespace std; + // Controls the amount of quadratic energy to add (too small will introduce + // instabilities and flaps) + const double w = 0.1; + + assert(V.cols() == 3 && "V.cols() should be 3"); + // Gather list of unique face neighbors + vector Nall = circulation(e, true,EMAP,EF,EI); + vector Nother= circulation(e,false,EMAP,EF,EI); + Nall.insert(Nall.end(),Nother.begin(),Nother.end()); + vector N; + igl::unique(Nall,N); + // Gather: + // A #N by 3 normals scaled by area, + // D #N determinants of matrix formed by points as columns + // B #N point on plane dot normal + MatrixXd A(N.size(),3); + VectorXd D(N.size()); + VectorXd B(N.size()); + //cout<<"N=["; + for(int i = 0;i= B + // A x - B >=0 + // This is annoyingly necessary. Seems the solver is letting some garbage + // slip by. + success = success && ((A*x-B).minCoeff()>-1e-10); + if(success) + { + p = x.transpose(); + //assert(cost>=0 && "Cost should be positive"); + }else + { + cost = std::numeric_limits::infinity(); + //VectorXi NM; + //igl::list_to_matrix(N,NM); + //cout< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_PROGRESSIVE_HULLS_COST_AND_PLACEMENT_H +#define IGL_COPYLEFT_PROGRESSIVE_HULLS_COST_AND_PLACEMENT_H +#include +#include "../igl_inline.h" +namespace igl +{ + namespace copyleft + { + // A "cost and placement" compatible with `igl::decimate` implementing the + // "progressive hulls" algorithm in "Silhouette clipping" [Sander et al. + // 2000]. This implementation fixes an issue that the original linear + // program becomes unstable for flat patches by introducing a small + // quadratic energy term pulling the collapsed edge toward its midpoint. + // This function is not really meant to be called directly but rather + // passed to `igl::decimate` as a handle. + // + // Inputs: + // e index of edge to be collapsed + // V #V by 3 list of vertex positions + // F #F by 3 list of faces indices into V + // E #E by 3 list of edges indices into V + // EMAP #F*3 list of indices into E, mapping each directed edge to unique + // unique edge in E + // EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of + // F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " + // e=(j->i) + // EI #E by 2 list of edge flap corners (see above). + // Outputs: + // cost cost of collapsing edge e + // p position to place collapsed vertex + // + IGL_INLINE void progressive_hulls_cost_and_placement( + const int e, + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXi & E, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI, + double & cost, + Eigen::RowVectorXd & p); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "progressive_hulls_cost_and_placement.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/copyleft/quadprog.cpp b/vendor/libigl/include/igl/copyleft/quadprog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7ee417e818ed85f46f1b003d0866c96140a661bc --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/quadprog.cpp @@ -0,0 +1,618 @@ +#include "quadprog.h" +#include "../matlab_format.h" +#include +#include +#include +/* + FILE eiquadprog.hh + + NOTE: this is a modified of uQuadProg++ package, working with Eigen data structures. + uQuadProg++ is itself a port made by Angelo Furfaro of QuadProg++ originally developed by + Luca Di Gaspero, working with ublas data structures. + + The quadprog_solve() function implements the algorithm of Goldfarb and Idnani + for the solution of a (convex) Quadratic Programming problem +by means of a dual method. + +The problem is in the form: + +min 0.5 * x G x + g0 x +s.t. + CE^T x + ce0 = 0 + CI^T x + ci0 >= 0 + + The matrix and vectors dimensions are as follows: + G: n * n + g0: n + + CE: n * p + ce0: p + + CI: n * m + ci0: m + + x: n + + The function will return the cost of the solution written in the x vector or + std::numeric_limits::infinity() if the problem is infeasible. In the latter case + the value of the x vector is not correct. + + References: D. Goldfarb, A. Idnani. A numerically stable dual method for solving + strictly convex quadratic programs. Mathematical Programming 27 (1983) pp. 1-33. + + Notes: + 1. pay attention in setting up the vectors ce0 and ci0. + If the constraints of your problem are specified in the form + A^T x = b and C^T x >= d, then you should set ce0 = -b and ci0 = -d. + 2. The matrix G is modified within the function since it is used to compute + the G = L^T L cholesky factorization for further computations inside the function. + If you need the original matrix G you should make a copy of it and pass the copy + to the function. + + + The author will be grateful if the researchers using this software will + acknowledge the contribution of this modified function and of Di Gaspero's + original version in their research papers. + + +LICENSE + +Copyright (2010) Gael Guennebaud +Copyright (2008) Angelo Furfaro +Copyright (2006) Luca Di Gaspero + + +This file is a porting of QuadProg++ routine, originally developed +by Luca Di Gaspero, exploiting uBlas data structures for vectors and +matrices instead of native C++ array. + +uquadprog is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +uquadprog is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with uquadprog; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include + +IGL_INLINE bool igl::copyleft::quadprog( + const Eigen::MatrixXd & G, + const Eigen::VectorXd & g0, + const Eigen::MatrixXd & CE, + const Eigen::VectorXd & ce0, + const Eigen::MatrixXd & CI, + const Eigen::VectorXd & ci0, + Eigen::VectorXd& x) +{ + using namespace Eigen; + typedef double Scalar; + + + const auto print_ivector= [](const char* name, const Eigen::MatrixXi & A, int n) + { + std::cout<Scalar + { + Scalar a1, b1, t; + a1 = std::abs(a); + b1 = std::abs(b); + if (a1 > b1) + { + t = (b1 / a1); + return a1 * std::sqrt(1.0 + t * t); + } + else + if (b1 > a1) + { + t = (a1 / b1); + return b1 * std::sqrt(1.0 + t * t); + } + return a1 * std::sqrt(2.0); + }; + const auto compute_d = [](VectorXd &d, const MatrixXd& J, const VectorXd& np) + { + d = J.adjoint() * np; + }; + + const auto update_z = + [](VectorXd& z, const MatrixXd& J, const VectorXd& d, int iq) + { + z = J.rightCols(z.size()-iq) * d.tail(d.size()-iq); + }; + + const auto update_r = + [](const MatrixXd& R, VectorXd& r, const VectorXd& d, int iq) + { + r.head(iq) = + R.topLeftCorner(iq,iq).triangularView().solve(d.head(iq)); + }; + + const auto add_constraint = [&distance]( + MatrixXd& R, + MatrixXd& J, + VectorXd& d, + int& iq, + double& R_norm)->bool + { + int n=J.rows(); +#ifdef TRACE_SOLVER + std::cerr << "Add constraint " << iq << '/'; +#endif + int j, k; + double cc, ss, h, t1, t2, xny; + + /* we have to find the Givens rotation which will reduce the element + d(j) to zero. + if it is already zero we don't have to do anything, except of + decreasing j */ + for (j = n - 1; j >= iq + 1; j--) + { + /* The Givens rotation is done with the matrix (cc cs, cs -cc). + If cc is one, then element (j) of d is zero compared with element + (j - 1). Hence we don't have to do anything. + If cc is zero, then we just have to switch column (j) and column (j - 1) + of J. Since we only switch columns in J, we have to be careful how we + update d depending on the sign of gs. + Otherwise we have to apply the Givens rotation to these columns. + The i - 1 element of d has to be updated to h. */ + cc = d(j - 1); + ss = d(j); + h = distance(cc, ss); + if (h == 0.0) + continue; + d(j) = 0.0; + ss = ss / h; + cc = cc / h; + if (cc < 0.0) + { + cc = -cc; + ss = -ss; + d(j - 1) = -h; + } + else + d(j - 1) = h; + xny = ss / (1.0 + cc); + for (k = 0; k < n; k++) + { + t1 = J(k,j - 1); + t2 = J(k,j); + J(k,j - 1) = t1 * cc + t2 * ss; + J(k,j) = xny * (t1 + J(k,j - 1)) - t2; + } + } + /* update the number of constraints added*/ + iq++; + /* To update R we have to put the iq components of the d vector + into column iq - 1 of R + */ + R.col(iq-1).head(iq) = d.head(iq); +#ifdef TRACE_SOLVER + std::cerr << iq << std::endl; +#endif + + if (std::abs(d(iq - 1)) <= std::numeric_limits::epsilon() * R_norm) + { + // problem degenerate + return false; + } + R_norm = std::max(R_norm, std::abs(d(iq - 1))); + return true; + }; + + const auto delete_constraint = [&distance]( + MatrixXd& R, + MatrixXd& J, + VectorXi& A, + VectorXd& u, + int p, + int& iq, + int l) + { + int n = R.rows(); +#ifdef TRACE_SOLVER + std::cerr << "Delete constraint " << l << ' ' << iq; +#endif + int i, j, k, qq; + double cc, ss, h, xny, t1, t2; + + /* Find the index qq for active constraint l to be removed */ + for (i = p; i < iq; i++) + if (A(i) == l) + { + qq = i; + break; + } + + /* remove the constraint from the active set and the duals */ + for (i = qq; i < iq - 1; i++) + { + A(i) = A(i + 1); + u(i) = u(i + 1); + R.col(i) = R.col(i+1); + } + + A(iq - 1) = A(iq); + u(iq - 1) = u(iq); + A(iq) = 0; + u(iq) = 0.0; + for (j = 0; j < iq; j++) + R(j,iq - 1) = 0.0; + /* constraint has been fully removed */ + iq--; +#ifdef TRACE_SOLVER + std::cerr << '/' << iq << std::endl; +#endif + + if (iq == 0) + return; + + for (j = qq; j < iq; j++) + { + cc = R(j,j); + ss = R(j + 1,j); + h = distance(cc, ss); + if (h == 0.0) + continue; + cc = cc / h; + ss = ss / h; + R(j + 1,j) = 0.0; + if (cc < 0.0) + { + R(j,j) = -h; + cc = -cc; + ss = -ss; + } + else + R(j,j) = h; + + xny = ss / (1.0 + cc); + for (k = j + 1; k < iq; k++) + { + t1 = R(j,k); + t2 = R(j + 1,k); + R(j,k) = t1 * cc + t2 * ss; + R(j + 1,k) = xny * (t1 + R(j,k)) - t2; + } + for (k = 0; k < n; k++) + { + t1 = J(k,j); + t2 = J(k,j + 1); + J(k,j) = t1 * cc + t2 * ss; + J(k,j + 1) = xny * (J(k,j) + t1) - t2; + } + } + }; + + int i, k, l; /* indices */ + int ip, me, mi; + int n=g0.size(); int p=ce0.size(); int m=ci0.size(); + MatrixXd R(G.rows(),G.cols()), J(G.rows(),G.cols()); + + LLT chol(G.cols()); + + VectorXd s(m+p), z(n), r(m + p), d(n), np(n), u(m + p); + VectorXd x_old(n), u_old(m + p); + double f_value, psi, c1, c2, sum, ss, R_norm; + const double inf = std::numeric_limits::infinity(); + double t, t1, t2; /* t is the step length, which is the minimum of the partial step length t1 + * and the full step length t2 */ + VectorXi A(m + p), A_old(m + p), iai(m + p); + int q; + int iq, iter = 0; + std::vector iaexcl(m + p); + + me = p; /* number of equality constraints */ + mi = m; /* number of inequality constraints */ + q = 0; /* size of the active set A (containing the indices of the active constraints) */ + + /* + * Preprocessing phase + */ + + /* compute the trace of the original matrix G */ + c1 = G.trace(); + + /* decompose the matrix G in the form LL^T */ + chol.compute(G); + + /* initialize the matrix R */ + d.setZero(); + R.setZero(); + R_norm = 1.0; /* this variable will hold the norm of the matrix R */ + + /* compute the inverse of the factorized matrix G^-1, this is the initial value for H */ + // J = L^-T + J.setIdentity(); + J = chol.matrixU().solve(J); + c2 = J.trace(); +#ifdef TRACE_SOLVER + print_matrix("J", J, n); +#endif + + /* c1 * c2 is an estimate for cond(G) */ + + /* + * Find the unconstrained minimizer of the quadratic form 0.5 * x G x + g0 x + * this is a feasible point in the dual space + * x = G^-1 * g0 + */ + x = chol.solve(g0); + x = -x; + /* and compute the current solution value */ + f_value = 0.5 * g0.dot(x); +#ifdef TRACE_SOLVER + std::cerr << "Unconstrained solution: " << f_value << std::endl; + print_vector("x", x, n); +#endif + + /* Add equality constraints to the working set A */ + iq = 0; + for (i = 0; i < me; i++) + { + np = CE.col(i); + compute_d(d, J, np); + update_z(z, J, d, iq); + update_r(R, r, d, iq); +#ifdef TRACE_SOLVER + print_matrix("R", R, iq); + print_vector("z", z, n); + print_vector("r", r, iq); + print_vector("d", d, n); +#endif + + /* compute full step length t2: i.e., the minimum step in primal space s.t. the contraint + becomes feasible */ + t2 = 0.0; + if (std::abs(z.dot(z)) > std::numeric_limits::epsilon()) // i.e. z != 0 + t2 = (-np.dot(x) - ce0(i)) / z.dot(np); + + x += t2 * z; + + /* set u = u+ */ + u(iq) = t2; + u.head(iq) -= t2 * r.head(iq); + + /* compute the new solution value */ + f_value += 0.5 * (t2 * t2) * z.dot(np); + A(i) = -i - 1; + + if (!add_constraint(R, J, d, iq, R_norm)) + { + // FIXME: it should raise an error + // Equality constraints are linearly dependent + return false; + } + } + + /* set iai = K \ A */ + for (i = 0; i < mi; i++) + iai(i) = i; + +l1: iter++; +#ifdef TRACE_SOLVER + print_vector("x", x, n); +#endif + /* step 1: choose a violated constraint */ + for (i = me; i < iq; i++) + { + ip = A(i); + iai(ip) = -1; + } + + /* compute s(x) = ci^T * x + ci0 for all elements of K \ A */ + ss = 0.0; + psi = 0.0; /* this value will contain the sum of all infeasibilities */ + ip = 0; /* ip will be the index of the chosen violated constraint */ + for (i = 0; i < mi; i++) + { + iaexcl[i] = true; + sum = CI.col(i).dot(x) + ci0(i); + s(i) = sum; + psi += std::min(0.0, sum); + } +#ifdef TRACE_SOLVER + print_vector("s", s, mi); +#endif + + + if (std::abs(psi) <= mi * std::numeric_limits::epsilon() * c1 * c2* 100.0) + { + /* numerically there are not infeasibilities anymore */ + q = iq; + return true; + } + + /* save old values for u, x and A */ + u_old.head(iq) = u.head(iq); + A_old.head(iq) = A.head(iq); + x_old = x; + +l2: /* Step 2: check for feasibility and determine a new S-pair */ + for (i = 0; i < mi; i++) + { + if (s(i) < ss && iai(i) != -1 && iaexcl[i]) + { + ss = s(i); + ip = i; + } + } + if (ss >= 0.0) + { + q = iq; + return true; + } + + /* set np = n(ip) */ + np = CI.col(ip); + /* set u = (u 0)^T */ + u(iq) = 0.0; + /* add ip to the active set A */ + A(iq) = ip; + +#ifdef TRACE_SOLVER + std::cerr << "Trying with constraint " << ip << std::endl; + print_vector("np", np, n); +#endif + +l2a:/* Step 2a: determine step direction */ + /* compute z = H np: the step direction in the primal space (through J, see the paper) */ + compute_d(d, J, np); + update_z(z, J, d, iq); + /* compute N* np (if q > 0): the negative of the step direction in the dual space */ + update_r(R, r, d, iq); +#ifdef TRACE_SOLVER + std::cerr << "Step direction z" << std::endl; + print_vector("z", z, n); + print_vector("r", r, iq + 1); + print_vector("u", u, iq + 1); + print_vector("d", d, n); + print_ivector("A", A, iq + 1); +#endif + + /* Step 2b: compute step length */ + l = 0; + /* Compute t1: partial step length (maximum step in dual space without violating dual feasibility */ + t1 = inf; /* +inf */ + /* find the index l s.t. it reaches the minimum of u+(x) / r */ + for (k = me; k < iq; k++) + { + double tmp; + if (r(k) > 0.0 && ((tmp = u(k) / r(k)) < t1) ) + { + t1 = tmp; + l = A(k); + } + } + /* Compute t2: full step length (minimum step in primal space such that the constraint ip becomes feasible */ + if (std::abs(z.dot(z)) > std::numeric_limits::epsilon()) // i.e. z != 0 + t2 = -s(ip) / z.dot(np); + else + t2 = inf; /* +inf */ + + /* the step is chosen as the minimum of t1 and t2 */ + t = std::min(t1, t2); +#ifdef TRACE_SOLVER + std::cerr << "Step sizes: " << t << " (t1 = " << t1 << ", t2 = " << t2 << ") "; +#endif + + /* Step 2c: determine new S-pair and take step: */ + + /* case (i): no step in primal or dual space */ + if (t >= inf) + { + /* QPP is infeasible */ + // FIXME: unbounded to raise + q = iq; + return false; + } + /* case (ii): step in dual space */ + if (t2 >= inf) + { + /* set u = u + t * [-r 1) and drop constraint l from the active set A */ + u.head(iq) -= t * r.head(iq); + u(iq) += t; + iai(l) = l; + delete_constraint(R, J, A, u, p, iq, l); +#ifdef TRACE_SOLVER + std::cerr << " in dual space: " + << f_value << std::endl; + print_vector("x", x, n); + print_vector("z", z, n); + print_ivector("A", A, iq + 1); +#endif + goto l2a; + } + + /* case (iii): step in primal and dual space */ + + x += t * z; + /* update the solution value */ + f_value += t * z.dot(np) * (0.5 * t + u(iq)); + + u.head(iq) -= t * r.head(iq); + u(iq) += t; +#ifdef TRACE_SOLVER + std::cerr << " in both spaces: " + << f_value << std::endl; + print_vector("x", x, n); + print_vector("u", u, iq + 1); + print_vector("r", r, iq + 1); + print_ivector("A", A, iq + 1); +#endif + + if (t == t2) + { +#ifdef TRACE_SOLVER + std::cerr << "Full step has taken " << t << std::endl; + print_vector("x", x, n); +#endif + /* full step has taken */ + /* add constraint ip to the active set*/ + if (!add_constraint(R, J, d, iq, R_norm)) + { + iaexcl[ip] = false; + delete_constraint(R, J, A, u, p, iq, ip); +#ifdef TRACE_SOLVER + print_matrix("R", R, n); + print_ivector("A", A, iq); +#endif + for (i = 0; i < m; i++) + iai(i) = i; + for (i = 0; i < iq; i++) + { + A(i) = A_old(i); + iai(A(i)) = -1; + u(i) = u_old(i); + } + x = x_old; + goto l2; /* go to step 2 */ + } + else + iai(ip) = -1; +#ifdef TRACE_SOLVER + print_matrix("R", R, n); + print_ivector("A", A, iq); +#endif + goto l1; + } + + /* a patial step has taken */ +#ifdef TRACE_SOLVER + std::cerr << "Partial step has taken " << t << std::endl; + print_vector("x", x, n); +#endif + /* drop constraint l */ + iai(l) = l; + delete_constraint(R, J, A, u, p, iq, l); +#ifdef TRACE_SOLVER + print_matrix("R", R, n); + print_ivector("A", A, iq); +#endif + + s(ip) = CI.col(ip).dot(x) + ci0(ip); + +#ifdef TRACE_SOLVER + print_vector("s", s, mi); +#endif + goto l2a; +} diff --git a/vendor/libigl/include/igl/copyleft/quadprog.h b/vendor/libigl/include/igl/copyleft/quadprog.h new file mode 100644 index 0000000000000000000000000000000000000000..f054bbdba2f22c347dbe63a06515c684f2e857d8 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/quadprog.h @@ -0,0 +1,48 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_QUADPROG_H +#define IGL_COPYLEFT_QUADPROG_H + +#include "../igl_inline.h" +#include +namespace igl +{ + namespace copyleft + { + // Solve a (dense) quadratric program of the form: + // + // min 0.5 x G x + g0 x + // s.t. CE' x + ce0 = 0 + // and CI' x + ci0 >= 0 + // + // Inputs: + // G #x by #x matrix of quadratic coefficients + // g0 #x vector of linear coefficients + // CE #x by #CE list of linear equality coefficients + // ce0 #CE list of linear equality right-hand sides + // CI #x by #CI list of linear equality coefficients + // ci0 #CI list of linear equality right-hand sides + // Outputs: + // x #x vector of solution values + // Returns true iff success + IGL_INLINE bool quadprog( + const Eigen::MatrixXd & G, + const Eigen::VectorXd & g0, + const Eigen::MatrixXd & CE, + const Eigen::VectorXd & ce0, + const Eigen::MatrixXd & CI, + const Eigen::VectorXd & ci0, + Eigen::VectorXd& x); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "quadprog.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/README b/vendor/libigl/include/igl/copyleft/tetgen/README new file mode 100644 index 0000000000000000000000000000000000000000..0315b6c116de7e6ab3ab02fd62bbaa90c1ac09ba --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/README @@ -0,0 +1,7 @@ +IGL interface to tetgen library + +Dependencies: + tetgen + +Travel to $IGL/external/tetgen and issue: + make -f Makefile.igl tetlib diff --git a/vendor/libigl/include/igl/copyleft/tetgen/cdt.cpp b/vendor/libigl/include/igl/copyleft/tetgen/cdt.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f2602dd66168923099711af560c72d03ebe49ac0 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/cdt.cpp @@ -0,0 +1,64 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "cdt.h" +#include "../../bounding_box.h" +#include "tetrahedralize.h" + +template < + typename DerivedV, + typename DerivedF, + typename DerivedTV, + typename DerivedTT, + typename DerivedTF> +IGL_INLINE bool igl::copyleft::tetgen::cdt( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const CDTParam & param, + Eigen::PlainObjectBase& TV, + Eigen::PlainObjectBase& TT, + Eigen::PlainObjectBase& TF) +{ + using namespace Eigen; + using namespace std; + // Effective input mesh + DerivedV U; + DerivedF G; + if(param.use_bounding_box) + { + // Construct bounding box mesh + DerivedV BV; + DerivedF BF; + bounding_box(V,BV,BF); + // scale bounding box + const RowVector3d mid = + (BV.colwise().minCoeff() + BV.colwise().maxCoeff()).eval()*0.5; + BV.rowwise() -= mid; + assert(param.bounding_box_scale >= 1.); + BV.array() *= param.bounding_box_scale; + BV.rowwise() += mid; + // Append bounding box to mesh + U.resize(V.rows()+BV.rows(),V.cols()); + U<, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, igl::copyleft::tetgen::CDTParam const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/cdt.h b/vendor/libigl/include/igl/copyleft/tetgen/cdt.h new file mode 100644 index 0000000000000000000000000000000000000000..e59a28029193daed3b366933c21473e4fba64744 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/cdt.h @@ -0,0 +1,72 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_TETGEN_CDT_H +#define IGL_COPYLEFT_TETGEN_CDT_H +#include "../../igl_inline.h" + +#include +#include +#ifndef TETLIBRARY +# define TETLIBRARY +#endif +#include "tetgen.h" // Defined REAL + +namespace igl +{ + namespace copyleft + { + namespace tetgen + { + struct CDTParam + { + // Tetgen can compute mesh of convex hull of input (i.e. "c") but often + // chokes. One workaround is to force it to mesh the entire bounding box. + // {false} + bool use_bounding_box = false; + // Scale the bounding box a bit so that vertices near it do not give tetgen + // problems. {1.01} + double bounding_box_scale = 1.01; + // Flags to tetgen. Do not include the "c" flag here! {"Y"} + std::string flags = "Y"; + }; + // Create a constrained delaunay tessellation containing convex hull of the + // given **non-selfintersecting** mesh. + // + // Inputs: + // V #V by 3 list of input mesh vertices + // F #F by 3 list of input mesh facets + // param see above + // TV #TV by 3 list of output mesh vertices (V come first) + // TT #TT by 3 list of tetrahedra indices into TV. + // TF #TF by 3 list of facets from F potentially subdivided. + // + template < + typename DerivedV, + typename DerivedF, + typename DerivedTV, + typename DerivedTT, + typename DerivedTF> + IGL_INLINE bool cdt( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const CDTParam & param, + Eigen::PlainObjectBase& TV, + Eigen::PlainObjectBase& TT, + Eigen::PlainObjectBase& TF); + } + } +} + + +#ifndef IGL_STATIC_LIBRARY +# include "cdt.cpp" +#endif + +#endif + + diff --git a/vendor/libigl/include/igl/copyleft/tetgen/mesh_to_tetgenio.cpp b/vendor/libigl/include/igl/copyleft/tetgen/mesh_to_tetgenio.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7376ec816723a84749d0a57243496b642d8b9a9c --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/mesh_to_tetgenio.cpp @@ -0,0 +1,166 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mesh_to_tetgenio.h" + +// IGL includes +#include "../../matrix_to_list.h" + +// STL includes +#include + + +IGL_INLINE bool igl::copyleft::tetgen::mesh_to_tetgenio( + const std::vector > & V, + const std::vector > & F, + const std::vector > & H, + const std::vector > & R, + tetgenio & in) +{ + using namespace std; + in.firstnumber = 0; + in.numberofpoints = V.size(); + in.pointlist = new REAL[in.numberofpoints * 3]; + //loop over points + for(size_t i = 0; i < (size_t)V.size(); i++) + { + assert(V[i].size() == 3); + in.pointlist[i*3+0] = V[i][0]; + in.pointlist[i*3+1] = V[i][1]; + in.pointlist[i*3+2] = V[i][2]; + } + in.numberoffacets = F.size(); + in.facetlist = new tetgenio::facet[in.numberoffacets]; + in.facetmarkerlist = new int[in.numberoffacets]; + + // loop over face + for(size_t i = 0;i < (size_t)F.size(); i++) + { + in.facetmarkerlist[i] = i; + tetgenio::facet * f = &in.facetlist[i]; + f->numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[f->numberofpolygons]; + f->numberofholes = 0; + f->holelist = NULL; + tetgenio::polygon * p = &f->polygonlist[0]; + p->numberofvertices = F[i].size(); + p->vertexlist = new int[p->numberofvertices]; + // loop around face + for(int j = 0;j < (int)F[i].size(); j++) + { + p->vertexlist[j] = F[i][j]; + } + } + + in.numberofholes = H.size(); + in.holelist = new double[3 * in.numberofholes]; + // loop over holes + for(size_t holeID = 0, nHoles = H.size(); holeID < nHoles; holeID++) + { + in.holelist[holeID * 3 + 0] = H[holeID][0]; + in.holelist[holeID * 3 + 1] = H[holeID][1]; + in.holelist[holeID * 3 + 2] = H[holeID][2]; + } + + in.numberofregions = R.size(); + in.regionlist = new REAL[ 5 * in.numberofregions]; + // loop over regions + for(size_t regionID = 0, nRegions = R.size(); regionID < nRegions; regionID++) + { + in.regionlist[regionID * 5 + 0] = R[regionID][0]; + in.regionlist[regionID * 5 + 1] = R[regionID][1]; + in.regionlist[regionID * 5 + 2] = R[regionID][2]; + in.regionlist[regionID * 5 + 3] = R[regionID][3]; + in.regionlist[regionID * 5 + 4] = R[regionID][4]; + } + + return true; + +} + +template +IGL_INLINE bool igl::copyleft::tetgen::mesh_to_tetgenio( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& H, + const Eigen::PlainObjectBase& R, + tetgenio & in) +{ + using namespace std; + vector > vV, vH, vR; + vector > vF; + matrix_to_list(V,vV); + matrix_to_list(F,vF); + matrix_to_list(H, vH); + matrix_to_list(R, vR); + return mesh_to_tetgenio(vV,vF,vH,vR,in); +} + + +IGL_INLINE bool igl::copyleft::tetgen::mesh_to_tetgenio( + const std::vector > & V, + const std::vector > & F, + tetgenio & in) +{ + using namespace std; + // all indices start from 0 + in.firstnumber = 0; + + in.numberofpoints = V.size(); + in.pointlist = new REAL[in.numberofpoints * 3]; + // loop over points + for(int i = 0; i < (int)V.size(); i++) + { + assert(V[i].size() == 3); + in.pointlist[i*3+0] = V[i][0]; + in.pointlist[i*3+1] = V[i][1]; + in.pointlist[i*3+2] = V[i][2]; + } + + in.numberoffacets = F.size(); + in.facetlist = new tetgenio::facet[in.numberoffacets]; + in.facetmarkerlist = new int[in.numberoffacets]; + + // loop over face + for(int i = 0;i < (int)F.size(); i++) + { + in.facetmarkerlist[i] = i; + tetgenio::facet * f = &in.facetlist[i]; + f->numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[f->numberofpolygons]; + f->numberofholes = 0; + f->holelist = NULL; + tetgenio::polygon * p = &f->polygonlist[0]; + p->numberofvertices = F[i].size(); + p->vertexlist = new int[p->numberofvertices]; + // loop around face + for(int j = 0;j < (int)F[i].size(); j++) + { + p->vertexlist[j] = F[i][j]; + } + } + return true; +} + +template +IGL_INLINE bool igl::copyleft::tetgen::mesh_to_tetgenio( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + tetgenio & in) +{ + using namespace std; + vector > vV; + vector > vF; + matrix_to_list(V,vV); + matrix_to_list(F,vF); + return mesh_to_tetgenio(vV,vF,in); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template bool igl::copyleft::tetgen::mesh_to_tetgenio, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, tetgenio&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/mesh_to_tetgenio.h b/vendor/libigl/include/igl/copyleft/tetgen/mesh_to_tetgenio.h new file mode 100644 index 0000000000000000000000000000000000000000..23e00e947e0106525d541d69851ca4c221e645f2 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/mesh_to_tetgenio.h @@ -0,0 +1,87 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_TETGEN_MESH_TO_TETGENIO_H +#define IGL_COPYLEFT_TETGEN_MESH_TO_TETGENIO_H +#include "../../igl_inline.h" + +#ifndef TETLIBRARY +# define TETLIBRARY +#endif +#include "tetgen.h" // Defined tetgenio, REAL +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace tetgen + { + // Load a vertex list and face list into a tetgenio object + // Inputs: + // V #V by 3 vertex position list + // F #F list of polygon face indices into V (0-indexed) + // Outputs: + // in tetgenio input object + // Returns true on success, false on error + IGL_INLINE bool mesh_to_tetgenio( + const std::vector > & V, + const std::vector > & F, + tetgenio & in); + + // Wrapper with Eigen types + // Templates: + // DerivedV real-value: i.e. from MatrixXd + // DerivedF integer-value: i.e. from MatrixXi + template + IGL_INLINE bool mesh_to_tetgenio( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + tetgenio & in); + + + // Load a vertex list and face list into a tetgenio object + // Inputs: + // V #V by 3 vertex position list + // F #F list of polygon face indices into V (0-indexed) + // H #H list of seed point inside each hole + // R #R list of seed point inside each region + // Outputs: + // in tetgenio input object + // Returns true on success, false on error + IGL_INLINE bool mesh_to_tetgenio( + const std::vector > & V, + const std::vector > & F, + const std::vector > & H, + const std::vector > & R, + tetgenio & in); + + + // Wrapper with Eigen types + // Templates: + // DerivedV real-value: i.e. from MatrixXd + // DerivedF integer-value: i.e. from MatrixXi + // DerivedH real-value + // DerivedR real-value + template + IGL_INLINE bool mesh_to_tetgenio( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& H, + const Eigen::PlainObjectBase& R, + tetgenio& in); + } + } +} + + +#ifndef IGL_STATIC_LIBRARY +# include "mesh_to_tetgenio.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/mesh_with_skeleton.cpp b/vendor/libigl/include/igl/copyleft/tetgen/mesh_with_skeleton.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5c920b36d40f30659a9d1d020e02447c60fd0334 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/mesh_with_skeleton.cpp @@ -0,0 +1,102 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mesh_with_skeleton.h" +#include "tetrahedralize.h" + +#include "../../sample_edges.h" +#include "../../cat.h" + +#include +// Default settings pq2Y tell tetgen to mesh interior of triangle mesh and +// to produce a graded tet mesh +const static std::string DEFAULT_TETGEN_FLAGS = "pq2Y"; + +IGL_INLINE bool igl::copyleft::tetgen::mesh_with_skeleton( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXd & C, + const Eigen::VectorXi & /*P*/, + const Eigen::MatrixXi & BE, + const Eigen::MatrixXi & CE, + const int samples_per_bone, + const std::string & tetgen_flags, + Eigen::MatrixXd & VV, + Eigen::MatrixXi & TT, + Eigen::MatrixXi & FF) +{ + using namespace Eigen; + using namespace std; + const string eff_tetgen_flags = + (tetgen_flags.length() == 0?DEFAULT_TETGEN_FLAGS:tetgen_flags); + // Collect all edges that need samples: + MatrixXi BECE = cat(1,BE,CE); + MatrixXd S; + // Sample each edge with 10 samples. (Choice of 10 doesn't seem to matter so + // much, but could under some circumstances) + sample_edges(C,BECE,samples_per_bone,S); + // Vertices we'll constrain tet mesh to meet + MatrixXd VS = cat(1,V,S); + // Use tetgen to mesh the interior of surface, this assumes surface: + // * has no holes + // * has no non-manifold edges or vertices + // * has consistent orientation + // * has no self-intersections + // * has no 0-volume pieces + cerr<<"tetgen begin()"< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_TETGEN_MESH_WITH_SKELETON_H +#define IGL_COPYLEFT_TETGEN_MESH_WITH_SKELETON_H +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace copyleft + { + namespace tetgen + { + // Mesh the interior of a given surface with tetrahedra which are graded + // (tend to be small near the surface and large inside) and conform to the + // given handles and samplings thereof. + // + // Inputs: + // V #V by 3 list of mesh vertex positions + // F #F by 3 list of triangle indices + // C #C by 3 list of vertex positions + // P #P list of point handle indices + // BE #BE by 2 list of bone-edge indices + // CE #CE by 2 list of cage-edge indices + // samples_per_bone #samples to add per bone + // tetgen_flags flags to pass to tetgen {""-->"pq2Y"} otherwise you're on + // your own and it's your funeral if you pass nonsense flags + // Outputs: + // VV #VV by 3 list of tet-mesh vertex positions + // TT #TT by 4 list of tetrahedra indices + // FF #FF by 3 list of surface triangle indices + // Returns true only on success + IGL_INLINE bool mesh_with_skeleton( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXd & C, + const Eigen::VectorXi & /*P*/, + const Eigen::MatrixXi & BE, + const Eigen::MatrixXi & CE, + const int samples_per_bone, + const std::string & tetgen_flags, + Eigen::MatrixXd & VV, + Eigen::MatrixXi & TT, + Eigen::MatrixXi & FF); + // Wrapper using default tetgen_flags + IGL_INLINE bool mesh_with_skeleton( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXd & C, + const Eigen::VectorXi & /*P*/, + const Eigen::MatrixXi & BE, + const Eigen::MatrixXi & CE, + const int samples_per_bone, + Eigen::MatrixXd & VV, + Eigen::MatrixXi & TT, + Eigen::MatrixXi & FF); + } + } +} + + +#ifndef IGL_STATIC_LIBRARY +# include "mesh_with_skeleton.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/read_into_tetgenio.cpp b/vendor/libigl/include/igl/copyleft/tetgen/read_into_tetgenio.cpp new file mode 100644 index 0000000000000000000000000000000000000000..506c5e4ba1022f97f011cf7c9afbf9587204f5bc --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/read_into_tetgenio.cpp @@ -0,0 +1,74 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "read_into_tetgenio.h" +#include "mesh_to_tetgenio.h" + +// IGL includes +#include "../../pathinfo.h" +#ifndef IGL_NO_EIGEN +# define IGL_NO_EIGEN_WAS_NOT_ALREADY_DEFINED +# define IGL_NO_EIGEN +#endif +// Include igl headers without including Eigen +#include "../../readOBJ.h" +#ifdef IGL_NO_EIGEN_WAS_NOT_ALREADY_DEFINED +# undef IGL_NO_EIGEN +#endif + +// STL includes +#include +#include +#include + +IGL_INLINE bool igl::copyleft::tetgen::read_into_tetgenio( + const std::string & path, + tetgenio & in) +{ + using namespace std; + // get file extension + string dirname,basename,ext,filename; + pathinfo(path,dirname,basename,ext,filename); + // convert to lower case for easy comparison + transform(ext.begin(), ext.end(), ext.begin(), ::tolower); + bool success = false; + + char basename_char[1024]; + strcpy(basename_char,basename.c_str()); + + if(ext == "obj") + { + // read obj into vertex list and face list + vector > V,TC,N; + vector > F,FTC,FN; + success = readOBJ(path,V,TC,N,F,FTC,FN); + success &= mesh_to_tetgenio(V,F,in); + }else if(ext == "off") + { + success = in.load_off(basename_char); + }else if(ext == "node") + { + success = in.load_node(basename_char); + }else + { + if(ext.length() > 0) + { + cerr<<"^read_into_tetgenio Warning: Unsupported extension ("< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_TETGEN_READ_INTO_TETGENIO_H +#define IGL_COPYLEFT_TETGEN_READ_INTO_TETGENIO_H +#include "../../igl_inline.h" + +#include +#ifndef TETLIBRARY +#define TETLIBRARY +#endif +#include "tetgen.h" // Defined tetgenio, REAL + +namespace igl +{ + namespace copyleft + { + namespace tetgen + { + // Read a mesh or point set into tetgenio (input object for calling + // tetgen). Many file formats are already supported by tetgen: + // .off + // .ply + // .node + // .ply + // .medit + // .vtk + // etc. + // Notably it does not support .obj which is loaded by hand here (also + // demonstrating how to load points/faces programmatically) + // + // If the file extension is not recognized the filename is assumed to be + // the basename of a collection describe a tetmesh, (of which at least + // the .node file must exist): + // [filename].node + // [filename].ele + // [filename].face + // [filename].edge + // [filename].vol + // + // Inputs: + // path path to file or basename to files + // Outputs: + // in tetgenio input object + // Returns true on success, false on error + IGL_INLINE bool read_into_tetgenio( + const std::string & path, + tetgenio & in); + } + } +} + + +#ifndef IGL_STATIC_LIBRARY +# include "read_into_tetgenio.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/tetgenio_to_tetmesh.cpp b/vendor/libigl/include/igl/copyleft/tetgen/tetgenio_to_tetmesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aba87da831be849d85b44a5ceafa7fba3b569f19 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/tetgenio_to_tetmesh.cpp @@ -0,0 +1,280 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "tetgenio_to_tetmesh.h" + +// IGL includes +#include "../../list_to_matrix.h" + +// STL includes +#include + +IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh( + const tetgenio & out, + std::vector > & V, + std::vector > & T, + std::vector > & F) +{ + using namespace std; + // process points + if(out.pointlist == NULL) + { + cerr<<"^tetgenio_to_tetmesh Error: point list is NULL\n"<(3)); + // loop over points + for(int i = 0;i < out.numberofpoints; i++) + { + V[i][0] = out.pointlist[i*3+0]; + V[i][1] = out.pointlist[i*3+1]; + V[i][2] = out.pointlist[i*3+2]; + } + + + // process tets + if(out.tetrahedronlist == NULL) + { + cerr<<"^tetgenio_to_tetmesh Error: tet list is NULL\n"<(out.numberofcorners)); + int min_index = 1e7; + int max_index = -1e7; + // loop over tetrahedra + for(int i = 0; i < out.numberoftetrahedra; i++) + { + for(int j = 0; j index ? index : min_index); + max_index = (max_index < index ? index : max_index); + } + } + assert(min_index >= 0); + assert(max_index >= 0); + assert(max_index < (int)V.size()); + + // When would this not be 4? + F.clear(); + // loop over tetrahedra + for(int i = 0; i < out.numberoftrifaces; i++) + { + if (out.trifacemarkerlist && out.trifacemarkerlist[i] >= 0) + { + vector face(3); + for(int j = 0; j<3; j++) + { + face[j] = out.trifacelist[i * 3 + j]; + } + F.push_back(face); + } + } + + return true; +} + +template +IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh( + const tetgenio & out, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& T) +{ + Eigen::Matrix F; + return tetgenio_to_tetmesh(out,V,T,F); +} + +template +IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh( + const tetgenio & out, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& T, + Eigen::PlainObjectBase& F) +{ + using namespace std; + vector > vV; + vector > vT; + vector > vF; + bool success = tetgenio_to_tetmesh(out,vV,vT,vF); + if(!success) + { + return false; + } + bool V_rect = list_to_matrix(vV,V); + if(!V_rect) + { + // igl::list_to_matrix(vV,V) already printed error message to std err + return false; + } + bool T_rect = list_to_matrix(vT,T); + if(!T_rect) + { + // igl::list_to_matrix(vT,T) already printed error message to std err + return false; + } + bool F_rect = list_to_matrix(vF,F); + if(!F_rect) + { + return false; + } + + return true; +} + +IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh( + const tetgenio & out, + std::vector > & V, + std::vector > & T) +{ + std::vector > F; + return tetgenio_to_tetmesh(out,V,T,F); +} + +IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh( + const tetgenio & out, + std::vector > & V, + std::vector > & T, + std::vector > & F, + std::vector >& R, + std::vector >& N, + std::vector >& PT, + std::vector >& FT, + size_t & nR ) +{ + using namespace std; + // process points + if(out.pointlist == NULL) + { + cerr<<"^tetgenio_to_tetmesh Error: point list is NULL\n"<(3)); + // loop over points + for(int i = 0;i < out.numberofpoints; i++) + { + V[i][0] = out.pointlist[i*3+0]; + V[i][1] = out.pointlist[i*3+1]; + V[i][2] = out.pointlist[i*3+2]; + } + + // process tets + if(out.tetrahedronlist == NULL) + { + cerr<<"^tetgenio_to_tetmesh Error: tet list is NULL\n"<(out.numberofcorners)); + int min_index = 1e7; + int max_index = -1e7; + // loop over tetrahedra + for(int i = 0; i < out.numberoftetrahedra; i++) + { + for(int j = 0; j index ? index : min_index); + max_index = (max_index < index ? index : max_index); + } + } + + assert(min_index >= 0); + assert(max_index >= 0); + assert(max_index < (int)V.size()); + + // When would this not be 4? + F.clear(); + // loop over tetrahedra + for(int i = 0; i < out.numberoftrifaces; i++) + { + if(out.trifacemarkerlist[i]>=0) + { + vector face(3); + for(int j = 0; j<3; j++) + { + face[j] = out.trifacelist[i * 3 + j]; + } + F.push_back(face); + } + } + + if(out.tetrahedronattributelist) + { + R.resize(out.numberoftetrahedra, vector(1)); + unordered_map hashUniqueRegions; + for(size_t i = 0; i < out.numberoftetrahedra; i++) + { + R[i][0] = out.tetrahedronattributelist[i]; + hashUniqueRegions[R[i][0]] = i; + } + // extract region marks + nR = hashUniqueRegions.size(); + }else + { + R.clear(); + nR = 0; + } + + // extract neighbor list + if(out.neighborlist) + { + N.resize(out.numberoftetrahedra, vector(4)); + for (size_t i = 0; i < out.numberoftetrahedra; i++) + { + for (size_t j = 0; j < 4; j++) + N[i][j] = out.neighborlist[i * 4 + j]; + } + }else + { + N.clear(); + } + + // extract point 2 tetrahedron list + if(out.point2tetlist) + { + PT.resize(out.numberofpoints, vector(1)); + for (size_t i = 0; i < out.numberofpoints; i++) + { + PT[i][0] = out.point2tetlist[i]; + } + }else + { + PT.clear(); + } + + //extract face to tetrahedron list + if(out.face2tetlist) + { + FT.resize(out.numberoftrifaces, vector(2)); + int triface; + for (size_t i = 0; i < out.numberoftrifaces; i++) + { + for (size_t j = 0; j < 2; j++) + { + FT[i][j] = out.face2tetlist[0]; + } + } + }else + { + FT.clear(); + } + + return true; +} + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template bool igl::copyleft::tetgen::tetgenio_to_tetmesh, Eigen::Matrix >(tetgenio const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/tetgenio_to_tetmesh.h b/vendor/libigl/include/igl/copyleft/tetgen/tetgenio_to_tetmesh.h new file mode 100644 index 0000000000000000000000000000000000000000..0d1c523e1c78c690d18b5bcf1e548e5ef36d7457 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/tetgenio_to_tetmesh.h @@ -0,0 +1,94 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_TETGEN_TETGENIO_TO_TETMESH_H +#define IGL_COPYLEFT_TETGEN_TETGENIO_TO_TETMESH_H +#include "../../igl_inline.h" + +#ifndef TETLIBRARY +#define TETLIBRARY +#endif +#include "tetgen.h" // Defined tetgenio, REAL +#include +#include +#include +namespace igl +{ + namespace copyleft + { + namespace tetgen + { + // Extract a tetrahedral mesh from a tetgenio object + // Inputs: + // out tetgenio output object + // Outputs: + // V #V by 3 vertex position list + // T #T by 4 list of tetrahedra indices into V + // F #F by 3 list of marked facets + // Returns true on success, false on error + IGL_INLINE bool tetgenio_to_tetmesh( + const tetgenio & out, + std::vector > & V, + std::vector > & T, + std::vector > & F); + + IGL_INLINE bool tetgenio_to_tetmesh( + const tetgenio & out, + std::vector > & V, + std::vector > & T); + + // Wrapper with Eigen types + // Templates: + // DerivedV real-value: i.e. from MatrixXd + // DerivedT integer-value: i.e. from MatrixXi + template + IGL_INLINE bool tetgenio_to_tetmesh( + const tetgenio & out, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& T, + Eigen::PlainObjectBase& F); + + template + IGL_INLINE bool tetgenio_to_tetmesh( + const tetgenio & out, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& T); + + // Extract a tetrahedral mesh from a tetgenio object + // Inputs: + // out tetgenio output object + // Outputs: + // V #V by 3 vertex position list + // T #T by 4 list of tetrahedra indices into V + // F #F by 3 list of marked facets + // R #T list of region IDs for tetrahedra + // N #T by 2 list of neighbors for each tetrahedron + // PT #V list of incident tetrahedron for each vertex + // FT #F by 2 list of tetrahedra sharing each face + // nR number of regions in output mesh + // Returns true on success, false on error + IGL_INLINE bool tetgenio_to_tetmesh( + const tetgenio & out, + std::vector > & V, + std::vector > & T, + std::vector > & F, + std::vector > & R,// region marks for tetrahedrons + std::vector > &N, // neighborlist per tet + std::vector > &PT, // Point to tet list per point + std::vector > &FT, // face to tet list + size_t & nR); // number of regions + + } + } +} + + +#ifndef IGL_STATIC_LIBRARY +# include "tetgenio_to_tetmesh.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/tetrahedralize.cpp b/vendor/libigl/include/igl/copyleft/tetgen/tetrahedralize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c5f6eb29dad3e0e6e62373abf4e3689f7fe7a4ea --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/tetrahedralize.cpp @@ -0,0 +1,346 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "tetrahedralize.h" +#include "mesh_to_tetgenio.h" +#include "tetgenio_to_tetmesh.h" + +// IGL includes +#include "../../matrix_to_list.h" +#include "../../list_to_matrix.h" +#include "../../boundary_facets.h" + +// STL includes +#include +#include + +IGL_INLINE int igl::copyleft::tetgen::tetrahedralize( + const std::vector > & V, + const std::vector > & F, + const std::string switches, + std::vector > & TV, + std::vector > & TT, + std::vector > & TF) +{ + using namespace std; + tetgenio in,out; + bool success; + success = mesh_to_tetgenio(V,F,in); + if(!success) + { + return -1; + } + try + { + char * cswitches = new char[switches.size() + 1]; + std::strcpy(cswitches,switches.c_str()); + ::tetrahedralize(cswitches,&in, &out); + delete[] cswitches; + }catch(int e) + { + cerr<<"^"<<__FUNCTION__<<": TETGEN CRASHED... KABOOOM!!!"< +IGL_INLINE int igl::copyleft::tetgen::tetrahedralize( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const std::string switches, + Eigen::PlainObjectBase& TV, + Eigen::PlainObjectBase& TT, + Eigen::PlainObjectBase& TF) +{ + using namespace std; + vector > vV,vTV; + vector > vF,vTT,vTF; + matrix_to_list(V,vV); + matrix_to_list(F,vF); + int e = tetrahedralize(vV,vF,switches,vTV,vTT,vTF); + if(e == 0) + { + bool TV_rect = list_to_matrix(vTV,TV); + if(!TV_rect) + { + return 3; + } + bool TT_rect = list_to_matrix(vTT,TT); + if(!TT_rect) + { + return 3; + } + bool TF_rect = list_to_matrix(vTF,TF); + if(!TF_rect) + { + return 3; + } + } + return e; +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedVM, + typename DerivedFM, + typename DerivedTV, + typename DerivedTT, + typename DerivedTF, + typename DerivedTM> +IGL_INLINE int igl::copyleft::tetgen::tetrahedralize( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const Eigen::MatrixBase& VM, + const Eigen::MatrixBase& FM, + const std::string switches, + Eigen::PlainObjectBase& TV, + Eigen::PlainObjectBase& TT, + Eigen::PlainObjectBase& TF, + Eigen::PlainObjectBase& TM) +{ + using namespace std; + vector > vV,vTV; + vector > vF,vTT,vTF; + vector vTM; + + matrix_to_list(V,vV); + matrix_to_list(F,vF); + vector vVM = matrix_to_list(VM); + vector vFM = matrix_to_list(FM); + int e = tetrahedralize(vV,vF,vVM,vFM,switches,vTV,vTT,vTF,vTM); + if(e == 0) + { + bool TV_rect = list_to_matrix(vTV,TV); + if(!TV_rect) + { + return false; + } + bool TT_rect = list_to_matrix(vTT,TT); + if(!TT_rect) + { + return false; + } + bool TF_rect = list_to_matrix(vTF,TF); + if(!TF_rect) + { + return false; + } + bool TM_rect = list_to_matrix(vTM,TM); + if(!TM_rect) + { + return false; + } + } + return e; +} + +IGL_INLINE int igl::copyleft::tetgen::tetrahedralize( + const std::vector > & V, + const std::vector > & F, + const std::vector & VM, + const std::vector & FM, + const std::string switches, + std::vector > & TV, + std::vector > & TT, + std::vector > & TF, + std::vector & TM) +{ + using namespace std; + tetgenio in,out; + bool success; + success = mesh_to_tetgenio(V,F,in); + if(!success) + { + return -1; + } + in.pointmarkerlist = new int[VM.size()]; + for (int i = 0; i < VM.size(); ++i) { + in.pointmarkerlist[i] = VM[i]; + } + // These have already been created in mesh_to_tetgenio. + // Reset them here. + for (int i = 0; i < FM.size(); ++i) { + in.facetmarkerlist[i] = FM[i]; + } + try + { + char * cswitches = new char[switches.size() + 1]; + std::strcpy(cswitches,switches.c_str()); + ::tetrahedralize(cswitches,&in, &out); + delete[] cswitches; + }catch(int e) + { + cerr<<"^"<<__FUNCTION__<<": TETGEN CRASHED... KABOOOM!!!"< > & V, + const std::vector > & F, + const std::vector > & H, + const std::vector > & R, + const std::string switches, + std::vector > & TV, + std::vector > & TT, + std::vector > & TF, + std::vector > &TR, + std::vector > & TN, + std::vector > & PT, + std::vector > & FT, + size_t & numRegions) +{ + using namespace std; + tetgenio in,out; + bool success; + success = mesh_to_tetgenio(V, F, H, R, in); + if(!success) + { + return -1; + } + try + { + char * cswitches = new char[switches.size() + 1]; + strcpy(cswitches, switches.c_str()); + + ::tetrahedralize(cswitches, &in, &out); + delete[] cswitches; +}catch(int e) + { + cerr <<"^"<<__FUNCTION__<<": TETGEN CRASHED...KABOOM!!"< +IGL_INLINE int igl::copyleft::tetgen::tetrahedralize( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const Eigen::MatrixBase& H, + const Eigen::MatrixBase& R, + const std::string switches, + Eigen::PlainObjectBase& TV, + Eigen::PlainObjectBase& TT, + Eigen::PlainObjectBase& TF, + Eigen::PlainObjectBase& TR, + Eigen::PlainObjectBase& TN, + Eigen::PlainObjectBase& PT, + Eigen::PlainObjectBase& FT, + size_t & numRegions) +{ + using namespace std; + vector > vV, vH, vR, vTV, vTR; + vector > vF,vTT,vTF, vTN, vPT, vFT; + matrix_to_list(V,vV); + matrix_to_list(F,vF); + matrix_to_list(H, vH); + matrix_to_list(R, vR); + + int e = tetrahedralize(vV,vF,vH,vR,switches,vTV,vTT,vTF,vTR,vTN,vPT,vFT, numRegions); + + if(e == 0) + { + bool TV_rect = list_to_matrix(vTV,TV); + if(!TV_rect) + { + return 3; + } + bool TT_rect = list_to_matrix(vTT,TT); + if(!TT_rect) + { + return 3; + } + bool TF_rect = list_to_matrix(vTF,TF); + if(!TF_rect) + { + return 3; + } + bool TR_rect = list_to_matrix(vTR, TR); + if(!TR_rect) + { + return 3; + } + bool TN_rect = list_to_matrix(vTN, TN); + if(!TN_rect) + { + return 3; + } + bool PT_rect = list_to_matrix(vPT, PT); + if(!PT_rect) + { + return 3; + } + bool FT_rect = list_to_matrix(vFT, FT); + if(!FT_rect) + { + return 3; + } + } + return e; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template int igl::copyleft::tetgen::tetrahedralize, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template int igl::copyleft::tetgen::tetrahedralize,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(const Eigen::MatrixBase > &,const Eigen::MatrixBase > &,const Eigen::MatrixBase > &,const Eigen::MatrixBase > &,const std::basic_string, std::allocator >,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &); +template int igl::copyleft::tetgen::tetrahedralize, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template int igl::copyleft::tetgen::tetrahedralize, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, unsigned long&); +#endif diff --git a/vendor/libigl/include/igl/copyleft/tetgen/tetrahedralize.h b/vendor/libigl/include/igl/copyleft/tetgen/tetrahedralize.h new file mode 100644 index 0000000000000000000000000000000000000000..0dc0efbc08765b3bf12c9ee2de319ee4f1087593 --- /dev/null +++ b/vendor/libigl/include/igl/copyleft/tetgen/tetrahedralize.h @@ -0,0 +1,202 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_TETGEN_TETRAHEDRALIZE_H +#define IGL_COPYLEFT_TETGEN_TETRAHEDRALIZE_H +#include "../../igl_inline.h" + +#include +#include +#include +#ifndef TETLIBRARY +#define TETLIBRARY +#endif +#include // Defined REAL + +namespace igl +{ + namespace copyleft + { + namespace tetgen + { + // Mesh the interior of a surface mesh (V,F) using tetgen + // + // Inputs: + // V #V by 3 vertex position list + // F #F list of polygon face indices into V (0-indexed) + // switches string of tetgen options (See tetgen documentation) e.g. + // "pq1.414a0.01" tries to mesh the interior of a given surface with + // quality and area constraints + // "" will mesh the convex hull constrained to pass through V (ignores F) + // Outputs: + // TV #V by 3 vertex position list + // TT #T by 4 list of tet face indices + // TF #F by 3 list of triangle face indices + // Returns status: + // 0 success + // 1 tetgen threw exception + // 2 tetgen did not crash but could not create any tets (probably there are + // holes, duplicate faces etc.) + // -1 other error + IGL_INLINE int tetrahedralize( + const std::vector > & V, + const std::vector > & F, + const std::string switches, + std::vector > & TV, + std::vector > & TT, + std::vector > & TF); + + // Wrapper with Eigen types + // Templates: + // DerivedV real-value: i.e. from MatrixXd + // DerivedF integer-value: i.e. from MatrixXi + template < + typename DerivedV, + typename DerivedF, + typename DerivedTV, + typename DerivedTT, + typename DerivedTF> + IGL_INLINE int tetrahedralize( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const std::string switches, + Eigen::PlainObjectBase& TV, + Eigen::PlainObjectBase& TT, + Eigen::PlainObjectBase& TF); + + // Mesh the interior of a surface mesh (V,F) using tetgen + // + // Inputs: + // V #V by 3 vertex position list + // F #F list of polygon face indices into V (0-indexed) + // M #V list of markers for vertices + // switches string of tetgen options (See tetgen documentation) e.g. + // "pq1.414a0.01" tries to mesh the interior of a given surface with + // quality and area constraints + // "" will mesh the convex hull constrained to pass through V (ignores F) + // Outputs: + // TV #V by 3 vertex position list + // TT #T by 4 list of tet face indices + // TF #F by 3 list of triangle face indices + // TM #V list of markers for vertices + // Returns status: + // 0 success + // 1 tetgen threw exception + // 2 tetgen did not crash but could not create any tets (probably there are + // holes, duplicate faces etc.) + // -1 other error + IGL_INLINE int tetrahedralize( + const std::vector > & V, + const std::vector > & F, + const std::vector & VM, + const std::vector & FM, + const std::string switches, + std::vector > & TV, + std::vector > & TT, + std::vector > & TF, + std::vector & TM); + // Wrapper with Eigen types + // Templates: + // DerivedV real-value: i.e. from MatrixXd + // DerivedF integer-value: i.e. from MatrixXi + template < + typename DerivedV, + typename DerivedF, + typename DerivedVM, + typename DerivedFM, + typename DerivedTV, + typename DerivedTT, + typename DerivedTF, + typename DerivedTM> + IGL_INLINE int tetrahedralize( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const Eigen::MatrixBase& VM, + const Eigen::MatrixBase& FM, + const std::string switches, + Eigen::PlainObjectBase& TV, + Eigen::PlainObjectBase& TT, + Eigen::PlainObjectBase& TF, + Eigen::PlainObjectBase& TM); + // Mesh the interior of a surface mesh (V,F) using tetgen + // + // Inputs: + // V #V by 3 vertex position list + // F #F list of polygon face indices into V (0-indexed) + // H #H by 3 list of seed points inside holes + // R #R by 5 list of region attributes + // switches string of tetgen options (See tetgen documentation) e.g. + // "pq1.414a0.01" tries to mesh the interior of a given surface with + // quality and area constraints + // "" will mesh the convex hull constrained to pass through V (ignores F) + // Outputs: + // TV #TV by 3 vertex position list + // TT #TT by 4 list of tet face indices + // TF #TF by 3 list of triangle face indices + // TR #TT list of region ID for each tetrahedron + // TN #TT by 4 list of indices neighbors for each tetrahedron + // PT #TV list of incident tetrahedron for a vertex + // FT #TF by 2 list of tetrahedrons sharing a triface + // numRegions Number of regions in output mesh + // Returns status: + // 0 success + // 1 tetgen threw exception + // 2 tetgen did not crash but could not create any tets (probably there are + // holes, duplicate faces etc.) + // -1 other error + IGL_INLINE int tetrahedralize( + const std::vector > &V, + const std::vector > &F, + const std::vector > &H, + const std::vector > &R, + const std::string switches, + std::vector > & TV, + std::vector > & TT, + std::vector > & TF, + std::vector > &TR, + std::vector > &TN, + std::vector > &PT, + std::vector > &FT, + size_t & numRegions); + // Wrapper with Eigen types + // Templates: + // DerivedV real-value: i.e. from MatrixXd + // DerivedF integer-value: i.e. from MatrixXi + template < + typename DerivedV, + typename DerivedF, + typename DerivedH, + typename DerivedR, + typename DerivedTV, + typename DerivedTT, + typename DerivedTF, + typename DerivedTR> + IGL_INLINE int tetrahedralize( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const Eigen::MatrixBase& H, + const Eigen::MatrixBase& R, + const std::string switches, + Eigen::PlainObjectBase& TV, + Eigen::PlainObjectBase& TT, + Eigen::PlainObjectBase& TF, + Eigen::PlainObjectBase& TR, + Eigen::PlainObjectBase& TN, + Eigen::PlainObjectBase& PT, + Eigen::PlainObjectBase& FT, + size_t & numRegions); + } + } +} + + +#ifndef IGL_STATIC_LIBRARY +# include "tetrahedralize.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/cross.cpp b/vendor/libigl/include/igl/cross.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7b049c9bc72dbfc11726b996e04ddddbc383a57a --- /dev/null +++ b/vendor/libigl/include/igl/cross.cpp @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "cross.h" + +// http://www.antisphere.com/Wiki/tools:anttweakbar +IGL_INLINE void igl::cross( + const double *a, + const double *b, + double *out) +{ + out[0] = a[1] * b[2] - a[2] * b[1]; + out[1] = a[2] * b[0] - a[0] * b[2]; + out[2] = a[0] * b[1] - a[1] * b[0]; +} + +template < + typename DerivedA, + typename DerivedB, + typename DerivedC> +IGL_INLINE void igl::cross( + const Eigen::PlainObjectBase &A, + const Eigen::PlainObjectBase &B, + Eigen::PlainObjectBase &C) +{ + assert(A.cols() == 3 && "#cols should be 3"); + assert(B.cols() == 3 && "#cols should be 3"); + assert(A.rows() == B.rows() && "#rows in A and B should be equal"); + C.resize(A.rows(), 3); + for (int d = 0; d < 3; d++) + { + C.col(d) = + A.col((d + 1) % 3).array() * B.col((d + 2) % 3).array() - + A.col((d + 2) % 3).array() * B.col((d + 1) % 3).array(); + } +} + +#ifdef IGL_STATIC_LIBRARY +template void igl::cross, Eigen::Matrix, Eigen::Matrix>(Eigen::PlainObjectBase> const &, Eigen::PlainObjectBase> const &, Eigen::PlainObjectBase> &); +template void igl::cross, Eigen::Matrix, Eigen::Matrix>(Eigen::PlainObjectBase> const &, Eigen::PlainObjectBase> const &, Eigen::PlainObjectBase> &); +template void igl::cross, Eigen::Matrix, Eigen::Matrix>(Eigen::PlainObjectBase> const &, Eigen::PlainObjectBase> const &, Eigen::PlainObjectBase> &); +template void igl::cross, Eigen::Matrix, Eigen::Matrix>(Eigen::PlainObjectBase> const &, Eigen::PlainObjectBase> const &, Eigen::PlainObjectBase> &); +#endif \ No newline at end of file diff --git a/vendor/libigl/include/igl/cross_field_mismatch.h b/vendor/libigl/include/igl/cross_field_mismatch.h new file mode 100644 index 0000000000000000000000000000000000000000..5f15e964171404461a1633651028163637d14246 --- /dev/null +++ b/vendor/libigl/include/igl/cross_field_mismatch.h @@ -0,0 +1,43 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo , Olga Diamanti +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_CROSS_FIELD_MISMATCH_H +#define IGL_CROSS_FIELD_MISMATCH_H +#include "igl_inline.h" +#include +namespace igl +{ + // Calculates the mismatch (integer), at each face edge, of a cross field defined on the mesh faces. + // The integer mismatch is a multiple of pi/2 that transforms the cross on one side of the edge to + // the cross on the other side. It represents the deviation from a Lie connection across the edge. + + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (quad) indices + // PD1 #F by 3 eigen Matrix of the first per face cross field vector + // PD2 #F by 3 eigen Matrix of the second per face cross field vector + // isCombed boolean, specifying whether the field is combed (i.e. matching has been precomputed. + // If not, the field is combed first. + // Output: + // mismatch #F by 3 eigen Matrix containing the integer mismatch of the cross field + // across all face edges + // + + template + IGL_INLINE void cross_field_mismatch(const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &PD1, + const Eigen::MatrixBase &PD2, + const bool isCombed, + Eigen::PlainObjectBase &mismatch); +} +#ifndef IGL_STATIC_LIBRARY +#include "cross_field_mismatch.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/cut_to_disk.cpp b/vendor/libigl/include/igl/cut_to_disk.cpp new file mode 100644 index 0000000000000000000000000000000000000000..39c3c37891ce38eec338b0dcee1146fbfe9d30bd --- /dev/null +++ b/vendor/libigl/include/igl/cut_to_disk.cpp @@ -0,0 +1,342 @@ +#include "cut_to_disk.h" + +#include +#include +#include +#include + +namespace igl { + template + void cut_to_disk( + const Eigen::MatrixBase &F, + std::vector > &cuts) + { + cuts.clear(); + + Index nfaces = F.rows(); + + if (nfaces == 0) + return; + + std::map, std::vector > edges; + // build edges + + for (Index i = 0; i < nfaces; i++) + { + for (int j = 0; j < 3; j++) + { + Index v0 = F(i, j); + Index v1 = F(i, (j + 1) % 3); + std::pair e; + e.first = std::min(v0, v1); + e.second = std::max(v0, v1); + edges[e].push_back(i); + } + } + + int nedges = edges.size(); + Eigen::Matrix edgeVerts(nedges,2); + Eigen::Matrix edgeFaces(nedges,2); + Eigen::Matrix faceEdges(nfaces, 3); + std::set boundaryEdges; + std::map, Index> edgeidx; + Index idx = 0; + for (auto it : edges) + { + edgeidx[it.first] = idx; + edgeVerts(idx, 0) = it.first.first; + edgeVerts(idx, 1) = it.first.second; + edgeFaces(idx, 0) = it.second[0]; + if (it.second.size() > 1) + { + edgeFaces(idx, 1) = it.second[1]; + } + else + { + edgeFaces(idx, 1) = -1; + boundaryEdges.insert(idx); + } + idx++; + } + for (Index i = 0; i < nfaces; i++) + { + for (int j = 0; j < 3; j++) + { + Index v0 = F(i, j); + Index v1 = F(i, (j + 1) % 3); + std::pair e; + e.first = std::min(v0, v1); + e.second = std::max(v0, v1); + faceEdges(i, j) = edgeidx[e]; + } + } + + bool *deleted = new bool[nfaces]; + for (Index i = 0; i < nfaces; i++) + deleted[i] = false; + + std::set deletededges; + + // loop over faces + for (Index face = 0; face < nfaces; face++) + { + // stop at first undeleted face + if (deleted[face]) + continue; + deleted[face] = true; + std::deque processEdges; + for (int i = 0; i < 3; i++) + { + Index e = faceEdges(face, i); + if (boundaryEdges.count(e)) + continue; + int ndeleted = 0; + if (deleted[edgeFaces(e, 0)]) + ndeleted++; + if (deleted[edgeFaces(e, 1)]) + ndeleted++; + if (ndeleted == 1) + processEdges.push_back(e); + } + // delete all faces adjacent to edges with exactly one adjacent face + while (!processEdges.empty()) + { + Index nexte = processEdges.front(); + processEdges.pop_front(); + Index todelete = nfaces; + if (!deleted[edgeFaces(nexte, 0)]) + todelete = edgeFaces(nexte, 0); + if (!deleted[edgeFaces(nexte, 1)]) + todelete = edgeFaces(nexte, 1); + if (todelete != nfaces) + { + deletededges.insert(nexte); + deleted[todelete] = true; + for (int i = 0; i < 3; i++) + { + Index e = faceEdges(todelete, i); + if (boundaryEdges.count(e)) + continue; + int ndeleted = 0; + if (deleted[edgeFaces(e, 0)]) + ndeleted++; + if (deleted[edgeFaces(e, 1)]) + ndeleted++; + if (ndeleted == 1) + processEdges.push_back(e); + } + } + } + } + delete[] deleted; + + // accumulated non-deleted edges + std::vector leftedges; + for (Index i = 0; i < nedges; i++) + { + if (!deletededges.count(i)) + leftedges.push_back(i); + } + + deletededges.clear(); + // prune spines + std::map > spinevertedges; + for (Index i : leftedges) + { + spinevertedges[edgeVerts(i, 0)].push_back(i); + spinevertedges[edgeVerts(i, 1)].push_back(i); + } + + std::deque vertsProcess; + std::map spinevertnbs; + for (auto it : spinevertedges) + { + spinevertnbs[it.first] = it.second.size(); + if (it.second.size() == 1) + vertsProcess.push_back(it.first); + } + while (!vertsProcess.empty()) + { + Index vert = vertsProcess.front(); + vertsProcess.pop_front(); + for (Index e : spinevertedges[vert]) + { + if (!deletededges.count(e)) + { + deletededges.insert(e); + for (int j = 0; j < 2; j++) + { + spinevertnbs[edgeVerts(e, j)]--; + if (spinevertnbs[edgeVerts(e, j)] == 1) + { + vertsProcess.push_back(edgeVerts(e, j)); + } + } + } + } + } + std::vector loopedges; + for (Index i : leftedges) + if (!deletededges.count(i)) + loopedges.push_back(i); + + Index nloopedges = loopedges.size(); + if (nloopedges == 0) + return; + + std::map > loopvertedges; + for (Index e : loopedges) + { + loopvertedges[edgeVerts(e, 0)].push_back(e); + loopvertedges[edgeVerts(e, 1)].push_back(e); + } + + std::set usededges; + for (Index e : loopedges) + { + // make a cycle or chain starting from this edge + while (!usededges.count(e)) + { + std::vector cycleverts; + std::vector cycleedges; + cycleverts.push_back(edgeVerts(e, 0)); + cycleverts.push_back(edgeVerts(e, 1)); + cycleedges.push_back(e); + + std::map cycleidx; + cycleidx[cycleverts[0]] = 0; + cycleidx[cycleverts[1]] = 1; + + Index curvert = edgeVerts(e, 1); + Index cure = e; + bool foundcycle = false; + while (curvert != -1 && !foundcycle) + { + Index nextvert = -1; + Index nexte = -1; + for (Index cande : loopvertedges[curvert]) + { + if (!usededges.count(cande) && cande != cure) + { + int vidx = 0; + if (curvert == edgeVerts(cande, vidx)) + vidx = 1; + nextvert = edgeVerts(cande, vidx); + nexte = cande; + break; + } + } + if (nextvert != -1) + { + auto it = cycleidx.find(nextvert); + if (it != cycleidx.end()) + { + // we've hit outselves + std::vector cut; + for (Index i = it->second; i < cycleverts.size(); i++) + { + cut.push_back(cycleverts[i]); + } + cut.push_back(nextvert); + cuts.push_back(cut); + for (Index i = it->second; i < cycleedges.size(); i++) + { + usededges.insert(cycleedges[i]); + } + usededges.insert(nexte); + foundcycle = true; + } + else + { + cycleidx[nextvert] = cycleverts.size(); + cycleverts.push_back(nextvert); + cycleedges.push_back(nexte); + } + } + curvert = nextvert; + cure = nexte; + } + if (!foundcycle) + { + // we've hit a dead end. reverse and try the other direction + std::reverse(cycleverts.begin(), cycleverts.end()); + std::reverse(cycleedges.begin(), cycleedges.end()); + cycleidx.clear(); + for (Index i = 0; i < cycleverts.size(); i++) + { + cycleidx[cycleverts[i]] = i; + } + + curvert = cycleverts.back(); + cure = cycleedges.back(); + while (curvert != -1 && !foundcycle) + { + Index nextvert = -1; + Index nexte = -1; + for (Index cande : loopvertedges[curvert]) + { + if (!usededges.count(cande) && cande != cure) + { + int vidx = 0; + if (curvert == edgeVerts(cande, vidx)) + vidx = 1; + nextvert = edgeVerts(cande, vidx); + nexte = cande; + break; + } + } + if (nextvert != -1) + { + auto it = cycleidx.find(nextvert); + if (it != cycleidx.end()) + { + // we've hit outselves + std::vector cut; + for (Index i = it->second; i < cycleverts.size(); i++) + { + cut.push_back(cycleverts[i]); + } + cut.push_back(nextvert); + cuts.push_back(cut); + for (Index i = it->second; i < cycleedges.size(); i++) + { + usededges.insert(cycleedges[i]); + } + usededges.insert(nexte); + foundcycle = true; + } + else + { + cycleidx[nextvert] = cycleverts.size(); + cycleverts.push_back(nextvert); + cycleedges.push_back(nexte); + } + } + curvert = nextvert; + cure = nexte; + } + if (!foundcycle) + { + // we've found a chain + std::vector cut; + for (Index i = 0; i < cycleverts.size(); i++) + { + cut.push_back(cycleverts[i]); + } + cuts.push_back(cut); + for (Index i = 0; i < cycleedges.size(); i++) + { + usededges.insert(cycleedges[i]); + } + } + } + } + } + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::cut_to_disk, int>(Eigen::MatrixBase > const&, std::vector >, std::allocator > > >&); + +#endif diff --git a/vendor/libigl/include/igl/deform_skeleton.cpp b/vendor/libigl/include/igl/deform_skeleton.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b9d120edd008b9976556dde7db50e5146f8e77d5 --- /dev/null +++ b/vendor/libigl/include/igl/deform_skeleton.cpp @@ -0,0 +1,58 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "deform_skeleton.h" +void igl::deform_skeleton( + const Eigen::MatrixXd & C, + const Eigen::MatrixXi & BE, + const std::vector< + Eigen::Affine3d,Eigen::aligned_allocator > & vA, + Eigen::MatrixXd & CT, + Eigen::MatrixXi & BET) +{ + using namespace Eigen; + assert(BE.rows() == (int)vA.size()); + CT.resize(2*BE.rows(),C.cols()); + BET.resize(BE.rows(),2); + for(int e = 0;e +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_DIAG_H +#define IGL_DIAG_H +#include "igl_inline.h" +#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET +#include + +namespace igl +{ + // http://forum.kde.org/viewtopic.php?f=74&t=117476&p=292388#p292388 + // + // This is superceded by + // VectorXd V = X.diagonal() and + // SparseVector V = X.diagonal().sparseView() + // SparseMatrix X = V.asDiagonal().sparseView() + // + // + // Either extracts the main diagonal of a matrix as a vector OR converts a + // vector into a matrix with vector along the main diagonal. Like matlab's + // diag function + + // Templates: + // T should be a eigen sparse matrix primitive type like int or double + // Inputs: + // X an m by n sparse matrix + // Outputs: + // V a min(m,n) sparse vector + template + IGL_INLINE void diag( + const Eigen::SparseMatrix& X, + Eigen::SparseVector& V); + template + IGL_INLINE void diag( + const Eigen::SparseMatrix& X, + Eigen::MatrixBase& V); + // Templates: + // T should be a eigen sparse matrix primitive type like int or double + // Inputs: + // V a m sparse vector + // Outputs: + // X a m by m sparse matrix + template + IGL_INLINE void diag( + const Eigen::SparseVector& V, + Eigen::SparseMatrix& X); + template + IGL_INLINE void diag( + const Eigen::MatrixBase& V, + Eigen::SparseMatrix& X); +} + +#ifndef IGL_STATIC_LIBRARY +# include "diag.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/direct_delta_mush.h b/vendor/libigl/include/igl/direct_delta_mush.h new file mode 100644 index 0000000000000000000000000000000000000000..53cc35de6f5e38cae268c78ac9ac62ff85a53bf1 --- /dev/null +++ b/vendor/libigl/include/igl/direct_delta_mush.h @@ -0,0 +1,72 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Xiangyu Kong +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_DIRECT_DELTA_MUSH_H +#define IGL_DIRECT_DELTA_MUSH_H + +#include "igl_inline.h" + +#include +#include +#include +#include + +namespace igl { + // Computes Direct Delta Mesh Skinning (Variant 0) from "Direct Delta Mush + // Skinning and Variants" + // + // Inputs: + // V #V by 3 list of rest pose vertex positions + // T #T list of bone pose transformations + // Omega #V by #T*10 list of precomputated matrix values + // Outputs: + // U #V by 3 list of output vertex positions + template < + typename DerivedV, + typename DerivedOmega, + typename DerivedU> + IGL_INLINE void direct_delta_mush( + const Eigen::MatrixBase & V, + const std::vector< + Eigen::Affine3d, Eigen::aligned_allocator + > & T, /* should eventually be templated more generally than double */ + const Eigen::MatrixBase & Omega, + Eigen::PlainObjectBase & U); + + // Precomputation + // + // Inputs: + // V #V by 3 list of rest pose vertex positions + // F #F by 3 list of triangle indices into rows of V + // W #V by #Edges list of weights + // p number of smoothing iterations + // lambda rotation smoothing step size + // kappa translation smoothness step size + // alpha translation smoothness blending weight + // Outputs: + // Omega #V by #T*10 list of precomputated matrix values + template < + typename DerivedV, + typename DerivedF, + typename DerivedW, + typename DerivedOmega> + IGL_INLINE void direct_delta_mush_precomputation( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & W, + const int p, + const typename DerivedV::Scalar lambda, + const typename DerivedV::Scalar kappa, + const typename DerivedV::Scalar alpha, + Eigen::PlainObjectBase & Omega); +} // namespace igl + +#ifndef IGL_STATIC_LIBRARY +# include "direct_delta_mush.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/dot_row.h b/vendor/libigl/include/igl/dot_row.h new file mode 100644 index 0000000000000000000000000000000000000000..83d91aada11e044933bd4f9902977f622b391bf5 --- /dev/null +++ b/vendor/libigl/include/igl/dot_row.h @@ -0,0 +1,36 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_DOT_ROW_H +#define IGL_DOT_ROW_H + +#include "igl/igl_inline.h" +#include + +namespace igl +{ + // Compute the dot product between each row of A and B + // Templates: + // DerivedV derived from vertex positions matrix type: i.e. MatrixXd + // Inputs: + // A eigen matrix r by c + // B eigen matrix r by c + // Returns: + // d a column vector with r entries that contains the dot product of each corresponding row of A and B + // + template + IGL_INLINE DerivedV dot_row( + const Eigen::PlainObjectBase& A, + const Eigen::PlainObjectBase& B); + +} + +#ifndef IGL_STATIC_LIBRARY +# include "dot_row.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/edge_flaps.h b/vendor/libigl/include/igl/edge_flaps.h new file mode 100644 index 0000000000000000000000000000000000000000..79870f0536e1e9fcfb89bb024030b28a31b1f09d --- /dev/null +++ b/vendor/libigl/include/igl/edge_flaps.h @@ -0,0 +1,56 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EDGE_FLAPS_H +#define IGL_EDGE_FLAPS_H +#include "igl_inline.h" +#include +namespace igl +{ + // Determine "edge flaps": two faces on either side of a unique edge (assumes + // edge-manifold mesh) + // + // Inputs: + // F #F by 3 list of face indices + // uE #uE by 2 list of edge indices into V. + // EMAP #F*3 list of indices into uE, mapping each directed edge to unique + // unique edge in uE + // Outputs: + // EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of + // F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " + // e=(j->i) + // EI #E by 2 list of edge flap corners (see above). + // + // See also: unique_edge_map + // + // TODO: This seems to be a duplicate of edge_topology.h + // igl::edge_topology(V,F,etEV,etFE,etEF); + // igl::edge_flaps(F,efE,efEMAP,efEF,efEI); + // [~,I] = sort(efE,2) + // all( efE(sub2ind(size(efE),repmat(1:size(efE,1),2,1)',I)) == etEV ) + // all( efEF(sub2ind(size(efE),repmat(1:size(efE,1),2,1)',I)) == etEF ) + // all(efEMAP(sub2ind(size(F),repmat(1:size(F,1),3,1)',repmat([1 2 3],size(F,1),1))) == etFE(:,[2 3 1])) + IGL_INLINE void edge_flaps( + const Eigen::MatrixXi & F, + const Eigen::MatrixXi & uE, + const Eigen::VectorXi & EMAP, + Eigen::MatrixXi & EF, + Eigen::MatrixXi & EI); + // Only faces as input + IGL_INLINE void edge_flaps( + const Eigen::MatrixXi & F, + Eigen::MatrixXi & uE, + Eigen::VectorXi & EMAP, + Eigen::MatrixXi & EF, + Eigen::MatrixXi & EI); +} +#ifndef IGL_STATIC_LIBRARY +# include "edge_flaps.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/edge_midpoints.cpp b/vendor/libigl/include/igl/edge_midpoints.cpp new file mode 100644 index 0000000000000000000000000000000000000000..32d89421f8fd593f0e90d8be1dfbc5fcf8f65dba --- /dev/null +++ b/vendor/libigl/include/igl/edge_midpoints.cpp @@ -0,0 +1,48 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Oded Stein +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "edge_midpoints.h" + +template +IGL_INLINE void +igl::edge_midpoints( + const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &E, + const Eigen::MatrixBase &oE, + Eigen::PlainObjectBase &mps) +{ + assert(E.rows()==F.rows() && "E does not match dimensions of F."); + assert(oE.rows()==F.rows() && "oE does not match dimensions of F."); + assert(E.cols()==3 && F.cols()==3 && oE.cols()==3 && + "This method is for triangle meshes."); + assert(F.maxCoeff(), Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/edge_vectors.h b/vendor/libigl/include/igl/edge_vectors.h new file mode 100644 index 0000000000000000000000000000000000000000..7d0a2121d090b8e7a27f35d401e3e02fae99d3cd --- /dev/null +++ b/vendor/libigl/include/igl/edge_vectors.h @@ -0,0 +1,68 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Oded Stein +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EDGE_VECTORS_H +#define IGL_EDGE_VECTORS_H +#include "igl_inline.h" + +#include +namespace igl +{ +// Computes the normalized edge vectors for edges in a triangle mesh +// +// Input: +// V, F: triangle mesh +// E, oE: mapping from halfedges to edges and orientation as generated by +// orient_halfedges +// +// Output: +// vec: normalized edge vectors for each unique edge in E, according to order +// of E. +template +IGL_INLINE void edge_vectors( + const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &E, + const Eigen::MatrixBase &oE, + Eigen::PlainObjectBase &vec); + + +// Computes the normalized edge vectors for edges in a triangle mesh +// +// Input: +// V, F: triangle mesh +// E, oE: mapping from halfedges to edges and orientation as generated by +// orient_halfedges +// template parameter computePerpendicular: whether to compute +// vecPerpendicular or not. +// +// Output: +// vecParallel: normalized edge vectors for each unique edge in E, according +// to order of E. +// vecPerpendicular: tangent unit perpendicular vector to each edge, according +// to orientation in oE, corresponds to each vector in +// vecParallel rotated by pi/2 around an edge-based normal. +// +template +IGL_INLINE void edge_vectors( + const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &E, + const Eigen::MatrixBase &oE, + Eigen::PlainObjectBase &vecParallel, + Eigen::PlainObjectBase &vecPerpendicular); +} + +#ifndef IGL_STATIC_LIBRARY +# include "edge_vectors.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/embree/EmbreeDevice.h b/vendor/libigl/include/igl/embree/EmbreeDevice.h new file mode 100644 index 0000000000000000000000000000000000000000..7267626a852945b579bd16076de9e9d76c526beb --- /dev/null +++ b/vendor/libigl/include/igl/embree/EmbreeDevice.h @@ -0,0 +1,86 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Vladimir Fonov +// 2013 Alec Jacobson +// 2014 Christian Schüller +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// + +#ifndef IGL_EMBREE_EMBREE_DEVICE_H +#define IGL_EMBREE_EMBREE_DEVICE_H +#include +#include + +namespace igl +{ + namespace embree + { + // keep track of embree device + struct EmbreeDevice + { + RTCDevice embree_device; + int embree_device_cntr; + + static EmbreeDevice & instance() + { + static EmbreeDevice s; + return s; + } // instance + + EmbreeDevice(const EmbreeDevice &) = delete; + EmbreeDevice & operator = (const EmbreeDevice &) = delete; + + static RTCDevice get_device(const char *config=nullptr) + { + return instance().get(config); + } + + static void release_device(void) + { + instance().release(); + } + + private: + + EmbreeDevice():embree_device(nullptr),embree_device_cntr(0) {} + + ~EmbreeDevice() + { + if(embree_device) + rtcReleaseDevice(embree_device); + } + + RTCDevice get(const char *config=nullptr) + { + if(!embree_device) + { + embree_device = rtcNewDevice (config); + if(rtcGetDeviceError (embree_device) != RTC_ERROR_NONE) + std::cerr << "Embree: An error occurred while initializing embree core!" << std::endl; + #ifdef IGL_VERBOSE + else + std::cerr << "Embree: core initialized." << std::endl; + #endif + } + ++embree_device_cntr; + return embree_device; + } + + void release() + { + if(!--embree_device_cntr) { + rtcReleaseDevice (embree_device); + embree_device = nullptr; + #ifdef IGL_VERBOSE + std::cerr << "Embree: core released." << std::endl; + #endif + } + } + }; + } +} + +#endif // IGL_EMBREE_EMBREE_DEVICE_H \ No newline at end of file diff --git a/vendor/libigl/include/igl/embree/EmbreeIntersector.cpp b/vendor/libigl/include/igl/embree/EmbreeIntersector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0bf8c949283adba758ec0f73753e7f9ab9b31e10 --- /dev/null +++ b/vendor/libigl/include/igl/embree/EmbreeIntersector.cpp @@ -0,0 +1,396 @@ + +#include "EmbreeIntersector.h" + +// Implementation +#include + +IGL_INLINE igl::embree::EmbreeIntersector::EmbreeIntersector() + : + //scene(NULL), + geomID(0), + vertices(NULL), + triangles(NULL), + initialized(false), + device(igl::embree::EmbreeDevice::get_device()) +{ +} + +IGL_INLINE igl::embree::EmbreeIntersector::EmbreeIntersector( + const EmbreeIntersector &) + :// To make -Weffc++ happy + //scene(NULL), + geomID(0), + vertices(NULL), + triangles(NULL), + initialized(false) +{ + assert(false && "Embree: Copying EmbreeIntersector is not allowed"); +} + +IGL_INLINE igl::embree::EmbreeIntersector & igl::embree::EmbreeIntersector::operator=( + const EmbreeIntersector &) +{ + assert(false && "Embree: Assigning an EmbreeIntersector is not allowed"); + return *this; +} + + +IGL_INLINE void igl::embree::EmbreeIntersector::init( + const PointMatrixType& V, + const FaceMatrixType& F, + bool isStatic) +{ + std::vector Vtemp; + std::vector Ftemp; + std::vector masks; + Vtemp.push_back(&V); + Ftemp.push_back(&F); + masks.push_back(0xFFFFFFFF); + init(Vtemp,Ftemp,masks,isStatic); +} + +IGL_INLINE void igl::embree::EmbreeIntersector::init( + const std::vector& V, + const std::vector& F, + const std::vector& masks, + bool isStatic) +{ + + if(initialized) + deinit(); + + using namespace std; + + if(V.size() == 0 || F.size() == 0) + { + std::cerr << "Embree: No geometry specified!"; + return; + } + + RTCBuildQuality buildQuality = isStatic ? RTC_BUILD_QUALITY_HIGH : RTC_BUILD_QUALITY_MEDIUM; + + // create a scene + scene = rtcNewScene(device); + rtcSetSceneFlags(scene, RTC_SCENE_FLAG_ROBUST); + rtcSetSceneBuildQuality(scene, buildQuality); + + for(int g=0;g<(int)V.size();g++) + { + // create triangle mesh geometry in that scene + RTCGeometry geom_0 = rtcNewGeometry (device, RTC_GEOMETRY_TYPE_TRIANGLE); + rtcSetGeometryBuildQuality(geom_0,buildQuality); + rtcSetGeometryTimeStepCount(geom_0,1); + geomID = rtcAttachGeometry(scene,geom_0); + rtcReleaseGeometry(geom_0); + + // fill vertex buffer + vertices = (Vertex*)rtcSetNewGeometryBuffer(geom_0,RTC_BUFFER_TYPE_VERTEX,0,RTC_FORMAT_FLOAT3,4*sizeof(float),V[g]->rows()); + for(int i=0;i<(int)V[g]->rows();i++) + { + vertices[i].x = (float)V[g]->coeff(i,0); + vertices[i].y = (float)V[g]->coeff(i,1); + vertices[i].z = (float)V[g]->coeff(i,2); + } + + + // fill triangle buffer + triangles = (Triangle*) rtcSetNewGeometryBuffer(geom_0,RTC_BUFFER_TYPE_INDEX,0,RTC_FORMAT_UINT3,3*sizeof(int),F[g]->rows()); + for(int i=0;i<(int)F[g]->rows();i++) + { + triangles[i].v0 = (int)F[g]->coeff(i,0); + triangles[i].v1 = (int)F[g]->coeff(i,1); + triangles[i].v2 = (int)F[g]->coeff(i,2); + } + + + rtcSetGeometryMask(geom_0,masks[g]); + rtcCommitGeometry(geom_0); + } + + rtcCommitScene(scene); + + if(rtcGetDeviceError (device) != RTC_ERROR_NONE) + std::cerr << "Embree: An error occurred while initializing the provided geometry!" << endl; +#ifdef IGL_VERBOSE + else + std::cerr << "Embree: geometry added." << endl; +#endif + + initialized = true; +} + +IGL_INLINE igl::embree::EmbreeIntersector +::~EmbreeIntersector() +{ + if(initialized) + deinit(); + igl::embree::EmbreeDevice::release_device(); +} + +IGL_INLINE void igl::embree::EmbreeIntersector::deinit() +{ + if(device && scene) + { + rtcReleaseScene(scene); + + if(rtcGetDeviceError (device) != RTC_ERROR_NONE) + { + std::cerr << "Embree: An error occurred while resetting!" << std::endl; + } +#ifdef IGL_VERBOSE + else + { + std::cerr << "Embree: geometry removed." << std::endl; + } +#endif + } +} + +IGL_INLINE bool igl::embree::EmbreeIntersector::intersectRay( + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + Hit& hit, + float tnear, + float tfar, + int mask) const +{ + RTCRayHit ray; // EMBREE_FIXME: use RTCRay for occlusion rays + ray.ray.flags = 0; + createRay(ray, origin,direction,tnear,tfar,mask); + + // shot ray + { + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcIntersect1(scene,&context,&ray); + ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces + ray.hit.Ng_y = -ray.hit.Ng_y; + ray.hit.Ng_z = -ray.hit.Ng_z; + } +#ifdef IGL_VERBOSE + if(rtcGetDeviceError (device) != RTC_ERROR_NONE) + std::cerr << "Embree: An error occurred while resetting!" << std::endl; +#endif + + if((unsigned)ray.hit.geomID != RTC_INVALID_GEOMETRY_ID) + { + hit.id = ray.hit.primID; + hit.gid = ray.hit.geomID; + hit.u = ray.hit.u; + hit.v = ray.hit.v; + hit.t = ray.ray.tfar; + return true; + } + + return false; +} + +IGL_INLINE bool igl::embree::EmbreeIntersector::intersectBeam( + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + Hit& hit, + float tnear, + float tfar, + int mask, + int geoId, + bool closestHit, + unsigned int samples) const +{ + bool hasHit = false; + Hit bestHit; + + if(closestHit) + bestHit.t = std::numeric_limits::max(); + else + bestHit.t = 0; + + if((intersectRay(origin,direction,hit,tnear,tfar,mask) && (hit.gid == geoId || geoId == -1))) + { + bestHit = hit; + hasHit = true; + } + + // sample points around actual ray (conservative hitcheck) + const float eps= 1e-5; + + Eigen::RowVector3f up(0,1,0); + if (direction.cross(up).norm() < eps) up = Eigen::RowVector3f(1,0,0); + Eigen::RowVector3f offset = direction.cross(up).normalized(); + + Eigen::Matrix3f rot = Eigen::AngleAxis(2*3.14159265358979/samples,direction).toRotationMatrix(); + + for(int r=0;r<(int)samples;r++) + { + if(intersectRay(origin+offset*eps,direction,hit,tnear,tfar,mask) && + ((closestHit && (hit.t < bestHit.t)) || + (!closestHit && (hit.t > bestHit.t))) && + (hit.gid == geoId || geoId == -1)) + { + bestHit = hit; + hasHit = true; + } + offset = rot*offset.transpose(); + } + + hit = bestHit; + return hasHit; +} + +IGL_INLINE bool +igl::embree::EmbreeIntersector +::intersectRay( + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + std::vector &hits, + int& num_rays, + float tnear, + float tfar, + int mask) const +{ + using namespace std; + num_rays = 0; + hits.clear(); + int last_id0 = -1; + double self_hits = 0; + // This epsilon is directly correleated to the number of missed hits, smaller + // means more accurate and slower + //const double eps = DOUBLE_EPS; + const double eps = FLOAT_EPS; + double min_t = tnear; + bool large_hits_warned = false; + RTCRayHit ray; // EMBREE_FIXME: use RTCRay for occlusion rays + ray.ray.flags = 0; + createRay(ray,origin,direction,tnear,tfar,mask); + + while(true) + { + ray.ray.tnear = min_t; + ray.ray.tfar = tfar; + ray.hit.geomID = RTC_INVALID_GEOMETRY_ID; + ray.hit.primID = RTC_INVALID_GEOMETRY_ID; + ray.hit.instID[0] = RTC_INVALID_GEOMETRY_ID; + num_rays++; + { + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcIntersect1(scene,&context,&ray); + ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces + ray.hit.Ng_y = -ray.hit.Ng_y; + ray.hit.Ng_z = -ray.hit.Ng_z; + } + if((unsigned)ray.hit.geomID != RTC_INVALID_GEOMETRY_ID) + { + // Hit self again, progressively advance + if(ray.hit.primID == last_id0 || ray.ray.tfar <= min_t) + { + // push min_t a bit more + //double t_push = pow(2.0,self_hits-4)*(hit.t1000 && !large_hits_warned) + { + std::cout<<"Warning: Large number of hits..."<::iterator hit = hits.begin(); hit != hits.end();hit++) + { + std::cout<<(hit->id+1)<<" "; + } + + std::cout.precision(std::numeric_limits< double >::digits10); + std::cout<<"[ "; + + for(vector::iterator hit = hits.begin(); hit != hits.end(); hit++) + { + std::cout<<(hit->t)< +// 2014 Christian Schüller +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// igl function interface for Embree2.2 +// +// Necessary changes to switch from previous Embree versions: +// * Use igl:Hit instead of embree:Hit (where id0 -> id) +// * For Embree2.2 +// * Uncomment #define __USE_RAY_MASK__ in platform.h to enable masking + +#ifndef IGL_EMBREE_EMBREE_INTERSECTOR_H +#define IGL_EMBREE_EMBREE_INTERSECTOR_H + +#include "../Hit.h" +#include +#include + +#include +#include +#include +#include + +#include "EmbreeDevice.h" + +namespace igl +{ + namespace embree + { + class EmbreeIntersector + { + public: + typedef Eigen::Matrix PointMatrixType; + typedef Eigen::Matrix FaceMatrixType; + public: + EmbreeIntersector(); + private: + // Copying and assignment are not allowed. + EmbreeIntersector(const EmbreeIntersector & that); + EmbreeIntersector & operator=(const EmbreeIntersector &); + public: + virtual ~EmbreeIntersector(); + + // Initialize with a given mesh. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of Oriented triangles + // isStatic scene is optimized for static geometry + // Side effects: + // The first time this is ever called the embree engine is initialized. + void init( + const PointMatrixType& V, + const FaceMatrixType& F, + bool isStatic = false); + + // Initialize with a given mesh. + // + // Inputs: + // V vector of #V by 3 list of vertex positions for each geometry + // F vector of #F by 3 list of Oriented triangles for each geometry + // masks a 32 bit mask to identify active geometries. + // isStatic scene is optimized for static geometry + // Side effects: + // The first time this is ever called the embree engine is initialized. + void init( + const std::vector& V, + const std::vector& F, + const std::vector& masks, + bool isStatic = false); + + // Deinitialize embree datasctructures for current mesh. Also called on + // destruction: no need to call if you just want to init() once and + // destroy. + void deinit(); + + // Given a ray find the first hit + // + // Inputs: + // origin 3d origin point of ray + // direction 3d (not necessarily normalized) direction vector of ray + // tnear start of ray segment + // tfar end of ray segment + // masks a 32 bit mask to identify active geometries. + // Output: + // hit information about hit + // Returns true if and only if there was a hit + bool intersectRay( + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + Hit& hit, + float tnear = 0, + float tfar = std::numeric_limits::infinity(), + int mask = 0xFFFFFFFF) const; + + // Given a ray find the first hit + // This is a conservative hit test where multiple rays within a small radius + // will be tested and only the closesest hit is returned. + // + // Inputs: + // origin 3d origin point of ray + // direction 3d (not necessarily normalized) direction vector of ray + // tnear start of ray segment + // tfar end of ray segment + // masks a 32 bit mask to identify active geometries. + // geoId id of geometry mask (default std::numeric_limits::infinity() if no: no masking) + // closestHit true for gets closest hit, false for furthest hit + // Output: + // hit information about hit + // Returns true if and only if there was a hit + bool intersectBeam( + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + Hit& hit, + float tnear = 0, + float tfar = std::numeric_limits::infinity(), + int mask = 0xFFFFFFFF, + int geoId = -1, + bool closestHit = true, + unsigned int samples = 4) const; + + // Given a ray find all hits in order + // + // Inputs: + // origin 3d origin point of ray + // direction 3d (not necessarily normalized) direction vector of ray + // tnear start of ray segment + // tfar end of ray segment + // masks a 32 bit mask to identify active geometries. + // Output: + // hit information about hit + // num_rays number of rays shot (at least one) + // Returns true if and only if there was a hit + bool intersectRay( + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + std::vector &hits, + int& num_rays, + float tnear = 0, + float tfar = std::numeric_limits::infinity(), + int mask = 0xFFFFFFFF) const; + + // Given a ray find the first hit + // + // Inputs: + // a 3d first end point of segment + // ab 3d vector from a to other endpoint b + // Output: + // hit information about hit + // Returns true if and only if there was a hit + bool intersectSegment( + const Eigen::RowVector3f& a, + const Eigen::RowVector3f& ab, + Hit &hit, + int mask = 0xFFFFFFFF) const; + + private: + + struct Vertex {float x,y,z,a;}; + struct Triangle {int v0, v1, v2;}; + + RTCScene scene; + unsigned geomID; + Vertex* vertices; + Triangle* triangles; + bool initialized; + + RTCDevice device; + + void createRay( + RTCRayHit& ray, + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + float tnear, + float tfar, + int mask) const; + }; + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "EmbreeIntersector.cpp" +#endif + +#endif //EMBREE_INTERSECTOR_H diff --git a/vendor/libigl/include/igl/embree/EmbreeRenderer.cpp b/vendor/libigl/include/igl/embree/EmbreeRenderer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7c0f7eda15a3b7ade0b55528f1abcc3cca823312 --- /dev/null +++ b/vendor/libigl/include/igl/embree/EmbreeRenderer.cpp @@ -0,0 +1,449 @@ +#include "EmbreeRenderer.h" +// Implementation + +//IGL viewing parts +#include "../unproject.h" +#include "../look_at.h" +#include "../frustum.h" +#include "../ortho.h" + +// color map +#include "../jet.h" + +#include "../PI.h" + + +IGL_INLINE void igl::embree::EmbreeRenderer::init_view() +{ + camera_base_zoom = 1.0f; + camera_zoom = 1.0f; + + camera_view_angle = 45.0; + camera_dnear = 1.0; + camera_dfar = 100.0; + camera_base_translation << 0, 0, 0; + camera_translation << 0, 0, 0; + camera_eye << 0, 0, 5; + camera_center << 0, 0, 0; + camera_up << 0, 1, 0; + + rot_matrix = Eigen::Matrix3f::Identity(); + + view = Eigen::Matrix4f::Identity(); + proj = Eigen::Matrix4f::Identity(); + norm = Eigen::Matrix4f::Identity(); + + orthographic = false; + + +} + +IGL_INLINE igl::embree::EmbreeRenderer::EmbreeRenderer() + : + scene(NULL), + geomID(0), + initialized(false), + device(igl::embree::EmbreeDevice::get_device()) +{ + init_view(); + uC << 1,0,0; + double_sided = false; +} + +IGL_INLINE igl::embree::EmbreeRenderer::EmbreeRenderer( + const EmbreeRenderer &) + :// To make -Weffc++ happy + scene(NULL), + geomID(0), + initialized(false) +{ + assert(false && "Embree: Copying EmbreeRenderer is not allowed"); +} + +IGL_INLINE igl::embree::EmbreeRenderer & igl::embree::EmbreeRenderer::operator=( + const EmbreeRenderer &) +{ + assert(false && "Embree: Assigning an EmbreeRenderer is not allowed"); + return *this; +} + + +IGL_INLINE void igl::embree::EmbreeRenderer::init( + const PointMatrixType& V, + const FaceMatrixType& F, + bool isStatic) +{ + std::vector Vtemp; + std::vector Ftemp; + std::vector masks; + Vtemp.push_back(&V); + Ftemp.push_back(&F); + masks.push_back(0xFFFFFFFF); + init(Vtemp,Ftemp,masks,isStatic); +} + +IGL_INLINE void igl::embree::EmbreeRenderer::init( + const std::vector& V, + const std::vector& F, + const std::vector& masks, + bool isStatic) +{ + if(initialized) + deinit(); + + using namespace std; + + if(V.size() == 0 || F.size() == 0) + { + std::cerr << "Embree: No geometry specified!"; + return; + } + RTCBuildQuality buildQuality = isStatic ? RTC_BUILD_QUALITY_HIGH : RTC_BUILD_QUALITY_MEDIUM; + + // create a scene + scene = rtcNewScene(device); + rtcSetSceneFlags(scene, RTC_SCENE_FLAG_ROBUST); + rtcSetSceneBuildQuality(scene, buildQuality); + + for(int g=0;g<(int)V.size();g++) + { + // create triangle mesh geometry in that scene + RTCGeometry geom_0 = rtcNewGeometry (device, RTC_GEOMETRY_TYPE_TRIANGLE); + rtcSetGeometryBuildQuality(geom_0, buildQuality); + rtcSetGeometryTimeStepCount(geom_0,1); + geomID = rtcAttachGeometry(scene,geom_0); + rtcReleaseGeometry(geom_0); + + // fill vertex buffer, have to be 16 byte wide( sizeof(float)*4 ) + Eigen::Map> vertices( + (float*)rtcSetNewGeometryBuffer(geom_0,RTC_BUFFER_TYPE_VERTEX,0,RTC_FORMAT_FLOAT3,4*sizeof(float),V[g]->rows()), + V[g]->rows(),4 + ); + vertices.block(0,0,V[g]->rows(),3) = V[g]->cast(); + + // fill triangle buffer + Eigen::Map> triangles( + (unsigned int*) rtcSetNewGeometryBuffer(geom_0,RTC_BUFFER_TYPE_INDEX,0,RTC_FORMAT_UINT3,3*sizeof(unsigned int), F[g]->rows()), + F[g]->rows(),3 + ); + triangles = F[g]->cast(); + //TODO: store vertices and triangles in array for whatever reason? + + rtcSetGeometryMask(geom_0, masks[g]); + rtcCommitGeometry(geom_0); + } + + rtcCommitScene(scene); + + if(rtcGetDeviceError (device) != RTC_ERROR_NONE) + std::cerr << "Embree: An error occurred while initializing the provided geometry!" << endl; +#ifdef IGL_VERBOSE + else + std::cerr << "Embree: geometry added." << endl; +#endif + + initialized = true; +} + +IGL_INLINE igl::embree::EmbreeRenderer::~EmbreeRenderer() +{ + if(initialized) + deinit(); + + igl::embree::EmbreeDevice::release_device(); +} + +IGL_INLINE void igl::embree::EmbreeRenderer::deinit() +{ + if(scene) + { + rtcReleaseScene(scene); + + if(rtcGetDeviceError (device) != RTC_ERROR_NONE) + { + std::cerr << "Embree: An error occurred while resetting!" << std::endl; + } +#ifdef IGL_VERBOSE + else + { + std::cerr << "Embree: geometry removed." << std::endl; + } +#endif + } +} + +IGL_INLINE bool igl::embree::EmbreeRenderer::intersect_ray( + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + Hit& hit, + float tnear, + float tfar, + int mask) const +{ + RTCRayHit ray; + ray.ray.flags = 0; + create_ray(ray, origin,direction,tnear,tfar,mask); + + // shot ray + { + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcIntersect1(scene, &context, &ray); + ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces + ray.hit.Ng_y = -ray.hit.Ng_y; + ray.hit.Ng_z = -ray.hit.Ng_z; + } +#ifdef IGL_VERBOSE + if(rtcGetDeviceError (device) != RTC_ERROR_NONE) + std::cerr << "Embree: An error occurred while resetting!" << std::endl; +#endif + + if((unsigned)ray.hit.geomID != RTC_INVALID_GEOMETRY_ID) + { + hit.id = ray.hit.primID; + hit.gid = ray.hit.geomID; + hit.u = ray.hit.u; + hit.v = ray.hit.v; + hit.t = ray.ray.tfar; + hit.N = Vec3f(ray.hit.Ng_x, ray.hit.Ng_y, ray.hit.Ng_z); + return true; + } + + return false; +} + +IGL_INLINE void +igl::embree::EmbreeRenderer +::create_ray(RTCRayHit& ray, const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, float tnear, float tfar, int mask) const +{ + ray.ray.org_x = origin[0]; + ray.ray.org_y = origin[1]; + ray.ray.org_z = origin[2]; + ray.ray.dir_x = direction[0]; + ray.ray.dir_y = direction[1]; + ray.ray.dir_z = direction[2]; + ray.ray.tnear = tnear; + ray.ray.tfar = tfar; + ray.ray.id = RTC_INVALID_GEOMETRY_ID; + ray.ray.mask = mask; + ray.ray.time = 0.0f; + + ray.hit.geomID = RTC_INVALID_GEOMETRY_ID; + ray.hit.instID[0] = RTC_INVALID_GEOMETRY_ID; + ray.hit.primID = RTC_INVALID_GEOMETRY_ID; +} + + +template +IGL_INLINE void +igl::embree::EmbreeRenderer +::set_mesh(const Eigen::MatrixBase & MV, + const Eigen::MatrixBase & MF, + bool is_static) +{ + V = MV.template cast(); + F = MF; + this->init(V,F,is_static); + + auto min_point = V.colwise().minCoeff(); + auto max_point = V.colwise().maxCoeff(); + auto centroid = (0.5*(min_point + max_point)).eval(); + + camera_base_translation.setConstant(0); + camera_base_translation.head(centroid.size()) = -centroid.cast(); + camera_base_zoom = 2.0 / (max_point-min_point).array().abs().maxCoeff(); +} + +IGL_INLINE void +igl::embree::EmbreeRenderer +::render_buffer(PixelMatrixType& R, PixelMatrixType&G, PixelMatrixType &B,PixelMatrixType &A) +{ + assert(R.rows()==G.rows());assert(R.rows()==B.rows());assert(R.rows()==A.rows()); + assert(R.cols()==G.cols());assert(R.cols()==B.cols());assert(R.cols()==A.cols()); + + Eigen::Vector4f viewport(0,0,R.rows(),R.cols()); + + float width = R.rows(); + float height = R.cols(); + + // update view matrix + igl::look_at( camera_eye, camera_center, camera_up, view); + + view = view + * (rot_matrix * Eigen::Scaling(camera_zoom * camera_base_zoom) + * Eigen::Translation3f(camera_translation + camera_base_translation)).matrix(); + + if (orthographic) + { + float length = (camera_eye - camera_center).norm(); + float h = tan(camera_view_angle/360.0 * igl::PI) * (length); + igl::ortho(-h*width/height, h*width/height, -h, h, camera_dnear, camera_dfar, proj); + } else { + float fH = tan(camera_view_angle / 360.0 * igl::PI) * camera_dnear; + float fW = fH * (double)width/(double)height; + igl::frustum(-fW, fW, -fH, fH, camera_dnear, camera_dfar, proj); + } + + // go over all pixels in the "view" + for(int x=0;x<(int)width;++x) + { + for(int y=0;y<(int)height;++y) + { + Vec3f s,d,dir; + igl::embree::EmbreeRenderer::Hit hit; + + // look into the screen + Vec3f win_s(x,y,0); + Vec3f win_d(x,y,1); + // Source, destination and direction in world + igl::unproject(win_s,this->view,this->proj,viewport,s); + igl::unproject(win_d,this->view,this->proj,viewport,d); + dir = d-s; + dir.normalize(); + + auto clamp=[](float x)->unsigned char {return (unsigned char)(x<0?0:x>1.0?255:x*255);}; + + if(this->intersect_ray(s,dir,hit)) + { + if ( double_sided || dir.dot(hit.N) > 0.0f ) + { + // TODO: interpolate normals ? + hit.N.normalize(); + + // cos between ray and face normal + // negative projection will indicate back side + float face_proj = fabs(dir.dot(hit.N)); + + Eigen::RowVector3f c; + + if(this->uniform_color) + { + // same color for the whole mesh + c=this->uC; + } else if(this->face_based) { + // flat color per face + c=this->C.row(hit.id); + } else { //use barycentric coordinates to interpolate colour + c=this->C.row(F(hit.id,1))*hit.u+ + this->C.row(F(hit.id,2))*hit.v+ + this->C.row(F(hit.id,0))*(1.0-hit.u-hit.v); + } + + R(x,y) = clamp(face_proj*c(0)); + G(x,y) = clamp(face_proj*c(1)); + B(x,y) = clamp(face_proj*c(2)); + } else { + // backface? + R(x,y)=0; + G(x,y)=0; + B(x,y)=0; + } + // give the same alpha to all points with something behind + A(x,y)=255; + } else { + R(x,y)=0; + G(x,y)=0; + B(x,y)=0; + A(x,y)=0; + } + + } + } +} + + +template +IGL_INLINE void +igl::embree::EmbreeRenderer +::set_colors(const Eigen::MatrixBase & C) +{ + if(C.rows()==V.rows()) // per vertex color + { + face_based = false; + this->C = C.template cast(); + this->uniform_color=false; + } else if (C.rows()==F.rows()) { + face_based = true; + this->C = C.template cast(); + this->uniform_color=false; + } else if (C.rows()==1) { + face_based = true; + this->uC = C.template cast(); + this->uniform_color=true; + }else { + // don't know what to do + this->uniform_color=true; + assert(false); //? + } +} + +template +IGL_INLINE void +igl::embree::EmbreeRenderer +::set_data(const Eigen::MatrixBase & D, igl::ColorMapType cmap) +{ + const auto caxis_min = D.minCoeff(); + const auto caxis_max = D.maxCoeff(); + return set_data(D,caxis_min,caxis_max,cmap); +} + + +template +IGL_INLINE void igl::embree::EmbreeRenderer::set_data( + const Eigen::MatrixBase & D, + T caxis_min, + T caxis_max, + igl::ColorMapType cmap) +{ + Eigen::Matrix C; + igl::colormap(cmap,D,caxis_min,caxis_max,C); + set_colors(C); +} + +template +IGL_INLINE void +igl::embree::EmbreeRenderer::set_rot(const Eigen::MatrixBase &r) +{ + this->rot_matrix = r.template cast(); +} + +template +IGL_INLINE void +igl::embree::EmbreeRenderer::set_zoom(T zoom) +{ + this->camera_zoom=zoom; +} + +template +IGL_INLINE void +igl::embree::EmbreeRenderer::set_translation(const Eigen::MatrixBase &tr) +{ + this->camera_translation=tr.template cast(); +} + +IGL_INLINE void +igl::embree::EmbreeRenderer::set_face_based(bool _f) +{ + this->face_based=_f; +} + +IGL_INLINE void +igl::embree::EmbreeRenderer::set_orthographic(bool o) +{ + this->orthographic=o; +} + +IGL_INLINE void +igl::embree::EmbreeRenderer::set_double_sided(bool d) +{ + this->double_sided=d; +} + + +#ifdef IGL_STATIC_LIBRARY +template void igl::embree::EmbreeRenderer::set_rot >(Eigen::MatrixBase > const&); +template void igl::embree::EmbreeRenderer::set_data >(Eigen::MatrixBase > const&, igl::ColorMapType); +template void igl::embree::EmbreeRenderer::set_mesh, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, bool); +template void igl::embree::EmbreeRenderer::set_zoom(double); +#endif //IGL_STATIC_LIBRARY diff --git a/vendor/libigl/include/igl/embree/EmbreeRenderer.h b/vendor/libigl/include/igl/embree/EmbreeRenderer.h new file mode 100644 index 0000000000000000000000000000000000000000..2586c5096553eb227489acbaa9311054fd0f0ece --- /dev/null +++ b/vendor/libigl/include/igl/embree/EmbreeRenderer.h @@ -0,0 +1,261 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// +// Copyright (C) 2020 Vladimir Fonov +// 2013 Alec Jacobson +// 2014 Christian Schüller +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +// + +#ifndef IGL_EMBREE_EMBREE_RENDERER_H +#define IGL_EMBREE_EMBREE_RENDERER_H + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "EmbreeDevice.h" + + +namespace igl +{ + namespace embree + { + // embree-based mesh renderer + class EmbreeRenderer + { + public: + typedef Eigen::RowVector3f Vec3f; + + struct Hit + { + int id; // primitive id + int gid; // geometry id + float u,v; // barycentric coordinates + float t; // distance = direction*t to intersection + Vec3f N; // element normal + }; + + public: + typedef Eigen::Matrix PointMatrixType; + typedef Eigen::Matrix ColorMatrixType; + typedef Eigen::Matrix FaceMatrixType; + typedef Eigen::Matrix PixelMatrixType; + + public: + EmbreeRenderer(); + private: + // Copying and assignment are not allowed. + EmbreeRenderer(const EmbreeRenderer & that); + EmbreeRenderer & operator=(const EmbreeRenderer &); + public: + virtual ~EmbreeRenderer(); + + // Specify mesh, this call reinitializes embree structures + // Inputs: + // V #V x dim matrix of vertex coordinates + // F #F x simplex_size matrix of indices of simplex corners into V + // is_static - optimize for static thene (HQ rendering) + template + void set_mesh(const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + bool is_static=true); + + // Specify per-vertex or per-face color + // Inputs: + // C #V x 3 matrix of vertex colors + // or #F x 3 matrix of face colors + // or 1 x 3 matrix of uniform color + template + void set_colors(const Eigen::MatrixBase & C); + + // Use min(D) and max(D) to set caxis. + template + void set_data(const Eigen::MatrixBase & D, + igl::ColorMapType cmap = igl::COLOR_MAP_TYPE_VIRIDIS); + + // Specify per-vertex or per-face scalar field + // that will be converted to color using jet color map + // Inputs: + // caxis_min caxis minimum bound + // caxis_max caxis maximum bound + // D #V by 1 list of scalar values + // cmap colormap type + // num_steps number of intervals to discretize the colormap + template + void set_data( + const Eigen::MatrixBase & D, + T caxis_min, + T caxis_max, + igl::ColorMapType cmap = igl::COLOR_MAP_TYPE_VIRIDIS); + + // Specify mesh rotation + // Inputs: + // r 3 x 3 rotaton matrix + template + void set_rot(const Eigen::MatrixBase &r); + + // Specify mesh magnification + // Inputs: + // z magnification ratio + template + void set_zoom(T z); + + // Specify mesh translation + // Inputs: + // tr translation vector + template + void set_translation(const Eigen::MatrixBase &tr); + + // Specify that color is face based + // Inputs: + // f - face or vertex colours + void set_face_based(bool f); + + // Use orthographic projection + // Inputs: + // f - orthographic or perspective projection + void set_orthographic(bool f ); + + + // Render both sides of triangles + // Inputs: + // f - double sided + void set_double_sided(bool f); + + // render full buffer + // Outputs: + // all outputs should have the same size (size of the output picture) + // area outside of the visible object will have zero alpha component (transparant) + // R - red channel + // G - green channel + // B - blue channel + // A - alpha channel + void render_buffer(PixelMatrixType &R, + PixelMatrixType &G, + PixelMatrixType &B, + PixelMatrixType &A); + + // Given a ray find the first hit + // + // Inputs: + // origin 3d origin point of ray + // direction 3d (not necessarily normalized) direction vector of ray + // tnear start of ray segment + // tfar end of ray segment + // mask a 32 bit mask to identify active geometries. + // Output: + // hit information about hit + // Returns true if and only if there was a hit + bool intersect_ray( + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + Hit& hit, + float tnear = 0, + float tfar = std::numeric_limits::infinity(), + int mask = 0xFFFFFFFF) const; + + private: + + // Initialize with a given mesh. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of Oriented triangles + // isStatic scene is optimized for static geometry + // Side effects: + // The first time this is ever called the embree engine is initialized. + void init( + const PointMatrixType& V, + const FaceMatrixType& F, + bool isStatic = false); + + // Initialize embree with a given mesh. + // + // Inputs: + // V vector of #V by 3 list of vertex positions for each geometry + // F vector of #F by 3 list of Oriented triangles for each geometry + // masks a 32 bit mask to identify active geometries. + // isStatic scene is optimized for static geometry + // Side effects: + // The first time this is ever called the embree engine is initialized. + void init( + const std::vector& V, + const std::vector& F, + const std::vector& masks, + bool isStatic = false); + + + // Deinitialize embree datasctructures for current mesh. Also called on + // destruction: no need to call if you just want to init() once and + // destroy. + void deinit(); + // initialize view parameters + void init_view(); + + // scene data + PointMatrixType V; // vertices + FaceMatrixType F; // faces + ColorMatrixType C; // colours + + Eigen::RowVector3f uC; // uniform color + + bool face_based; + bool uniform_color; + bool double_sided ; + + // Camera parameters + float camera_base_zoom; + float camera_zoom; + + Eigen::Vector3f camera_base_translation; + Eigen::Vector3f camera_translation; + Eigen::Vector3f camera_eye; + Eigen::Vector3f camera_up; + Eigen::Vector3f camera_center; + float camera_view_angle; + float camera_dnear; + float camera_dfar; + + // projection matrixes + Eigen::Matrix4f view; + Eigen::Matrix4f proj; + Eigen::Matrix4f norm; + + Eigen::Matrix3f rot_matrix; + + bool orthographic; + + // embree data + RTCScene scene; + unsigned geomID; + bool initialized; + + RTCDevice device; + + void create_ray( + RTCRayHit& ray, + const Eigen::RowVector3f& origin, + const Eigen::RowVector3f& direction, + float tnear, + float tfar, + int mask) const; + + }; + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "EmbreeRenderer.cpp" +#endif +#endif //IGL_EMBREE_EMBREE_RENDERER_H diff --git a/vendor/libigl/include/igl/embree/ambient_occlusion.cpp b/vendor/libigl/include/igl/embree/ambient_occlusion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4b7e66fdfc6c6d9396fdf4afb828b1e9074992cf --- /dev/null +++ b/vendor/libigl/include/igl/embree/ambient_occlusion.cpp @@ -0,0 +1,62 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "ambient_occlusion.h" +#include "../ambient_occlusion.h" +#include "EmbreeIntersector.h" +#include "../Hit.h" + +template < + typename DerivedP, + typename DerivedN, + typename DerivedS > +IGL_INLINE void igl::embree::ambient_occlusion( + const igl::embree::EmbreeIntersector & ei, + const Eigen::MatrixBase & P, + const Eigen::MatrixBase & N, + const int num_samples, + Eigen::PlainObjectBase & S) +{ + const auto & shoot_ray = [&ei]( + const Eigen::Vector3f& s, + const Eigen::Vector3f& dir)->bool + { + igl::Hit hit; + const float tnear = 1e-4f; + return ei.intersectRay(s,dir,hit,tnear); + }; + return igl::ambient_occlusion(shoot_ray,P,N,num_samples,S); +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DerivedN, + typename DerivedS > +IGL_INLINE void igl::embree::ambient_occlusion( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & P, + const Eigen::MatrixBase & N, + const int num_samples, + Eigen::PlainObjectBase & S) +{ + using namespace Eigen; + EmbreeIntersector ei; + ei.init(V.template cast(),F.template cast()); + ambient_occlusion(ei,P,N,num_samples,S); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::embree::ambient_occlusion, Eigen::Matrix, Eigen::Matrix >(igl::embree::EmbreeIntersector const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::embree::ambient_occlusion, Eigen::Matrix, Eigen::Matrix >(igl::embree::EmbreeIntersector const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::embree::ambient_occlusion, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::embree::ambient_occlusion, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::embree::ambient_occlusion, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/embree/ambient_occlusion.h b/vendor/libigl/include/igl/embree/ambient_occlusion.h new file mode 100644 index 0000000000000000000000000000000000000000..df64312ff26d42d9b7a178c3059e521918d3abfb --- /dev/null +++ b/vendor/libigl/include/igl/embree/ambient_occlusion.h @@ -0,0 +1,59 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EMBREE_AMBIENT_OCCLUSION_H +#define IGL_EMBREE_AMBIENT_OCCLUSION_H +#include "../igl_inline.h" +#include +namespace igl +{ + namespace embree + { + // Forward define + class EmbreeIntersector; + // Compute ambient occlusion per given point + // + // Inputs: + // ei EmbreeIntersector containing (V,F) + // P #P by 3 list of origin points + // N #P by 3 list of origin normals + // Outputs: + // S #P list of ambient occlusion values between 1 (fully occluded) and + // 0 (not occluded) + // + template < + typename DerivedP, + typename DerivedN, + typename DerivedS > + IGL_INLINE void ambient_occlusion( + const EmbreeIntersector & ei, + const Eigen::MatrixBase & P, + const Eigen::MatrixBase & N, + const int num_samples, + Eigen::PlainObjectBase & S); + // Wrapper which builds new EmbreeIntersector for (V,F). That's expensive so + // avoid this if repeatedly calling. + template < + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DerivedN, + typename DerivedS > + IGL_INLINE void ambient_occlusion( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & P, + const Eigen::MatrixBase & N, + const int num_samples, + Eigen::PlainObjectBase & S); + } +}; +#ifndef IGL_STATIC_LIBRARY +# include "ambient_occlusion.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/embree/bone_heat.cpp b/vendor/libigl/include/igl/embree/bone_heat.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8a85af98cf3b564014da36700c085568986f1581 --- /dev/null +++ b/vendor/libigl/include/igl/embree/bone_heat.cpp @@ -0,0 +1,116 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "bone_heat.h" +#include "EmbreeIntersector.h" +#include "bone_visible.h" +#include "../project_to_line_segment.h" +#include "../cotmatrix.h" +#include "../massmatrix.h" +#include "../mat_min.h" +#include + +bool igl::embree::bone_heat( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXd & C, + const Eigen::VectorXi & P, + const Eigen::MatrixXi & BE, + const Eigen::MatrixXi & CE, + Eigen::MatrixXd & W) +{ + using namespace std; + using namespace Eigen; + assert(CE.rows() == 0 && "Cage edges not supported."); + assert(C.cols() == V.cols() && "V and C should have same #cols"); + assert(BE.cols() == 2 && "BE should have #cols=2"); + assert(F.cols() == 3 && "F should contain triangles."); + assert(V.cols() == 3 && "V should contain 3D positions."); + + const int n = V.rows(); + const int np = P.rows(); + const int nb = BE.rows(); + const int m = np + nb; + + // "double sided lighting" + MatrixXi FF; + FF.resize(F.rows()*2,F.cols()); + FF << F, F.rowwise().reverse(); + // Initialize intersector + EmbreeIntersector ei; + ei.init(V.cast(),F.cast()); + + typedef Matrix VectorXb; + typedef Matrix MatrixXb; + MatrixXb vis_mask(n,m); + // Distances + MatrixXd D(n,m); + // loop over points + for(int j = 0;j 0) + { + cerr<<"Error: Cage edges are not supported. Ignored."<1e10?1e10:hii); + } + } + SparseMatrix Q,L,M; + cotmatrix(V,F,L); + massmatrix(V,F,MASSMATRIX_TYPE_DEFAULT,M); + const auto & H = Hdiag.asDiagonal(); + Q = (-L+M*H); + SimplicialLLT > llt; + llt.compute(Q); + switch(llt.info()) + { + case Eigen::Success: + break; + case Eigen::NumericalIssue: + cerr<<"Error: Numerical issue."< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EMBREE_BONE_HEAT_H +#define IGL_EMBREE_BONE_HEAT_H +#include "../igl_inline.h" +#include + +namespace igl +{ + namespace embree + { + // BONE_HEAT Compute skinning weights W given a surface mesh (V,F) and an + // internal skeleton (C,BE) according to "Automatic Rigging" [Baran and + // Popovic 2007]. + // + // Inputs: + // V #V by 3 list of mesh vertex positions + // F #F by 3 list of mesh corner indices into V + // C #C by 3 list of joint locations + // P #P list of point handle indices into C + // BE #BE by 2 list of bone edge indices into C + // CE #CE by 2 list of cage edge indices into **P** + // Outputs: + // W #V by #P+#BE matrix of weights. + // Returns true only on success. + // + IGL_INLINE bool bone_heat( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXd & C, + const Eigen::VectorXi & P, + const Eigen::MatrixXi & BE, + const Eigen::MatrixXi & CE, + Eigen::MatrixXd & W); + } +}; + +#ifndef IGL_STATIC_LIBRARY +# include "bone_heat.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/embree/bone_visible.cpp b/vendor/libigl/include/igl/embree/bone_visible.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4f2fe91263cd9e9d2081877ddd83a016a273b736 --- /dev/null +++ b/vendor/libigl/include/igl/embree/bone_visible.cpp @@ -0,0 +1,145 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "bone_visible.h" +#include "../project_to_line.h" +#include "../EPS.h" +#include "../Hit.h" +#include "../Timer.h" +#include + +template < + typename DerivedV, + typename DerivedF, + typename DerivedSD, + typename Derivedflag> +IGL_INLINE void igl::embree::bone_visible( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & s, + const Eigen::PlainObjectBase & d, + Eigen::PlainObjectBase & flag) +{ + // "double sided lighting" + Eigen::Matrix FF; + FF.resize(F.rows()*2,F.cols()); + FF << F, F.rowwise().reverse(); + // Initialize intersector + EmbreeIntersector ei; + ei.init(V.template cast(),FF.template cast()); + return bone_visible(V,F,ei,s,d,flag); +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedSD, + typename Derivedflag> +IGL_INLINE void igl::embree::bone_visible( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const EmbreeIntersector & ei, + const Eigen::PlainObjectBase & s, + const Eigen::PlainObjectBase & d, + Eigen::PlainObjectBase & flag) +{ + using namespace std; + using namespace Eigen; + flag.resize(V.rows()); + const double sd_norm = (s-d).norm(); + // Embree seems to be parallel when constructing but not when tracing rays +#pragma omp parallel for + // loop over mesh vertices + for(int v = 0;v1) + { + t = 1; + sqrd = (Vv-d).array().pow(2).sum(); + projv = d; + } + } + igl::Hit hit; + // perhaps 1.0 should be 1.0-epsilon, or actually since we checking the + // incident face, perhaps 1.0 should be 1.0+eps + const Vector3d dir = (Vv-projv)*1.0; + if(ei.intersectSegment( + projv.template cast(), + dir.template cast(), + hit)) + { + // mod for double sided lighting + const int fi = hit.id % F.rows(); + + //if(v == 1228-1) + //{ + // Vector3d bc,P; + // bc << 1 - hit.u - hit.v, hit.u, hit.v; // barycentric + // P = V.row(F(fi,0))*bc(0) + + // V.row(F(fi,1))*bc(1) + + // V.row(F(fi,2))*bc(2); + // cout<<(fi+1)<sqrd) + { + flag(v) = true; + } + }else + { + // no hit so vectex v is visible + flag(v) = true; + } + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::embree::bone_visible, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::embree::bone_visible, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/embree/bone_visible.h b/vendor/libigl/include/igl/embree/bone_visible.h new file mode 100644 index 0000000000000000000000000000000000000000..1e490b51dd643afa0e551cb12fc22dcedf587fa3 --- /dev/null +++ b/vendor/libigl/include/igl/embree/bone_visible.h @@ -0,0 +1,68 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EMBREE_BONE_VISIBLE_H +#define IGL_EMBREE_BONE_VISIBLE_H +#include +#include +#include "EmbreeIntersector.h" +namespace igl +{ + namespace embree + { + // + // BONE_VISIBLE test whether vertices of mesh are "visible" to a given bone, + // where "visible" is defined as in [Baran & Popovic 07]. Instead of checking + // whether each point can see *any* of the bone, we just check if each point + // can see its own projection onto the bone segment. In other words, we project + // each vertex v onto the bone, projv. Then we check if there are any + // intersections between the line segment (projv-->v) and the mesh. + // + // [flag] = bone_visible(V,F,s,d); + // + // Input: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices + // s row vector of position of start end point of bone + // d row vector of position of dest end point of bone + // Output: + // flag #V by 1 list of bools (true) visible, (false) obstructed + // + // Note: This checks for hits along the segment which are facing in *any* + // direction from the ray. + // + template < + typename DerivedV, + typename DerivedF, + typename DerivedSD, + typename Derivedflag> + IGL_INLINE void bone_visible( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & s, + const Eigen::PlainObjectBase & d, + Eigen::PlainObjectBase & flag); + // Inputs: + // ei EmbreeIntersector for mesh (V,F) should be double sided + template < + typename DerivedV, + typename DerivedF, + typename DerivedSD, + typename Derivedflag> + IGL_INLINE void bone_visible( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const EmbreeIntersector & ei, + const Eigen::PlainObjectBase & s, + const Eigen::PlainObjectBase & d, + Eigen::PlainObjectBase & flag); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "bone_visible.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/embree/line_mesh_intersection.cpp b/vendor/libigl/include/igl/embree/line_mesh_intersection.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f6e02b8cad69f461a431b501ea638730b89a00d --- /dev/null +++ b/vendor/libigl/include/igl/embree/line_mesh_intersection.cpp @@ -0,0 +1,85 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "line_mesh_intersection.h" +#include "../Hit.h" + +// For error printing +#include +#include + +#include +#include + +template +IGL_INLINE ScalarMatrix igl::embree::line_mesh_intersection +( + const ScalarMatrix & V_source, + const ScalarMatrix & N_source, + const ScalarMatrix & V_target, + const IndexMatrix & F_target +) +{ + + double tol = 0.00001; + + Eigen::MatrixXd ray_pos = V_source; + Eigen::MatrixXd ray_dir = N_source; + + // Allocate matrix for the result + ScalarMatrix R; + R.resize(V_source.rows(), 3); + + // Initialize embree + EmbreeIntersector embree; + embree.init(V_target.template cast(),F_target.template cast()); + + // Shoot rays from the source to the target + for (unsigned i=0; i(), A_dir.cast(),A); + + Eigen::RowVector3d B_pos = ray_pos.row(i) - tol * ray_dir.row(i); + Eigen::RowVector3d B_dir = ray_dir.row(i); + + bool B_hit = embree.intersectBeam(B_pos.cast(), B_dir.cast(),B); + + + int choice = -1; + + if (A_hit && ! B_hit) + choice = 0; + else if (!A_hit && B_hit) + choice = 1; + else if (A_hit && B_hit) + choice = A.t > B.t; + + Eigen::RowVector3d temp; + + if (choice == -1) + temp << -1, 0, 0; + else if (choice == 0) + temp << A.id, A.u, A.v; + else if (choice == 1) + temp << B.id, B.u, B.v; + + R.row(i) = temp; + + } + + return R; + +} + +#ifdef IGL_STATIC_LIBRARY +template Eigen::Matrix igl::embree::line_mesh_intersection, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&); +#endif diff --git a/vendor/libigl/include/igl/embree/line_mesh_intersection.h b/vendor/libigl/include/igl/embree/line_mesh_intersection.h new file mode 100644 index 0000000000000000000000000000000000000000..b7b849c8a1dae56222168e9f2d5a9a287598952e --- /dev/null +++ b/vendor/libigl/include/igl/embree/line_mesh_intersection.h @@ -0,0 +1,51 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EMBREE_LINE_MESH_INTERSECTION_H +#define IGL_EMBREE_LINE_MESH_INTERSECTION_H +#include + +#include +#include +#include + +namespace igl +{ + namespace embree + { + // Project the point cloud V_source onto the triangle mesh + // V_target,F_target. + // A ray is casted for every vertex in the direction specified by + // N_source and its opposite. + // + // Input: + // V_source: #Vx3 Vertices of the source mesh + // N_source: #Vx3 Normals of the point cloud + // V_target: #V2x3 Vertices of the target mesh + // F_target: #F2x3 Faces of the target mesh + // + // Output: + // #Vx3 matrix of baricentric coordinate. Each row corresponds to + // a vertex of the projected mesh and it has the following format: + // id b1 b2. id is the id of a face of the source mesh. b1 and b2 are + // the barycentric coordinates wrt the first two edges of the triangle + // To convert to standard global coordinates, see barycentric_to_global.h + template + IGL_INLINE ScalarMatrix line_mesh_intersection + ( + const ScalarMatrix & V_source, + const ScalarMatrix & N_source, + const ScalarMatrix & V_target, + const IndexMatrix & F_target + ); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "line_mesh_intersection.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/embree/reorient_facets_raycast.cpp b/vendor/libigl/include/igl/embree/reorient_facets_raycast.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fabc021d9dd7d0a98622a6d49a9089998a4f955c --- /dev/null +++ b/vendor/libigl/include/igl/embree/reorient_facets_raycast.cpp @@ -0,0 +1,259 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "reorient_facets_raycast.h" +#include "../per_face_normals.h" +#include "../doublearea.h" +#include "../random_dir.h" +#include "../bfs_orient.h" +#include "EmbreeIntersector.h" +#include +#include +#include +#include + +template < + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename DerivedC> +IGL_INLINE void igl::embree::reorient_facets_raycast( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + int rays_total, + int rays_minimum, + bool facet_wise, + bool use_parity, + bool is_verbose, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C) +{ + using namespace Eigen; + using namespace std; + assert(F.cols() == 3); + assert(V.cols() == 3); + + // number of faces + const int m = F.rows(); + + MatrixXi FF = F; + if (facet_wise) { + C.resize(m); + for (int i = 0; i < m; ++i) C(i) = i; + + } else { + if (is_verbose) cout << "extracting patches... "; + bfs_orient(F,FF,C); + } + if (is_verbose) cout << (C.maxCoeff() + 1) << " components. "; + + // number of patches + const int num_cc = C.maxCoeff()+1; + + // Init Embree + EmbreeIntersector ei; + ei.init(V.template cast(),FF); + + // face normal + MatrixXd N; + per_face_normals(V,FF,N); + + // face area + Matrix A; + doublearea(V,FF,A); + double area_total = A.sum(); + + // determine number of rays per component according to its area + VectorXd area_per_component; + area_per_component.setZero(num_cc); + for (int f = 0; f < m; ++f) + { + area_per_component(C(f)) += A(f); + } + VectorXi num_rays_per_component(num_cc); + for (int c = 0; c < num_cc; ++c) + { + num_rays_per_component(c) = max(static_cast(rays_total * area_per_component(c) / area_total), rays_minimum); + } + rays_total = num_rays_per_component.sum(); + + // generate all the rays + if (is_verbose) cout << "generating rays... "; + uniform_real_distribution rdist; + mt19937 prng; + prng.seed(time(nullptr)); + vector ray_face; + vector ray_ori; + vector ray_dir; + ray_face.reserve(rays_total); + ray_ori .reserve(rays_total); + ray_dir .reserve(rays_total); + for (int c = 0; c < num_cc; ++c) + { + if (area_per_component[c] == 0) + { + continue; + } + vector CF; // set of faces per component + vector CF_area; + for (int f = 0; f < m; ++f) + { + if (C(f)==c) + { + CF.push_back(f); + CF_area.push_back(A(f)); + } + } + // discrete distribution for random selection of faces with probability proportional to their areas + discrete_distribution ddist(CF.size(), 0, CF.size(), [&](double i){ return CF_area[static_cast(i)]; }); // simple ctor of (Iter, Iter) not provided by the stupid VC11/12 + for (int i = 0; i < num_rays_per_component[c]; ++i) + { + int f = CF[ddist(prng)]; // select face with probability proportional to face area + float s = rdist(prng); // random barycentric coordinate (reference: Generating Random Points in Triangles [Turk, Graphics Gems I 1990]) + float t = rdist(prng); + float sqrt_t = sqrtf(t); + float a = 1 - sqrt_t; + float b = (1 - s) * sqrt_t; + float c = s * sqrt_t; + Vector3f p = a * V.row(FF(f,0)).template cast().eval() // be careful with the index!!! + + b * V.row(FF(f,1)).template cast().eval() + + c * V.row(FF(f,2)).template cast().eval(); + Vector3f n = N.row(f).cast(); + if (n.isZero()) continue; + // random direction in hemisphere around n (avoid too grazing angle) + Vector3f d; + while (true) { + d = random_dir().cast(); + float ndotd = n.dot(d); + if (fabsf(ndotd) < 0.1f) + { + continue; + } + if (ndotd < 0) + { + d *= -1.0f; + } + break; + } + ray_face.push_back(f); + ray_ori .push_back(p); + ray_dir .push_back(d); + + if (is_verbose && ray_face.size() % (rays_total / 10) == 0) cout << "."; + } + } + if (is_verbose) cout << ray_face.size() << " rays. "; + + // per component voting: first=front, second=back + vector> C_vote_distance(num_cc, make_pair(0, 0)); // sum of distance between ray origin and intersection + vector> C_vote_infinity(num_cc, make_pair(0, 0)); // number of rays reaching infinity + vector> C_vote_parity(num_cc, make_pair(0, 0)); // sum of parity count for each ray + + if (is_verbose) cout << "shooting rays... "; +#pragma omp parallel for + for (int i = 0; i < (int)ray_face.size(); ++i) + { + int f = ray_face[i]; + Vector3f o = ray_ori [i]; + Vector3f d = ray_dir [i]; + int c = C(f); + + // shoot ray toward front & back + vector hits_front; + vector hits_back; + int num_rays_front; + int num_rays_back; + ei.intersectRay(o, d, hits_front, num_rays_front); + ei.intersectRay(o, -d, hits_back , num_rays_back ); + if (!hits_front.empty() && hits_front[0].id == f) hits_front.erase(hits_front.begin()); + if (!hits_back .empty() && hits_back [0].id == f) hits_back .erase(hits_back .begin()); + + if (use_parity) { +#pragma omp atomic + C_vote_parity[c].first += hits_front.size() % 2; +#pragma omp atomic + C_vote_parity[c].second += hits_back .size() % 2; + + } else { + if (hits_front.empty()) + { +#pragma omp atomic + C_vote_infinity[c].first++; + } else { +#pragma omp atomic + C_vote_distance[c].first += hits_front[0].t; + } + + if (hits_back.empty()) + { +#pragma omp atomic + C_vote_infinity[c].second++; + } else { +#pragma omp atomic + C_vote_distance[c].second += hits_back[0].t; + } + } + } + + I.resize(m); + for(int f = 0; f < m; ++f) + { + int c = C(f); + if (use_parity) { + I(f) = C_vote_parity[c].first > C_vote_parity[c].second ? 1 : 0; // Ideally, parity for the front/back side should be 1/0 (i.e., parity sum for all rays should be smaller on the front side) + + } else { + I(f) = (C_vote_infinity[c].first == C_vote_infinity[c].second && C_vote_distance[c].first < C_vote_distance[c].second) || + C_vote_infinity[c].first < C_vote_infinity[c].second + ? 1 : 0; + } + // To account for the effect of bfs_orient + if (F.row(f) != FF.row(f)) + I(f) = 1 - I(f); + } + if (is_verbose) cout << "done!" << endl; +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedFF, + typename DerivedI> +IGL_INLINE void igl::embree::reorient_facets_raycast( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & I) +{ + const int rays_total = F.rows()*100; + const int rays_minimum = 10; + const bool facet_wise = false; + const bool use_parity = false; + const bool is_verbose = false; + Eigen::VectorXi C; + reorient_facets_raycast( + V,F,rays_total,rays_minimum,facet_wise,use_parity,is_verbose,I,C); + // Conservative in case FF = F + FF.conservativeResize(F.rows(),F.cols()); + for(int i = 0;i, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::embree::reorient_facets_raycast, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int, int, bool, bool, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::embree::reorient_facets_raycast, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int, int, bool, bool, bool, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/embree/reorient_facets_raycast.h b/vendor/libigl/include/igl/embree/reorient_facets_raycast.h new file mode 100644 index 0000000000000000000000000000000000000000..a43efac94cc85920501d83c7c48a1413c2e3564e --- /dev/null +++ b/vendor/libigl/include/igl/embree/reorient_facets_raycast.h @@ -0,0 +1,73 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EMBREE_REORIENT_FACETS_RAYCAST_H +#define IGL_EMBREE_REORIENT_FACETS_RAYCAST_H +#include "../igl_inline.h" +#include +namespace igl +{ + namespace embree + { + // Orient each component (identified by C) of a mesh (V,F) using ambient + // occlusion such that the front side is less occluded than back side, as + // described in "A Simple Method for Correcting Facet Orientations in + // Polygon Meshes Based on Ray Casting" [Takayama et al. 2014]. + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of triangle indices + // rays_total Total number of rays that will be shot + // rays_minimum Minimum number of rays that each patch should receive + // facet_wise Decision made for each face independently, no use of patches + // (i.e., each face is treated as a patch) + // use_parity Use parity mode + // is_verbose Verbose output to cout + // Outputs: + // I #F list of whether face has been flipped + // C #F list of patch ID (output of bfs_orient > manifold patches) + template < + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename DerivedC> + IGL_INLINE void reorient_facets_raycast( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + int rays_total, + int rays_minimum, + bool facet_wise, + bool use_parity, + bool is_verbose, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C); + // Outputs: + // FF #F by 3 list of reoriented faces + // Defaults: + // rays_total = F.rows()*100; + // rays_minimum = 10; + // facet_wise = false; + // use_parity = false; + // is_verbose = false; + template < + typename DerivedV, + typename DerivedF, + typename DerivedFF, + typename DerivedI> + IGL_INLINE void reorient_facets_raycast( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & I); + } +}; + +#ifndef IGL_STATIC_LIBRARY +# include "reorient_facets_raycast.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/embree/shape_diameter_function.cpp b/vendor/libigl/include/igl/embree/shape_diameter_function.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3b0be489ef828a31f1dcbfdfe4ec6d6c6eff9999 --- /dev/null +++ b/vendor/libigl/include/igl/embree/shape_diameter_function.cpp @@ -0,0 +1,69 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "shape_diameter_function.h" +#include "../shape_diameter_function.h" +#include "EmbreeIntersector.h" +#include "../Hit.h" + +template < + typename DerivedP, + typename DerivedN, + typename DerivedS > +IGL_INLINE void igl::embree::shape_diameter_function( + const igl::embree::EmbreeIntersector & ei, + const Eigen::PlainObjectBase & P, + const Eigen::PlainObjectBase & N, + const int num_samples, + Eigen::PlainObjectBase & S) +{ + const auto & shoot_ray = [&ei]( + const Eigen::Vector3f& s, + const Eigen::Vector3f& dir)->double + { + igl::Hit hit; + const float tnear = 1e-4f; + if(ei.intersectRay(s,dir,hit,tnear)) + { + return hit.t; + }else + { + return std::numeric_limits::infinity(); + } + }; + return igl::shape_diameter_function(shoot_ray,P,N,num_samples,S); +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DerivedN, + typename DerivedS > +IGL_INLINE void igl::embree::shape_diameter_function( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & P, + const Eigen::PlainObjectBase & N, + const int num_samples, + Eigen::PlainObjectBase & S) +{ + using namespace Eigen; + EmbreeIntersector ei; + ei.init(V.template cast(),F.template cast()); + shape_diameter_function(ei,P,N,num_samples,S); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::embree::shape_diameter_function, Eigen::Matrix, Eigen::Matrix >(igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::embree::shape_diameter_function, Eigen::Matrix, Eigen::Matrix >(igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::embree::shape_diameter_function, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::embree::shape_diameter_function, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::embree::shape_diameter_function, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); +#endif + diff --git a/vendor/libigl/include/igl/embree/shape_diameter_function.h b/vendor/libigl/include/igl/embree/shape_diameter_function.h new file mode 100644 index 0000000000000000000000000000000000000000..c18922d2838d84b605018edaa311af8732deee74 --- /dev/null +++ b/vendor/libigl/include/igl/embree/shape_diameter_function.h @@ -0,0 +1,60 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EMBREE_SHAPE_DIAMETER_FUNCTION_H +#define IGL_EMBREE_SHAPE_DIAMETER_FUNCTION_H +#include "../igl_inline.h" +#include +namespace igl +{ + namespace embree + { + // Forward define + class EmbreeIntersector; + // Compute shape diamter function per given point + // + // Inputs: + // ei EmbreeIntersector containing (V,F) + // P #P by 3 list of origin points + // N #P by 3 list of origin normals + // Outputs: + // S #P list of shape diamater function values between bounding box + // diagonal (perfect sphere) and 0 (perfect needle hook) + // + template < + typename DerivedP, + typename DerivedN, + typename DerivedS > + IGL_INLINE void shape_diameter_function( + const EmbreeIntersector & ei, + const Eigen::PlainObjectBase & P, + const Eigen::PlainObjectBase & N, + const int num_samples, + Eigen::PlainObjectBase & S); + // Wrapper which builds new EmbreeIntersector for (V,F). That's expensive so + // avoid this if repeatedly calling. + template < + typename DerivedV, + typename DerivedF, + typename DerivedP, + typename DerivedN, + typename DerivedS > + IGL_INLINE void shape_diameter_function( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + const Eigen::PlainObjectBase & P, + const Eigen::PlainObjectBase & N, + const int num_samples, + Eigen::PlainObjectBase & S); + } +}; +#ifndef IGL_STATIC_LIBRARY +# include "shape_diameter_function.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/embree/unproject_in_mesh.cpp b/vendor/libigl/include/igl/embree/unproject_in_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..79a24a0abe32b585ec038f85503da7471c819b71 --- /dev/null +++ b/vendor/libigl/include/igl/embree/unproject_in_mesh.cpp @@ -0,0 +1,55 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "unproject_in_mesh.h" +#include "EmbreeIntersector.h" +#include "../unproject_ray.h" +#include "../unproject_in_mesh.h" +#include + +template +IGL_INLINE int igl::embree::unproject_in_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const EmbreeIntersector & ei, + Eigen::PlainObjectBase & obj, + std::vector & hits) +{ + using namespace std; + using namespace Eigen; + const auto & shoot_ray = [&ei]( + const Eigen::Vector3f& s, + const Eigen::Vector3f& dir, + std::vector & hits) + { + int num_rays_shot; + ei.intersectRay(s,dir,hits,num_rays_shot); + }; + return igl::unproject_in_mesh(pos,model,proj,viewport,shoot_ray,obj,hits); +} + +template +IGL_INLINE int igl::embree::unproject_in_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const EmbreeIntersector & ei, + Eigen::PlainObjectBase & obj) +{ + std::vector hits; + return unproject_in_mesh(pos,model,proj,viewport,ei,obj,hits); +} + + +#ifdef IGL_STATIC_LIBRARY +template int igl::embree::unproject_in_mesh >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase >&, std::vector >&); +template int igl::embree::unproject_in_mesh >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase >&, std::vector >&); +template int igl::embree::unproject_in_mesh >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/embree/unproject_in_mesh.h b/vendor/libigl/include/igl/embree/unproject_in_mesh.h new file mode 100644 index 0000000000000000000000000000000000000000..707c1e62532d9ee63fa47ebb86c6e08784232cc6 --- /dev/null +++ b/vendor/libigl/include/igl/embree/unproject_in_mesh.h @@ -0,0 +1,72 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EMBREE_UNPROJECT_IN_MESH +#define IGL_EMBREE_UNPROJECT_IN_MESH +#include +#include + +#include +#include "../Hit.h" + +namespace igl +{ + namespace embree + { + // Forward define + class EmbreeIntersector; + + // Unproject a screen location (using current opengl viewport, projection, and + // model view) to a 3D position _inside_ a given mesh. If the ray through the + // given screen location (x,y) _hits_ the mesh more than twice then the 3D + // midpoint between the first two hits is return. If it hits once, then that + // point is return. If it does not hit the mesh then obj is not set. + // + // + // Inputs: + // pos screen space coordinates + // model model matrix + // proj projection matrix + // viewport vieweport vector + // ei EmbreeIntersector containing (V,F) + // Outputs: + // obj 3d unprojected mouse point in mesh + // hits vector of embree hits + // Returns number of hits + // + // Note: Previous prototype did not require model, proj, and viewport. This + // has been removed. Instead replace with: + // + // Eigen::Matrix4f model,proj; + // Eigen::Vector4f viewport; + // igl::opengl2::model_proj_viewport(model,proj,viewport); + // igl::embree::unproject_in_mesh(Vector2f(x,y),model,proj,viewport,ei,obj,hits); + // + template < typename Derivedobj> + IGL_INLINE int unproject_in_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const EmbreeIntersector & ei, + Eigen::PlainObjectBase & obj, + std::vector & hits); + template < typename Derivedobj> + IGL_INLINE int unproject_in_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const EmbreeIntersector & ei, + Eigen::PlainObjectBase & obj); + + } +} +#ifndef IGL_STATIC_LIBRARY +# include "unproject_in_mesh.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/embree/unproject_onto_mesh.cpp b/vendor/libigl/include/igl/embree/unproject_onto_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a9d336690c0801d6e9bf7378f4d7cff17f260f52 --- /dev/null +++ b/vendor/libigl/include/igl/embree/unproject_onto_mesh.cpp @@ -0,0 +1,59 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "unproject_onto_mesh.h" +#include "EmbreeIntersector.h" +#include "../unproject_onto_mesh.h" +#include + +IGL_INLINE bool igl::embree::unproject_onto_mesh( + const Eigen::Vector2f& pos, + const Eigen::MatrixXi& F, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const EmbreeIntersector & ei, + int& fid, + Eigen::Vector3f& bc) +{ + using namespace std; + using namespace Eigen; + const auto & shoot_ray = [&ei]( + const Eigen::Vector3f& s, + const Eigen::Vector3f& dir, + igl::Hit & hit)->bool + { + return ei.intersectRay(s,dir,hit); + }; + return igl::unproject_onto_mesh(pos,model,proj,viewport,shoot_ray,fid,bc); +} + +IGL_INLINE bool igl::embree::unproject_onto_mesh( + const Eigen::Vector2f& pos, + const Eigen::MatrixXi& F, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const EmbreeIntersector & ei, + int& fid, + int& vid) +{ + Eigen::Vector3f bc; + if(!igl::embree::unproject_onto_mesh(pos,F,model,proj,viewport,ei,fid,bc)) + { + return false; + } + int i; + bc.maxCoeff(&i); + vid = F(fid,i); + return true; +} + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/embree/unproject_onto_mesh.h b/vendor/libigl/include/igl/embree/unproject_onto_mesh.h new file mode 100644 index 0000000000000000000000000000000000000000..db0a2e0cba131394544c47177aa5e96c2db03578 --- /dev/null +++ b/vendor/libigl/include/igl/embree/unproject_onto_mesh.h @@ -0,0 +1,73 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_EMBREE_UNPROJECT_ONTO_MESH_H +#define IGL_EMBREE_UNPROJECT_ONTO_MESH_H +#include +#include + +#include + +namespace igl +{ + namespace embree + { + // Forward define + class EmbreeIntersector; + // Unproject a screen location (using the given model, proj and viewport) to find + // the first hit on a mesh. + // + // Inputs: + // pos screen space coordinates + // F #F by 3 face matrix + // model model matrix + // proj projection matrix + // viewport vieweport vector + // ei EmbreeIntersector containing (V,F) + // Outputs: + // fid id of the first face hit + // bc barycentric coordinates of hit + // Returns true if there is a hit + IGL_INLINE bool unproject_onto_mesh( + const Eigen::Vector2f& pos, + const Eigen::MatrixXi& F, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const EmbreeIntersector & ei, + int& fid, + Eigen::Vector3f& bc); + + // Unproject a screen location (using the given model, proj and viewport) to find + // the first face on the mesh and the closest vertex + // + // Inputs: + // pos screen space coordinates + // F #F by 3 face matrix + // model model matrix + // proj projection matrix + // viewport vieweport vector + // ei EmbreeIntersector containing (V,F) + // Outputs: + // fid id of the first face hit + // vid vertex id of the closest vertex hit + // Returns true if there is a hit + IGL_INLINE bool unproject_onto_mesh( + const Eigen::Vector2f& pos, + const Eigen::MatrixXi& F, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const EmbreeIntersector & ei, + int& fid, + int& vid); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "unproject_onto_mesh.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/exact_geodesic.cpp b/vendor/libigl/include/igl/exact_geodesic.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b758714f58507a0b7f3e5bb2dd4a05857fbdcfe6 --- /dev/null +++ b/vendor/libigl/include/igl/exact_geodesic.cpp @@ -0,0 +1,3224 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Zhongshi Jiang +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "exact_geodesic.h" + +//Copyright (C) 2008 Danil Kirsanov, MIT License +//Code from https://code.google.com/archive/p/geodesic/ +// Compiled into a single file by Zhongshi Jiang + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace igl{ +namespace geodesic{ + +//#include "geodesic_constants_and_simple_functions.h" + +//double const GEODESIC_INF = std::numeric_limits::max(); +double const GEODESIC_INF = 1e100; + +//in order to avoid numerical problems with "infinitely small" intervals, +//we drop all the intervals smaller than SMALLEST_INTERVAL_RATIO*edge_length +double const SMALLEST_INTERVAL_RATIO = 1e-6; +//double const SMALL_EPSILON = 1e-10; + + +inline double cos_from_edges(double const a, //compute the cosine of the angle given the lengths of the edges + double const b, + double const c) +{ + assert(a>1e-50); + assert(b>1e-50); + assert(c>1e-50); + + double result = (b*b + c*c - a*a)/(2.0*b*c); + result = std::max(result, -1.0); + return std::min(result, 1.0); +} + +inline double angle_from_edges(double const a, //compute the cosine of the angle given the lengths of the edges + double const b, + double const c) +{ + return acos(cos_from_edges(a,b,c)); +} + +template +inline bool read_mesh_from_file(char* filename, + Points& points, + Faces& faces) +{ + std::ifstream file(filename); + assert(file.is_open()); + if(!file.is_open()) return false; + + unsigned num_points; + file >> num_points; + assert(num_points>=3); + + unsigned num_faces; + file >> num_faces; + + points.resize(num_points*3); + for(typename Points::iterator i=points.begin(); i!=points.end(); ++i) + { + file >> *i; + } + + faces.resize(num_faces*3); + for(typename Faces::iterator i=faces.begin(); i!=faces.end(); ++i) + { + file >> *i; + } + file.close(); + + return true; +} + +// #include "geodesic_memory" +template //quickly allocates multiple elements of a given type; no deallocation +class SimlpeMemoryAllocator +{ +public: + typedef T* pointer; + + SimlpeMemoryAllocator(unsigned block_size = 0, + unsigned max_number_of_blocks = 0) + { + reset(block_size, + max_number_of_blocks); + }; + + ~SimlpeMemoryAllocator(){}; + + void reset(unsigned block_size, + unsigned max_number_of_blocks) + { + m_block_size = block_size; + m_max_number_of_blocks = max_number_of_blocks; + + + m_current_position = 0; + + m_storage.reserve(max_number_of_blocks); + m_storage.resize(1); + m_storage[0].resize(block_size); + }; + + pointer allocate(unsigned const n) //allocate n units + { + assert(n < m_block_size); + + if(m_current_position + n >= m_block_size) + { + m_storage.push_back( std::vector() ); + m_storage.back().resize(m_block_size); + m_current_position = 0; + } + pointer result = & m_storage.back()[m_current_position]; + m_current_position += n; + + return result; + }; +private: + std::vector > m_storage; + unsigned m_block_size; //size of a single block + unsigned m_max_number_of_blocks; //maximum allowed number of blocks + unsigned m_current_position; //first unused element inside the current block +}; + + +template //quickly allocates and deallocates single elements of a given type +class MemoryAllocator +{ +public: + typedef T* pointer; + + MemoryAllocator(unsigned block_size = 1024, + unsigned max_number_of_blocks = 1024) + { + reset(block_size, + max_number_of_blocks); + }; + + ~MemoryAllocator(){}; + + void clear() + { + reset(m_block_size, + m_max_number_of_blocks); + } + + void reset(unsigned block_size, + unsigned max_number_of_blocks) + { + m_block_size = block_size; + m_max_number_of_blocks = max_number_of_blocks; + + assert(m_block_size > 0); + assert(m_max_number_of_blocks > 0); + + m_current_position = 0; + + m_storage.reserve(max_number_of_blocks); + m_storage.resize(1); + m_storage[0].resize(block_size); + + m_deleted.clear(); + m_deleted.reserve(2*block_size); + }; + + pointer allocate() //allocates single unit of memory + { + pointer result; + if(m_deleted.empty()) + { + if(m_current_position + 1 >= m_block_size) + { + m_storage.push_back( std::vector() ); + m_storage.back().resize(m_block_size); + m_current_position = 0; + } + result = & m_storage.back()[m_current_position]; + ++m_current_position; + } + else + { + result = m_deleted.back(); + m_deleted.pop_back(); + } + + return result; + }; + + void deallocate(pointer p) //allocate n units + { + if(m_deleted.size() < m_deleted.capacity()) + { + m_deleted.push_back(p); + } + }; + +private: + std::vector > m_storage; + unsigned m_block_size; //size of a single block + unsigned m_max_number_of_blocks; //maximum allowed number of blocks + unsigned m_current_position; //first unused element inside the current block + + std::vector m_deleted; //pointers to deleted elemets +}; + + +class OutputBuffer +{ +public: + OutputBuffer(): + m_num_bytes(0) + {} + + void clear() + { + m_num_bytes = 0; + m_buffer = std::shared_ptr(); + } + + template + T* allocate(unsigned n) + { + double wanted = n*sizeof(T); + if(wanted > m_num_bytes) + { + unsigned new_size = (unsigned) ceil(wanted / (double)sizeof(double)); + m_buffer = std::shared_ptr(new double[new_size]); + m_num_bytes = new_size*sizeof(double); + } + + return (T*)m_buffer.get(); + } + + template + T* get() + { + return (T*)m_buffer.get(); + } + + template + unsigned capacity() + { + return (unsigned)floor((double)m_num_bytes/(double)sizeof(T)); + }; + +private: + + std::shared_ptr m_buffer; + unsigned m_num_bytes; +}; + + + + +class Vertex; +class Edge; +class Face; +class Mesh; +class MeshElementBase; + +typedef Vertex* vertex_pointer; +typedef Edge* edge_pointer; +typedef Face* face_pointer; +typedef Mesh* mesh_pointer; +typedef MeshElementBase* base_pointer; + +template //simple vector that stores info about mesh references +class SimpleVector //for efficiency, it uses an outside memory allocator +{ +public: + SimpleVector(): + m_size(0), + m_begin(NULL) + {}; + + typedef Data* iterator; + + unsigned size(){return m_size;}; + iterator begin(){return m_begin;}; + iterator end(){return m_begin + m_size;}; + + template + void set_allocation(DataPointer begin, unsigned size) + { + assert(begin != NULL || size == 0); + m_size = size; + m_begin = (iterator)begin; + } + + Data& operator[](unsigned i) + { + assert(i < m_size); + return *(m_begin + i); + } + + void clear() + { + m_size = 0; + m_begin = NULL; + } + +private: + unsigned m_size; + Data* m_begin; +}; + +enum PointType +{ + VERTEX, + EDGE, + FACE, + UNDEFINED_POINT +}; + +class MeshElementBase //prototype of vertices, edges and faces +{ +public: + typedef SimpleVector vertex_pointer_vector; + typedef SimpleVector edge_pointer_vector; + typedef SimpleVector face_pointer_vector; + + MeshElementBase(): + m_id(0), + m_type(UNDEFINED_POINT) + {}; + + vertex_pointer_vector& adjacent_vertices(){return m_adjacent_vertices;}; + edge_pointer_vector& adjacent_edges(){return m_adjacent_edges;}; + face_pointer_vector& adjacent_faces(){return m_adjacent_faces;}; + + unsigned& id(){return m_id;}; + PointType type(){return m_type;}; + +protected: + vertex_pointer_vector m_adjacent_vertices; //list of the adjacent vertices + edge_pointer_vector m_adjacent_edges; //list of the adjacent edges + face_pointer_vector m_adjacent_faces; //list of the adjacent faces + + unsigned m_id; //unique id + PointType m_type; //vertex, edge or face +}; + +class Point3D //point in 3D and corresponding operations +{ +public: + Point3D(){}; + Point3D(Point3D* p) + { + x() = p->x(); + y() = p->y(); + z() = p->z(); + }; + + double* xyz(){return m_coordinates;}; + double& x(){return *m_coordinates;}; + double& y(){return *(m_coordinates+1);}; + double& z(){return *(m_coordinates+2);}; + + void set(double new_x, double new_y, double new_z) + { + x() = new_x; + y() = new_y; + z() = new_z; + } + + void set(double* data) + { + x() = *data; + y() = *(data+1); + z() = *(data+2); + } + + double distance(double* v) + { + double dx = m_coordinates[0] - v[0]; + double dy = m_coordinates[1] - v[1]; + double dz = m_coordinates[2] - v[2]; + + return sqrt(dx*dx + dy*dy + dz*dz); + }; + + double distance(Point3D* v) + { + return distance(v->xyz()); + }; + + void add(Point3D* v) + { + x() += v->x(); + y() += v->y(); + z() += v->z(); + }; + + void multiply(double v) + { + x() *= v; + y() *= v; + z() *= v; + }; + +private: + double m_coordinates[3]; //xyz +}; + +class Vertex: public MeshElementBase, public Point3D +{ +public: + Vertex() + { + m_type = VERTEX; + }; + + ~Vertex(){}; + + bool& saddle_or_boundary(){return m_saddle_or_boundary;}; +private: + //this flag speeds up exact geodesic algorithm + bool m_saddle_or_boundary; //it is true if total adjacent angle is larger than 2*PI or this vertex belongs to the mesh boundary +}; + + +class Face: public MeshElementBase +{ +public: + Face() + { + m_type = FACE; + }; + + ~Face(){}; + + edge_pointer opposite_edge(vertex_pointer v); + vertex_pointer opposite_vertex(edge_pointer e); + edge_pointer next_edge(edge_pointer e, vertex_pointer v); + + double vertex_angle(vertex_pointer v) + { + for(unsigned i=0; i<3; ++i) + { + if(adjacent_vertices()[i]->id() == v->id()) + { + return m_corner_angles[i]; + } + } + assert(0); + return 0; + } + + double* corner_angles(){return m_corner_angles;}; + +private: + double m_corner_angles[3]; //triangle angles in radians; angles correspond to vertices in m_adjacent_vertices +}; + +class Edge: public MeshElementBase +{ +public: + Edge() + { + m_type = EDGE; + }; + + ~Edge(){}; + + double& length(){return m_length;}; + + face_pointer opposite_face(face_pointer f) + { + if(adjacent_faces().size() == 1) + { + assert(adjacent_faces()[0]->id() == f->id()); + return NULL; + } + + assert(adjacent_faces()[0]->id() == f->id() || + adjacent_faces()[1]->id() == f->id()); + + return adjacent_faces()[0]->id() == f->id() ? + adjacent_faces()[1] : adjacent_faces()[0]; + }; + + vertex_pointer opposite_vertex(vertex_pointer v) + { + assert(belongs(v)); + + return adjacent_vertices()[0]->id() == v->id() ? + adjacent_vertices()[1] : adjacent_vertices()[0]; + }; + + bool belongs(vertex_pointer v) + { + return adjacent_vertices()[0]->id() == v->id() || + adjacent_vertices()[1]->id() == v->id(); + } + + bool is_boundary(){return adjacent_faces().size() == 1;}; + + vertex_pointer v0(){return adjacent_vertices()[0];}; + vertex_pointer v1(){return adjacent_vertices()[1];}; + + void local_coordinates(Point3D* point, + double& x, + double& y) + { + double d0 = point->distance(v0()); + if(d0 < 1e-50) + { + x = 0.0; + y = 0.0; + return; + } + + double d1 = point->distance(v1()); + if(d1 < 1e-50) + { + x = m_length; + y = 0.0; + return; + } + + x = m_length/2.0 + (d0*d0 - d1*d1)/(2.0*m_length); + y = sqrt(std::max(0.0, d0*d0 - x*x)); + return; + } + +private: + double m_length; //length of the edge +}; + +class SurfacePoint:public Point3D //point on the surface of the mesh +{ +public: + SurfacePoint(): + m_p(NULL) + {}; + + SurfacePoint(vertex_pointer v): //set the surface point in the vertex + SurfacePoint::Point3D(v), + m_p(v) + {}; + + SurfacePoint(face_pointer f): //set the surface point in the center of the face + m_p(f) + { + set(0,0,0); + add(f->adjacent_vertices()[0]); + add(f->adjacent_vertices()[1]); + add(f->adjacent_vertices()[2]); + multiply(1./3.); + }; + + SurfacePoint(edge_pointer e, //set the surface point in the middle of the edge + double a = 0.5): + m_p(e) + { + double b = 1 - a; + + vertex_pointer v0 = e->adjacent_vertices()[0]; + vertex_pointer v1 = e->adjacent_vertices()[1]; + + x() = b*v0->x() + a*v1->x(); + y() = b*v0->y() + a*v1->y(); + z() = b*v0->z() + a*v1->z(); + }; + + SurfacePoint(base_pointer g, + double x, + double y, + double z, + PointType t = UNDEFINED_POINT): + m_p(g) + { + set(x,y,z); + }; + + void initialize(SurfacePoint const& p) + { + *this = p; + } + + ~SurfacePoint(){}; + + PointType type(){return m_p ? m_p->type() : UNDEFINED_POINT;}; + base_pointer& base_element(){return m_p;}; +protected: + base_pointer m_p; //could be face, vertex or edge pointer +}; + +inline edge_pointer Face::opposite_edge(vertex_pointer v) +{ + for(unsigned i=0; i<3; ++i) + { + edge_pointer e = adjacent_edges()[i]; + if(!e->belongs(v)) + { + return e; + } + } + assert(0); + return NULL; +} + +inline vertex_pointer Face::opposite_vertex(edge_pointer e) +{ + for(unsigned i=0; i<3; ++i) + { + vertex_pointer v = adjacent_vertices()[i]; + if(!e->belongs(v)) + { + return v; + } + } + assert(0); + return NULL; +} + +inline edge_pointer Face::next_edge(edge_pointer e, vertex_pointer v) +{ + assert(e->belongs(v)); + + for(unsigned i=0; i<3; ++i) + { + edge_pointer next = adjacent_edges()[i]; + if(e->id() != next->id() && next->belongs(v)) + { + return next; + } + } + assert(0); + return NULL; +} + +struct HalfEdge //prototype of the edge; used for mesh construction +{ + unsigned face_id; + unsigned vertex_0; //adjacent vertices sorted by id value + unsigned vertex_1; //they are sorted, vertex_0 < vertex_1 +}; + +inline bool operator < (const HalfEdge &x, const HalfEdge &y) +{ + if(x.vertex_0 == y.vertex_0) + { + return x.vertex_1 < y.vertex_1; + } + else + { + return x.vertex_0 < y.vertex_0; + } +} + +inline bool operator != (const HalfEdge &x, const HalfEdge &y) +{ + return x.vertex_0 != y.vertex_0 || x.vertex_1 != y.vertex_1; +} + +inline bool operator == (const HalfEdge &x, const HalfEdge &y) +{ + return x.vertex_0 == y.vertex_0 && x.vertex_1 == y.vertex_1; +} + +struct edge_visible_from_source +{ + unsigned source; + edge_pointer edge; +}; + +class Mesh +{ +public: + Mesh() + {}; + + ~Mesh(){}; + + template + void initialize_mesh_data(unsigned num_vertices, + Points& p, + unsigned num_faces, + Faces& tri); //build mesh from regular point-triangle representation + + template + void initialize_mesh_data(Points& p, Faces& tri); //build mesh from regular point-triangle representation + + std::vector& vertices(){return m_vertices;}; + std::vector& edges(){return m_edges;}; + std::vector& faces(){return m_faces;}; + + unsigned closest_vertices(SurfacePoint* p, + std::vector* storage = NULL); //list vertices closest to the point + +private: + + void build_adjacencies(); //build internal structure of the mesh + bool verify(); //verifies connectivity of the mesh and prints some debug info + + typedef void* void_pointer; + void_pointer allocate_pointers(unsigned n) + { + return m_pointer_allocator.allocate(n); + } + + std::vector m_vertices; + std::vector m_edges; + std::vector m_faces; + + SimlpeMemoryAllocator m_pointer_allocator; //fast memory allocating for Face/Vertex/Edge cross-references +}; + +inline unsigned Mesh::closest_vertices(SurfacePoint* p, + std::vector* storage) +{ + assert(p->type() != UNDEFINED_POINT); + + if(p->type() == VERTEX) + { + if(storage) + { + storage->push_back(static_cast(p->base_element())); + } + return 1; + } + else if(p->type() == FACE) + { + if(storage) + { + vertex_pointer* vp= p->base_element()->adjacent_vertices().begin(); + storage->push_back(*vp); + storage->push_back(*(vp+1)); + storage->push_back(*(vp+2)); + } + return 2; + } + else if(p->type() == EDGE) //for edge include all 4 adjacent vertices + { + edge_pointer edge = static_cast(p->base_element()); + + if(storage) + { + storage->push_back(edge->adjacent_vertices()[0]); + storage->push_back(edge->adjacent_vertices()[1]); + + for(unsigned i = 0; i < edge->adjacent_faces().size(); ++i) + { + face_pointer face = edge->adjacent_faces()[i]; + storage->push_back(face->opposite_vertex(edge)); + } + } + return 2 + edge->adjacent_faces().size(); + } + + assert(0); + return 0; +} + +template +void Mesh::initialize_mesh_data(Points& p, Faces& tri) //build mesh from regular point-triangle representation +{ + assert(p.size() % 3 == 0); + unsigned const num_vertices = p.size() / 3; + assert(tri.size() % 3 == 0); + unsigned const num_faces = tri.size() / 3; + + initialize_mesh_data(num_vertices, p, num_faces, tri); +} + +template +void Mesh::initialize_mesh_data(unsigned num_vertices, + Points& p, + unsigned num_faces, + Faces& tri) +{ + unsigned const approximate_number_of_internal_pointers = (num_vertices + num_faces)*4; + unsigned const max_number_of_pointer_blocks = 100; + m_pointer_allocator.reset(approximate_number_of_internal_pointers, + max_number_of_pointer_blocks); + + m_vertices.resize(num_vertices); + for(unsigned i=0; iadjacent Faces + std::vector count(m_vertices.size()); //count adjacent vertices + for(unsigned i=0; iid(); + assert(vertex_id < m_vertices.size()); + count[vertex_id]++; + } + } + + for(unsigned i=0; iadjacent_faces()[count[v->id()]++] = &f; + } + } + + //find all edges + //i.e. find all half-edges, sort and combine them into edges + std::vector half_edges(m_faces.size()*3); + unsigned k = 0; + for(unsigned i=0; iid(); + unsigned vertex_id_2 = f.adjacent_vertices()[(j+1) % 3]->id(); + half_edges[k].vertex_0 = std::min(vertex_id_1, vertex_id_2); + half_edges[k].vertex_1 = std::max(vertex_id_1, vertex_id_2); + + k++; + } + } + std::sort(half_edges.begin(), half_edges.end()); + + unsigned number_of_edges = 1; + for(unsigned i=1; iadjacent Vertices and Faces + m_edges.resize(number_of_edges); + unsigned edge_id = 0; + for(unsigned i=0; idistance(e.adjacent_vertices()[1]); + assert(e.length() > 1e-100); //algorithm works well with non-degenerate meshes only + + if(i != half_edges.size()-1 && half_edges[i] == half_edges[i+1]) //double edge + { + e.adjacent_faces().set_allocation(allocate_pointers(2),2); + e.adjacent_faces()[0] = &m_faces[half_edges[i].face_id]; + e.adjacent_faces()[1] = &m_faces[half_edges[i+1].face_id]; + i += 2; + } + else //single edge + { + e.adjacent_faces().set_allocation(allocate_pointers(1),1); //one adjucent faces + e.adjacent_faces()[0] = &m_faces[half_edges[i].face_id]; + i += 1; + } + } + + // Vertices->adjacent Edges + std::fill(count.begin(), count.end(), 0); + for(unsigned i=0; iid()]++; + count[e.adjacent_vertices()[1]->id()]++; + } + for(unsigned i=0; iadjacent_edges()[count[v->id()]++] = &e; + } + } + + // Faces->adjacent Edges + for(unsigned i=0; iid()]<3); + f->adjacent_edges()[count[f->id()]++] = &e; + } + } + + //compute angles for the faces + for(unsigned i=0; ilength(); + } + + double angle = angle_from_edges(abc[0], abc[1], abc[2]); + assert(angle>1e-5); //algorithm works well with non-degenerate meshes only + + f.corner_angles()[j] = angle; + sum += angle; + } + assert(std::abs(sum - igl::PI) < 1e-5); //algorithm works well with non-degenerate meshes only + } + + //define m_turn_around_flag for vertices + std::vector total_vertex_angle(m_vertices.size()); + for(unsigned i=0; iid()] += f.corner_angles()[j]; + } + } + + for(unsigned i=0; i 2.0*igl::PI - 1e-5); + } + + for(unsigned i=0; isaddle_or_boundary() = true; + e.adjacent_vertices()[1]->saddle_or_boundary() = true; + } + } + + assert(verify()); +} + +inline bool Mesh::verify() //verifies connectivity of the mesh and prints some debug info +{ + // make sure that all vertices are mentioned at least once. + // though the loose vertex is not a bug, it most likely indicates that something is wrong with the mesh + std::vector map(m_vertices.size(), false); + for(unsigned i=0; iadjacent_vertices()[0]->id()] = true; + map[e->adjacent_vertices()[1]->id()] = true; + } + assert(std::find(map.begin(), map.end(), false) == map.end()); + + //make sure that the mesh is connected trough its edges + //if mesh has more than one connected component, it is most likely a bug + std::vector stack(1,&m_faces[0]); + stack.reserve(m_faces.size()); + + map.resize(m_faces.size()); + std::fill(map.begin(), map.end(), false); + map[0] = true; + + while(!stack.empty()) + { + face_pointer f = stack.back(); + stack.pop_back(); + + for(unsigned i=0; i<3; ++i) + { + edge_pointer e = f->adjacent_edges()[i]; + face_pointer f_adjacent = e->opposite_face(f); + if(f_adjacent && !map[f_adjacent->id()]) + { + map[f_adjacent->id()] = true; + stack.push_back(f_adjacent); + } + } + } + assert(std::find(map.begin(), map.end(), false) == map.end()); + + //print some mesh statistics that can be useful in debugging + // std::cout << "mesh has " << m_vertices.size() + // << " vertices, " << m_faces.size() + // << " faces, " << m_edges.size() + // << " edges\n"; + + unsigned total_boundary_edges = 0; + double longest_edge = 0; + double shortest_edge = 1e100; + for(unsigned i=0; iset(data); + unsigned type = (unsigned) data[3]; + unsigned id = (unsigned) data[4]; + + + if(type == 0) //vertex + { + point->base_element() = &mesh->vertices()[id]; + } + else if(type == 1) //edge + { + point->base_element() = &mesh->edges()[id]; + } + else //face + { + point->base_element() = &mesh->faces()[id]; + } +} + +inline void fill_surface_point_double(geodesic::SurfacePoint* point, + double* data, + long mesh_id) +{ + data[0] = point->x(); + data[1] = point->y(); + data[2] = point->z(); + data[4] = point->base_element()->id(); + + if(point->type() == VERTEX) //vertex + { + data[3] = 0; + } + else if(point->type() == EDGE) //edge + { + data[3] = 1; + } + else //face + { + data[3] = 2; + } +} + +class Interval; +class IntervalList; +typedef Interval* interval_pointer; +typedef IntervalList* list_pointer; + +class Interval //interval of the edge +{ +public: + + Interval(){}; + ~Interval(){}; + + enum DirectionType + { + FROM_FACE_0, + FROM_FACE_1, + FROM_SOURCE, + UNDEFINED_DIRECTION + }; + + double signal(double x) //geodesic distance function at point x + { + assert(x>=0.0 && x <= m_edge->length()); + + if(m_d == GEODESIC_INF) + { + return GEODESIC_INF; + } + else + { + double dx = x - m_pseudo_x; + if(m_pseudo_y == 0.0) + { + return m_d + std::abs(dx); + } + else + { + return m_d + sqrt(dx*dx + m_pseudo_y*m_pseudo_y); + } + } + } + + double max_distance(double end) + { + if(m_d == GEODESIC_INF) + { + return GEODESIC_INF; + } + else + { + double a = std::abs(m_start - m_pseudo_x); + double b = std::abs(end - m_pseudo_x); + + return a > b ? m_d + sqrt(a*a + m_pseudo_y*m_pseudo_y): + m_d + sqrt(b*b + m_pseudo_y*m_pseudo_y); + } + } + + void compute_min_distance(double stop) //compute min, given c,d theta, start, end. + { + assert(stop > m_start); + + if(m_d == GEODESIC_INF) + { + m_min = GEODESIC_INF; + } + else if(m_start > m_pseudo_x) + { + m_min = signal(m_start); + } + else if(stop < m_pseudo_x) + { + m_min = signal(stop); + } + else + { + assert(m_pseudo_y<=0); + m_min = m_d - m_pseudo_y; + } + } + //compare two intervals in the queue + bool operator()(interval_pointer const x, interval_pointer const y) const + { + if(x->min() != y->min()) + { + return x->min() < y->min(); + } + else if(x->start() != y->start()) + { + return x->start() < y->start(); + } + else + { + return x->edge()->id() < y->edge()->id(); + } + } + + double stop() //return the endpoint of the interval + { + return m_next ? m_next->start() : m_edge->length(); + } + + double hypotenuse(double a, double b) + { + return sqrt(a*a + b*b); + } + + void find_closest_point(double const x, + double const y, + double& offset, + double& distance); //find the point on the interval that is closest to the point (alpha, s) + + double& start(){return m_start;}; + double& d(){return m_d;}; + double& pseudo_x(){return m_pseudo_x;}; + double& pseudo_y(){return m_pseudo_y;}; + double& min(){return m_min;}; + interval_pointer& next(){return m_next;}; + edge_pointer& edge(){return m_edge;}; + DirectionType& direction(){return m_direction;}; + bool visible_from_source(){return m_direction == FROM_SOURCE;}; + unsigned& source_index(){return m_source_index;}; + + void initialize(edge_pointer edge, + SurfacePoint* point = NULL, + unsigned source_index = 0); + +protected: + double m_start; //initial point of the interval on the edge + double m_d; //distance from the source to the pseudo-source + double m_pseudo_x; //coordinates of the pseudo-source in the local coordinate system + double m_pseudo_y; //y-coordinate should be always negative + double m_min; //minimum distance on the interval + + interval_pointer m_next; //pointer to the next interval in the list + edge_pointer m_edge; //edge that the interval belongs to + unsigned m_source_index; //the source it belongs to + DirectionType m_direction; //where the interval is coming from +}; + +struct IntervalWithStop : public Interval +{ +public: + double& stop(){return m_stop;}; +protected: + double m_stop; +}; + +class IntervalList //list of the of intervals of the given edge +{ +public: + IntervalList(){m_first = NULL;}; + ~IntervalList(){}; + + void clear() + { + m_first = NULL; + }; + + void initialize(edge_pointer e) + { + m_edge = e; + m_first = NULL; + }; + + interval_pointer covering_interval(double offset) //returns the interval that covers the offset + { + assert(offset >= 0.0 && offset <= m_edge->length()); + + interval_pointer p = m_first; + while(p && p->stop() < offset) + { + p = p->next(); + } + + return p;// && p->start() <= offset ? p : NULL; + }; + + void find_closest_point(SurfacePoint* point, + double& offset, + double& distance, + interval_pointer& interval) + { + interval_pointer p = m_first; + distance = GEODESIC_INF; + interval = NULL; + + double x,y; + m_edge->local_coordinates(point, x, y); + + while(p) + { + if(p->min()find_closest_point(x, y, o, d); + if(d < distance) + { + distance = d; + offset = o; + interval = p; + } + } + p = p->next(); + } + }; + + unsigned number_of_intervals() + { + interval_pointer p = m_first; + unsigned count = 0; + while(p) + { + ++count; + p = p->next(); + } + return count; + } + + interval_pointer last() + { + interval_pointer p = m_first; + if(p) + { + while(p->next()) + { + p = p->next(); + } + } + return p; + } + + double signal(double x) + { + interval_pointer interval = covering_interval(x); + + return interval ? interval->signal(x) : GEODESIC_INF; + } + + interval_pointer& first(){return m_first;}; + edge_pointer& edge(){return m_edge;}; +private: + interval_pointer m_first; //pointer to the first member of the list + edge_pointer m_edge; //edge that owns this list +}; + +class SurfacePointWithIndex : public SurfacePoint +{ +public: + unsigned index(){return m_index;}; + + void initialize(SurfacePoint& p, unsigned index) + { + SurfacePoint::initialize(p); + m_index = index; + } + + bool operator()(SurfacePointWithIndex* x, SurfacePointWithIndex* y) const //used for sorting + { + assert(x->type() != UNDEFINED_POINT && y->type() !=UNDEFINED_POINT); + + if(x->type() != y->type()) + { + return x->type() < y->type(); + } + else + { + return x->base_element()->id() < y->base_element()->id(); + } + } + +private: + unsigned m_index; +}; + +class SortedSources : public std::vector +{ +private: + typedef std::vector sorted_vector_type; +public: + typedef sorted_vector_type::iterator sorted_iterator; + typedef std::pair sorted_iterator_pair; + + sorted_iterator_pair sources(base_pointer mesh_element) + { + m_search_dummy.base_element() = mesh_element; + + return equal_range(m_sorted.begin(), + m_sorted.end(), + &m_search_dummy, + m_compare_less); + } + + void initialize(std::vector& sources) //we initialize the sources by copie + { + resize(sources.size()); + m_sorted.resize(sources.size()); + for(unsigned i=0; ilength(); + if(std::abs(hs+hc) < local_epsilon) + { + if(rs<=m_start) + { + r = m_start; + d_out = signal(m_start) + std::abs(rs - m_start); + } + else if(rs>=end) + { + r = end; + d_out = signal(end) + fabs(end - rs); + } + else + { + r = rs; + d_out = signal(rs); + } + } + else + { + double ri = (rs*hc + hs*rc)/(hs+hc); + + if(riend) + { + r = end; + d_out = signal(end) + hypotenuse(end - rs, hs); + } + else + { + r = ri; + d_out = m_d + hypotenuse(rc - rs, hc + hs); + } + } + } + + +inline void Interval::initialize(edge_pointer edge, + SurfacePoint* source, + unsigned source_index) +{ + m_next = NULL; + //m_geodesic_previous = NULL; + m_direction = UNDEFINED_DIRECTION; + m_edge = edge; + m_source_index = source_index; + + m_start = 0.0; + //m_stop = edge->length(); + if(!source) + { + m_d = GEODESIC_INF; + m_min = GEODESIC_INF; + return; + } + m_d = 0; + + if(source->base_element()->type() == VERTEX) + { + if(source->base_element()->id() == edge->v0()->id()) + { + m_pseudo_x = 0.0; + m_pseudo_y = 0.0; + m_min = 0.0; + return; + } + else if(source->base_element()->id() == edge->v1()->id()) + { + m_pseudo_x = stop(); + m_pseudo_y = 0.0; + m_min = 0.0; + return; + } + } + + edge->local_coordinates(source, m_pseudo_x, m_pseudo_y); + m_pseudo_y = -m_pseudo_y; + + compute_min_distance(stop()); +} + + + +// #include "geodesic_algorithm_base.h" +class GeodesicAlgorithmBase +{ +public: + enum AlgorithmType + { + EXACT, + DIJKSTRA, + SUBDIVISION, + UNDEFINED_ALGORITHM + }; + + GeodesicAlgorithmBase(geodesic::Mesh* mesh): + m_type(UNDEFINED_ALGORITHM), + m_max_propagation_distance(1e100), + m_mesh(mesh) + {}; + + virtual ~GeodesicAlgorithmBase(){}; + + virtual void propagate(std::vector& sources, + double max_propagation_distance = GEODESIC_INF, //propagation algorithm stops after reaching the certain distance from the source + std::vector* stop_points = NULL) = 0; //or after ensuring that all the stop_points are covered + + virtual void trace_back(SurfacePoint& destination, //trace back piecewise-linear path + std::vector& path) = 0; + + void geodesic(SurfacePoint& source, + SurfacePoint& destination, + std::vector& path); //lazy people can find geodesic path with one function call + + void geodesic(std::vector& sources, + std::vector& destinations, + std::vector >& paths); //lazy people can find geodesic paths with one function call + + virtual unsigned best_source(SurfacePoint& point, //after propagation step is done, quickly find what source this point belongs to and what is the distance to this source + double& best_source_distance) = 0; + + virtual void print_statistics() //print info about timing and memory usage in the propagation step of the algorithm + { + std::cout << "propagation step took " << m_time_consumed << " seconds " << std::endl; + }; + + AlgorithmType type(){return m_type;}; + + virtual std::string name(); + + geodesic::Mesh* mesh(){return m_mesh;}; +protected: + + void set_stop_conditions(std::vector* stop_points, + double stop_distance); + double stop_distance() + { + return m_max_propagation_distance; + } + + AlgorithmType m_type; // type of the algorithm + + typedef std::pair stop_vertex_with_distace_type; + std::vector m_stop_vertices; // algorithm stops propagation after covering certain vertices + double m_max_propagation_distance; // or reaching the certain distance + + geodesic::Mesh* m_mesh; + + double m_time_consumed; //how much time does the propagation step takes + double m_propagation_distance_stopped; //at what distance (if any) the propagation algorithm stopped +}; + +inline double length(std::vector& path) +{ + double length = 0; + if(!path.empty()) + { + for(unsigned i=0; i& path) +{ + std::cout << "number of the points in the path = " << path.size() + << ", length of the path = " << length(path) + << std::endl; +} + +inline std::string GeodesicAlgorithmBase::name() +{ + switch(m_type) + { + case EXACT: + return "exact"; + case DIJKSTRA: + return "dijkstra"; + case SUBDIVISION: + return "subdivision"; + default: + case UNDEFINED_ALGORITHM: + return "undefined"; + } +} + +inline void GeodesicAlgorithmBase::geodesic(SurfacePoint& source, + SurfacePoint& destination, + std::vector& path) //lazy people can find geodesic path with one function call +{ + std::vector sources(1, source); + std::vector stop_points(1, destination); + double const max_propagation_distance = GEODESIC_INF; + + propagate(sources, + max_propagation_distance, + &stop_points); + + trace_back(destination, path); +} + +inline void GeodesicAlgorithmBase::geodesic(std::vector& sources, + std::vector& destinations, + std::vector >& paths) //lazy people can find geodesic paths with one function call +{ + double const max_propagation_distance = GEODESIC_INF; + + propagate(sources, + max_propagation_distance, + &destinations); //we use desinations as stop points + + paths.resize(destinations.size()); + + for(unsigned i=0; i* stop_points, + double stop_distance) +{ + m_max_propagation_distance = stop_distance; + + if(!stop_points) + { + m_stop_vertices.clear(); + return; + } + + m_stop_vertices.resize(stop_points->size()); + + std::vector possible_vertices; + for(unsigned i = 0; i < stop_points->size(); ++i) + { + SurfacePoint* point = &(*stop_points)[i]; + + possible_vertices.clear(); + m_mesh->closest_vertices(point, &possible_vertices); + + vertex_pointer closest_vertex = NULL; + double min_distance = 1e100; + for(unsigned j = 0; j < possible_vertices.size(); ++j) + { + double distance = point->distance(possible_vertices[j]); + if(distance < min_distance) + { + min_distance = distance; + closest_vertex = possible_vertices[j]; + } + } + assert(closest_vertex); + + m_stop_vertices[i].first = closest_vertex; + m_stop_vertices[i].second = min_distance; + } +} + + + +class GeodesicAlgorithmExact : public GeodesicAlgorithmBase +{ +public: + GeodesicAlgorithmExact(geodesic::Mesh* mesh): + GeodesicAlgorithmBase(mesh), + m_memory_allocator(mesh->edges().size(), mesh->edges().size()), + m_edge_interval_lists(mesh->edges().size()) + { + m_type = EXACT; + + for(unsigned i=0; iedges()[i]); + } + }; + + ~GeodesicAlgorithmExact(){}; + + void propagate(std::vector& sources, + double max_propagation_distance = GEODESIC_INF, //propagation algorithm stops after reaching the certain distance from the source + std::vector* stop_points = NULL); //or after ensuring that all the stop_points are covered + + void trace_back(SurfacePoint& destination, //trace back piecewise-linear path + std::vector& path); + + unsigned best_source(SurfacePoint& point, //quickly find what source this point belongs to and what is the distance to this source + double& best_source_distance); + + void print_statistics(); + +private: + typedef std::set IntervalQueue; + + void update_list_and_queue(list_pointer list, + IntervalWithStop* candidates, //up to two candidates + unsigned num_candidates); + + unsigned compute_propagated_parameters(double pseudo_x, + double pseudo_y, + double d, //parameters of the interval + double start, + double end, //start/end of the interval + double alpha, //corner angle + double L, //length of the new edge + bool first_interval, //if it is the first interval on the edge + bool last_interval, + bool turn_left, + bool turn_right, + IntervalWithStop* candidates); //if it is the last interval on the edge + + void construct_propagated_intervals(bool invert, + edge_pointer edge, + face_pointer face, //constructs iNew from the rest of the data + IntervalWithStop* candidates, + unsigned& num_candidates, + interval_pointer source_interval); + + double compute_positive_intersection(double start, + double pseudo_x, + double pseudo_y, + double sin_alpha, + double cos_alpha); //used in construct_propagated_intervals + + unsigned intersect_intervals(interval_pointer zero, + IntervalWithStop* one); //intersecting two intervals with up to three intervals in the end + + interval_pointer best_first_interval(SurfacePoint& point, + double& best_total_distance, + double& best_interval_position, + unsigned& best_source_index); + + bool check_stop_conditions(unsigned& index); + + void clear() + { + m_memory_allocator.clear(); + m_queue.clear(); + for(unsigned i=0; iid()]; + }; + + void set_sources(std::vector& sources) + { + m_sources.initialize(sources); + } + + void initialize_propagation_data(); + + void list_edges_visible_from_source(MeshElementBase* p, + std::vector& storage); //used in initialization + + long visible_from_source(SurfacePoint& point); //used in backtracing + + void best_point_on_the_edge_set(SurfacePoint& point, + std::vector const& storage, + interval_pointer& best_interval, + double& best_total_distance, + double& best_interval_position); + + void possible_traceback_edges(SurfacePoint& point, + std::vector& storage); + + bool erase_from_queue(interval_pointer p); + + IntervalQueue m_queue; //interval queue + + MemoryAllocator m_memory_allocator; //quickly allocate and deallocate intervals + std::vector m_edge_interval_lists; //every edge has its interval data + + enum MapType {OLD, NEW}; //used for interval intersection + MapType map[5]; + double start[6]; + interval_pointer i_new[5]; + + unsigned m_queue_max_size; //used for statistics + unsigned m_iterations; //used for statistics + + SortedSources m_sources; +}; + +inline void GeodesicAlgorithmExact::best_point_on_the_edge_set(SurfacePoint& point, + std::vector const& storage, + interval_pointer& best_interval, + double& best_total_distance, + double& best_interval_position) +{ + best_total_distance = 1e100; + for(unsigned i=0; ifind_closest_point(&point, + offset, + distance, + interval); + + if(distance < best_total_distance) + { + best_interval = interval; + best_total_distance = distance; + best_interval_position = offset; + } + } +} + +inline void GeodesicAlgorithmExact::possible_traceback_edges(SurfacePoint& point, + std::vector& storage) +{ + storage.clear(); + + if(point.type() == VERTEX) + { + vertex_pointer v = static_cast(point.base_element()); + for(unsigned i=0; iadjacent_faces().size(); ++i) + { + face_pointer f = v->adjacent_faces()[i]; + storage.push_back(f->opposite_edge(v)); + } + } + else if(point.type() == EDGE) + { + edge_pointer e = static_cast(point.base_element()); + for(unsigned i=0; iadjacent_faces().size(); ++i) + { + face_pointer f = e->adjacent_faces()[i]; + + storage.push_back(f->next_edge(e,e->v0())); + storage.push_back(f->next_edge(e,e->v1())); + } + } + else + { + face_pointer f = static_cast(point.base_element()); + storage.push_back(f->adjacent_edges()[0]); + storage.push_back(f->adjacent_edges()[1]); + storage.push_back(f->adjacent_edges()[2]); + } +} + + +inline long GeodesicAlgorithmExact::visible_from_source(SurfacePoint& point) //negative if not visible +{ + assert(point.type() != UNDEFINED_POINT); + + if(point.type() == EDGE) + { + edge_pointer e = static_cast(point.base_element()); + list_pointer list = interval_list(e); + double position = std::min(point.distance(e->v0()), e->length()); + interval_pointer interval = list->covering_interval(position); + //assert(interval); + if(interval && interval->visible_from_source()) + { + return (long)interval->source_index(); + } + else + { + return -1; + } + } + else if(point.type() == FACE) + { + return -1; + } + else if(point.type() == VERTEX) + { + vertex_pointer v = static_cast(point.base_element()); + for(unsigned i=0; iadjacent_edges().size(); ++i) + { + edge_pointer e = v->adjacent_edges()[i]; + list_pointer list = interval_list(e); + + double position = e->v0()->id() == v->id() ? 0.0 : e->length(); + interval_pointer interval = list->covering_interval(position); + if(interval && interval->visible_from_source()) + { + return (long)interval->source_index(); + } + } + + return -1; + } + + assert(0); + return 0; +} + +inline double GeodesicAlgorithmExact::compute_positive_intersection(double start, + double pseudo_x, + double pseudo_y, + double sin_alpha, + double cos_alpha) +{ + assert(pseudo_y < 0); + + double denominator = sin_alpha*(pseudo_x - start) - cos_alpha*pseudo_y; + if(denominator<0.0) + { + return -1.0; + } + + double numerator = -pseudo_y*start; + + if(numerator < 1e-30) + { + return 0.0; + } + + if(denominator < 1e-30) + { + return -1.0; + } + + return numerator/denominator; +} + +inline void GeodesicAlgorithmExact::list_edges_visible_from_source(MeshElementBase* p, + std::vector& storage) +{ + assert(p->type() != UNDEFINED_POINT); + + if(p->type() == FACE) + { + face_pointer f = static_cast(p); + for(unsigned i=0; i<3; ++i) + { + storage.push_back(f->adjacent_edges()[i]); + } + } + else if(p->type() == EDGE) + { + edge_pointer e = static_cast(p); + storage.push_back(e); + } + else //VERTEX + { + vertex_pointer v = static_cast(p); + for(unsigned i=0; iadjacent_edges().size(); ++i) + { + storage.push_back(v->adjacent_edges()[i]); + } + + } +} + +inline bool GeodesicAlgorithmExact::erase_from_queue(interval_pointer p) +{ + if(p->min() < GEODESIC_INF/10.0)// && p->min >= queue->begin()->first) + { + assert(m_queue.count(p)<=1); //the set is unique + + IntervalQueue::iterator it = m_queue.find(p); + + if(it != m_queue.end()) + { + m_queue.erase(it); + return true; + } + } + + return false; +} + +inline unsigned GeodesicAlgorithmExact::intersect_intervals(interval_pointer zero, + IntervalWithStop* one) //intersecting two intervals with up to three intervals in the end +{ + assert(zero->edge()->id() == one->edge()->id()); + assert(zero->stop() > one->start() && zero->start() < one->stop()); + assert(one->min() < GEODESIC_INF/10.0); + + double const local_epsilon = SMALLEST_INTERVAL_RATIO*one->edge()->length(); + + unsigned N=0; + if(zero->min() > GEODESIC_INF/10.0) + { + start[0] = zero->start(); + if(zero->start() < one->start() - local_epsilon) + { + map[0] = OLD; + start[1] = one->start(); + map[1] = NEW; + N = 2; + } + else + { + map[0] = NEW; + N = 1; + } + + if(zero->stop() > one->stop() + local_epsilon) + { + map[N] = OLD; //"zero" interval + start[N++] = one->stop(); + } + + start[N+1] = zero->stop(); + return N; + } + + double const local_small_epsilon = 1e-8*one->edge()->length(); + + double D = zero->d() - one->d(); + double x0 = zero->pseudo_x(); + double x1 = one->pseudo_x(); + double R0 = x0*x0 + zero->pseudo_y()*zero->pseudo_y(); + double R1 = x1*x1 + one->pseudo_y()*one->pseudo_y(); + + double inter[2]; //points of intersection + char Ninter=0; //number of the points of the intersection + + if(std::abs(D)local_small_epsilon) + { + inter[0] = (R1 - R0)/(2.*denom); //one solution + Ninter = 1; + } + } + else + { + double D2 = D*D; + double Q = 0.5*(R1-R0-D2); + double X = x0 - x1; + + double A = X*X - D2; + double B = Q*X + D2*x0; + double C = Q*Q - D2*R0; + + if (std::abs(A)local_small_epsilon) + { + inter[0] = -C/B; //one solution + Ninter = 1; + } + } + else + { + double det = B*B-A*C; + if(det>local_small_epsilon*local_small_epsilon) //two roots + { + det = sqrt(det); + if(A>0.0) //make sure that the roots are ordered + { + inter[0] = (-B - det)/A; + inter[1] = (-B + det)/A; + } + else + { + inter[0] = (-B + det)/A; + inter[1] = (-B - det)/A; + } + + if(inter[1] - inter[0] > local_small_epsilon) + { + Ninter = 2; + } + else + { + Ninter = 1; + } + } + else if(det>=0.0) //single root + { + inter[0] = -B/A; + Ninter = 1; + } + } + } + //---------------------------find possible intervals--------------------------------------- + double left = std::max(zero->start(), one->start()); //define left and right boundaries of the intersection of the intervals + double right = std::min(zero->stop(), one->stop()); + + double good_start[4]; //points of intersection within the (left, right) limits +"left" + "right" + good_start[0] = left; + char Ngood_start=1; //number of the points of the intersection + + for(char i=0; i left + local_epsilon && x < right - local_epsilon) + { + good_start[Ngood_start++] = x; + } + } + good_start[Ngood_start++] = right; + + MapType mid_map[3]; + for(char i=0; isignal(mid) <= one->signal(mid) ? OLD : NEW; + } + + //-----------------------------------output---------------------------------- + N = 0; + if(zero->start() < left - local_epsilon) //additional "zero" interval + { + if(mid_map[0] == OLD) //first interval in the map is already the old one + { + good_start[0] = zero->start(); + } + else + { + map[N] = OLD; //"zero" interval + start[N++] = zero->start(); + } + } + + for(long i=0;istop() > one->stop() + local_epsilon) + { + if(N==0 || map[N-1] == NEW) + { + map[N] = OLD; //"zero" interval + start[N++] = one->stop(); + } + } + + start[0] = zero->start(); // just to make sure that epsilons do not damage anything + //start[N] = zero->stop(); + + return N; +} + +inline void GeodesicAlgorithmExact::initialize_propagation_data() +{ + clear(); + + IntervalWithStop candidate; + std::vector edges_visible_from_source; + for(unsigned i=0; ibase_element(), + edges_visible_from_source); + + for(unsigned j=0; jlength(); + candidate.compute_min_distance(candidate.stop()); + candidate.direction() = Interval::FROM_SOURCE; + + update_list_and_queue(interval_list(e), &candidate, 1); + } + } +} + +inline void GeodesicAlgorithmExact::propagate(std::vector& sources, + double max_propagation_distance, //propagation algorithm stops after reaching the certain distance from the source + std::vector* stop_points) +{ + set_stop_conditions(stop_points, max_propagation_distance); + set_sources(sources); + initialize_propagation_data(); + + clock_t start = clock(); + + unsigned satisfied_index = 0; + + m_iterations = 0; //for statistics + m_queue_max_size = 0; + + IntervalWithStop candidates[2]; + + while(!m_queue.empty()) + { + m_queue_max_size = std::max(static_cast(m_queue.size()), m_queue_max_size); + + unsigned const check_period = 10; + if(++m_iterations % check_period == 0) //check if we covered all required vertices + { + if (check_stop_conditions(satisfied_index)) + { + break; + } + } + + interval_pointer min_interval = *m_queue.begin(); + m_queue.erase(m_queue.begin()); + edge_pointer edge = min_interval->edge(); + list_pointer list = interval_list(edge); + + assert(min_interval->d() < GEODESIC_INF); + + bool const first_interval = min_interval->start() == 0.0; + //bool const last_interval = min_interval->stop() == edge->length(); + bool const last_interval = min_interval->next() == NULL; + + bool const turn_left = edge->v0()->saddle_or_boundary(); + bool const turn_right = edge->v1()->saddle_or_boundary(); + + for(unsigned i=0; iadjacent_faces().size(); ++i) //two possible faces to propagate + { + if(!edge->is_boundary()) //just in case, always propagate boundary edges + { + if((i == 0 && min_interval->direction() == Interval::FROM_FACE_0) || + (i == 1 && min_interval->direction() == Interval::FROM_FACE_1)) + { + continue; + } + } + + face_pointer face = edge->adjacent_faces()[i]; //if we come from 1, go to 2 + edge_pointer next_edge = face->next_edge(edge,edge->v0()); + + unsigned num_propagated = compute_propagated_parameters(min_interval->pseudo_x(), + min_interval->pseudo_y(), + min_interval->d(), //parameters of the interval + min_interval->start(), + min_interval->stop(), //start/end of the interval + face->vertex_angle(edge->v0()), //corner angle + next_edge->length(), //length of the new edge + first_interval, //if it is the first interval on the edge + last_interval, + turn_left, + turn_right, + candidates); //if it is the last interval on the edge + bool propagate_to_right = true; + + if(num_propagated) + { + if(candidates[num_propagated-1].stop() != next_edge->length()) + { + propagate_to_right = false; + } + + bool const invert = next_edge->v0()->id() != edge->v0()->id(); //if the origins coinside, do not invert intervals + + construct_propagated_intervals(invert, //do not inverse + next_edge, + face, + candidates, + num_propagated, + min_interval); + + update_list_and_queue(interval_list(next_edge), + candidates, + num_propagated); + } + + if(propagate_to_right) + { + //propogation to the right edge + double length = edge->length(); + next_edge = face->next_edge(edge,edge->v1()); + + num_propagated = compute_propagated_parameters(length - min_interval->pseudo_x(), + min_interval->pseudo_y(), + min_interval->d(), //parameters of the interval + length - min_interval->stop(), + length - min_interval->start(), //start/end of the interval + face->vertex_angle(edge->v1()), //corner angle + next_edge->length(), //length of the new edge + last_interval, //if it is the first interval on the edge + first_interval, + turn_right, + turn_left, + candidates); //if it is the last interval on the edge + + if(num_propagated) + { + bool const invert = next_edge->v0()->id() != edge->v1()->id(); //if the origins coinside, do not invert intervals + + construct_propagated_intervals(invert, //do not inverse + next_edge, + face, + candidates, + num_propagated, + min_interval); + + update_list_and_queue(interval_list(next_edge), + candidates, + num_propagated); + } + } + } + } + + m_propagation_distance_stopped = m_queue.empty() ? GEODESIC_INF : (*m_queue.begin())->min(); + clock_t stop = clock(); + m_time_consumed = (static_cast(stop)-static_cast(start))/CLOCKS_PER_SEC; + +/* for(unsigned i=0; ifirst(); + assert(p->start() == 0.0); + while(p->next()) + { + assert(p->stop() == p->next()->start()); + assert(p->d() < GEODESIC_INF); + p = p->next(); + } + }*/ +} + + +inline bool GeodesicAlgorithmExact::check_stop_conditions(unsigned& index) +{ + double queue_distance = (*m_queue.begin())->min(); + if(queue_distance < stop_distance()) + { + return false; + } + + while(index < m_stop_vertices.size()) + { + vertex_pointer v = m_stop_vertices[index].first; + edge_pointer edge = v->adjacent_edges()[0]; //take any edge + + double distance = edge->v0()->id() == v->id() ? + interval_list(edge)->signal(0.0) : + interval_list(edge)->signal(edge->length()); + + if(queue_distance < distance + m_stop_vertices[index].second) + { + return false; + } + + ++index; + } + return true; +} + + +inline void GeodesicAlgorithmExact::update_list_and_queue(list_pointer list, + IntervalWithStop* candidates, //up to two candidates + unsigned num_candidates) +{ + assert(num_candidates <= 2); + //assert(list->first() != NULL); + edge_pointer edge = list->edge(); + double const local_epsilon = SMALLEST_INTERVAL_RATIO * edge->length(); + + if(list->first() == NULL) + { + interval_pointer* p = &list->first(); + IntervalWithStop* first; + IntervalWithStop* second; + + if(num_candidates == 1) + { + first = candidates; + second = candidates; + first->compute_min_distance(first->stop()); + } + else + { + if(candidates->start() <= (candidates+1)->start()) + { + first = candidates; + second = candidates+1; + } + else + { + first = candidates+1; + second = candidates; + } + assert(first->stop() == second->start()); + + first->compute_min_distance(first->stop()); + second->compute_min_distance(second->stop()); + } + + if(first->start() > 0.0) + { + *p = m_memory_allocator.allocate(); + (*p)->initialize(edge); + p = &(*p)->next(); + } + + *p = m_memory_allocator.allocate(); + memcpy(*p,first,sizeof(Interval)); + m_queue.insert(*p); + + if(num_candidates == 2) + { + p = &(*p)->next(); + *p = m_memory_allocator.allocate(); + memcpy(*p,second,sizeof(Interval)); + m_queue.insert(*p); + } + + if(second->stop() < edge->length()) + { + p = &(*p)->next(); + *p = m_memory_allocator.allocate(); + (*p)->initialize(edge); + (*p)->start() = second->stop(); + } + else + { + (*p)->next() = NULL; + } + return; + } + + bool propagate_flag; + + for(unsigned i=0; ifirst(); + assert(p->start() == 0.0); + + while(p != NULL && p->stop() - local_epsilon < q->start()) + { + p = p->next(); + } + + while(p != NULL && p->start() < q->stop() - local_epsilon) //go through all old intervals + { + unsigned const N = intersect_intervals(p, q); //interset two intervals + + if(N == 1) + { + if(map[0]==OLD) //if "p" is always better, we do not need to update anything) + { + if(previous) //close previous interval and put in into the queue + { + previous->next() = p; + previous->compute_min_distance(p->start()); + m_queue.insert(previous); + previous = NULL; + } + + p = p->next(); + + } + else if(previous) //extend previous interval to cover everything; remove p + { + previous->next() = p->next(); + erase_from_queue(p); + m_memory_allocator.deallocate(p); + + p = previous->next(); + } + else //p becomes "previous" + { + previous = p; + interval_pointer next = p->next(); + erase_from_queue(p); + + memcpy(previous,q,sizeof(Interval)); + + previous->start() = start[0]; + previous->next() = next; + + p = next; + } + continue; + } + + //update_flag = true; + + Interval swap(*p); //used for swapping information + propagate_flag = erase_from_queue(p); + + for(unsigned j=1; jnext() = p; + previous->compute_min_distance(previous->stop()); + m_queue.insert(previous); + previous = NULL; + } + i_new[0] = p; + p->next() = i_new[1]; + p->start() = start[0]; + } + else if(previous) //extend previous interval to cover everything; remove p + { + i_new[0] = previous; + previous->next() = i_new[1]; + m_memory_allocator.deallocate(p); + previous = NULL; + } + else //p becomes "previous" + { + i_new[0] = p; + memcpy(p,q,sizeof(Interval)); + + p->next() = i_new[1]; + p->start() = start[0]; + } + + assert(!previous); + + for(unsigned j=1; jnext() = swap.next(); + } + else + { + current_interval->next() = i_new[j+1]; + } + + current_interval->start() = start[j]; + } + + for(unsigned j=0; jcompute_min_distance(current_interval->stop()); //compute minimal distance + + if(map[j]==NEW || (map[j]==OLD && propagate_flag)) + { + m_queue.insert(current_interval); + } + } + } + + p = swap.next(); + } + + if(previous) //close previous interval and put in into the queue + { + previous->compute_min_distance(previous->stop()); + m_queue.insert(previous); + previous = NULL; + } + } +} + +inline unsigned GeodesicAlgorithmExact::compute_propagated_parameters(double pseudo_x, + double pseudo_y, + double d, //parameters of the interval + double begin, + double end, //start/end of the interval + double alpha, //corner angle + double L, //length of the new edge + bool first_interval, //if it is the first interval on the edge + bool last_interval, + bool turn_left, + bool turn_right, + IntervalWithStop* candidates) //if it is the last interval on the edge +{ + assert(pseudo_y<=0.0); + assert(dstart() = 0.0; + p->stop() = L; + p->d() = d - pseudo_x; + p->pseudo_x() = 0.0; + p->pseudo_y() = 0.0; + return 1; + } + else if(last_interval && pseudo_x >= end) + { + p->start() = 0.0; + p->stop() = L; + p->d() = d + pseudo_x-end; + p->pseudo_x() = end*cos(alpha); + p->pseudo_y() = -end*sin(alpha); + return 1; + } + else if(pseudo_x >= begin && pseudo_x <= end) + { + p->start() = 0.0; + p->stop() = L; + p->d() = d; + p->pseudo_x() = pseudo_x*cos(alpha); + p->pseudo_y() = -pseudo_x*sin(alpha); + return 1; + } + else + { + return 0; + } + } + + double sin_alpha = sin(alpha); + double cos_alpha = cos(alpha); + + //important: for the first_interval, this function returns zero only if the new edge is "visible" from the source + //if the new edge can be covered only after turn_over, the value is negative (-1.0) + double L1 = compute_positive_intersection(begin, + pseudo_x, + pseudo_y, + sin_alpha, + cos_alpha); + + if(L1 < 0 || L1 >= L) + { + if(first_interval && turn_left) + { + p->start() = 0.0; + p->stop() = L; + p->d() = d + sqrt(pseudo_x*pseudo_x + pseudo_y*pseudo_y); + p->pseudo_y() = 0.0; + p->pseudo_x() = 0.0; + return 1; + } + else + { + return 0; + } + } + + double L2 = compute_positive_intersection(end, + pseudo_x, + pseudo_y, + sin_alpha, + cos_alpha); + + if(L2 < 0 || L2 >= L) + { + p->start() = L1; + p->stop() = L; + p->d() = d; + p->pseudo_x() = cos_alpha*pseudo_x + sin_alpha*pseudo_y; + p->pseudo_y() = -sin_alpha*pseudo_x + cos_alpha*pseudo_y; + + return 1; + } + + p->start() = L1; + p->stop() = L2; + p->d() = d; + p->pseudo_x() = cos_alpha*pseudo_x + sin_alpha*pseudo_y; + p->pseudo_y() = -sin_alpha*pseudo_x + cos_alpha*pseudo_y; + assert(p->pseudo_y() <= 0.0); + + if(!(last_interval && turn_right)) + { + return 1; + } + else + { + p = candidates + 1; + + p->start() = L2; + p->stop() = L; + double dx = pseudo_x - end; + p->d() = d + sqrt(dx*dx + pseudo_y*pseudo_y); + p->pseudo_x() = end*cos_alpha; + p->pseudo_y() = -end*sin_alpha; + + return 2; + } +} + +inline void GeodesicAlgorithmExact::construct_propagated_intervals(bool invert, + edge_pointer edge, + face_pointer face, //constructs iNew from the rest of the data + IntervalWithStop* candidates, + unsigned& num_candidates, + interval_pointer source_interval) //up to two candidates +{ + double edge_length = edge->length(); + double local_epsilon = SMALLEST_INTERVAL_RATIO * edge_length; + + //kill very small intervals in order to avoid precision problems + if(num_candidates == 2) + { + double start = std::min(candidates->start(), (candidates+1)->start()); + double stop = std::max(candidates->stop(), (candidates+1)->stop()); + if(candidates->stop()-candidates->start() < local_epsilon) // kill interval 0 + { + *candidates = *(candidates+1); + num_candidates = 1; + candidates->start() = start; + candidates->stop() = stop; + } + else if ((candidates+1)->stop() - (candidates+1)->start() < local_epsilon) + { + num_candidates = 1; + candidates->start() = start; + candidates->stop() = stop; + } + } + + IntervalWithStop* first; + IntervalWithStop* second; + if(num_candidates == 1) + { + first = candidates; + second = candidates; + } + else + { + if(candidates->start() <= (candidates+1)->start()) + { + first = candidates; + second = candidates+1; + } + else + { + first = candidates+1; + second = candidates; + } + assert(first->stop() == second->start()); + } + + if(first->start() < local_epsilon) + { + first->start() = 0.0; + } + if(edge_length - second->stop() < local_epsilon) + { + second->stop() = edge_length; + } + + //invert intervals if necessary; fill missing data and set pointers correctly + Interval::DirectionType direction = edge->adjacent_faces()[0]->id() == face->id() ? + Interval::FROM_FACE_0 : + Interval::FROM_FACE_1; + + if(!invert) //in this case everything is straighforward, we do not have to invert the intervals + { + for(unsigned i=0; inext() = (i == num_candidates - 1) ? NULL : candidates + i + 1; + p->edge() = edge; + p->direction() = direction; + p->source_index() = source_interval->source_index(); + + p->min() = 0.0; //it will be changed later on + + assert(p->start() < p->stop()); + } + } + else //now we have to invert the intervals + { + for(unsigned i=0; inext() = (i == 0) ? NULL : candidates + i - 1; + p->edge() = edge; + p->direction() = direction; + p->source_index() = source_interval->source_index(); + + double length = edge_length; + p->pseudo_x() = length - p->pseudo_x(); + + double start = length - p->stop(); + p->stop() = length - p->start(); + p->start() = start; + + p->min() = 0; + + assert(p->start() < p->stop()); + assert(p->start() >= 0.0); + assert(p->stop() <= edge->length()); + } + } +} + + +inline unsigned GeodesicAlgorithmExact::best_source(SurfacePoint& point, //quickly find what source this point belongs to and what is the distance to this source + double& best_source_distance) +{ + double best_interval_position; + unsigned best_source_index; + + best_first_interval(point, + best_source_distance, + best_interval_position, + best_source_index); + + return best_source_index; +} + +inline interval_pointer GeodesicAlgorithmExact::best_first_interval(SurfacePoint& point, + double& best_total_distance, + double& best_interval_position, + unsigned& best_source_index) +{ + assert(point.type() != UNDEFINED_POINT); + + interval_pointer best_interval = NULL; + best_total_distance = GEODESIC_INF; + + if(point.type() == EDGE) + { + edge_pointer e = static_cast(point.base_element()); + list_pointer list = interval_list(e); + + best_interval_position = point.distance(e->v0()); + best_interval = list->covering_interval(best_interval_position); + if(best_interval) + { + //assert(best_interval && best_interval->d() < GEODESIC_INF); + best_total_distance = best_interval->signal(best_interval_position); + best_source_index = best_interval->source_index(); + } + } + else if(point.type() == FACE) + { + face_pointer f = static_cast(point.base_element()); + for(unsigned i=0; i<3; ++i) + { + edge_pointer e = f->adjacent_edges()[i]; + list_pointer list = interval_list(e); + + double offset; + double distance; + interval_pointer interval; + + list->find_closest_point(&point, + offset, + distance, + interval); + + if(interval && distance < best_total_distance) + { + best_interval = interval; + best_total_distance = distance; + best_interval_position = offset; + best_source_index = interval->source_index(); + } + } + + //check for all sources that might be located inside this face + SortedSources::sorted_iterator_pair local_sources = m_sources.sources(f); + for(SortedSources::sorted_iterator it=local_sources.first; it != local_sources.second; ++it) + { + SurfacePointWithIndex* source = *it; + double distance = point.distance(source); + if(distance < best_total_distance) + { + best_interval = NULL; + best_total_distance = distance; + best_interval_position = 0.0; + best_source_index = source->index(); + } + } + } + else if(point.type() == VERTEX) + { + vertex_pointer v = static_cast(point.base_element()); + for(unsigned i=0; iadjacent_edges().size(); ++i) + { + edge_pointer e = v->adjacent_edges()[i]; + list_pointer list = interval_list(e); + + double position = e->v0()->id() == v->id() ? 0.0 : e->length(); + interval_pointer interval = list->covering_interval(position); + if(interval) + { + double distance = interval->signal(position); + + if(distance < best_total_distance) + { + best_interval = interval; + best_total_distance = distance; + best_interval_position = position; + best_source_index = interval->source_index(); + } + } + } + } + + if(best_total_distance > m_propagation_distance_stopped) //result is unreliable + { + best_total_distance = GEODESIC_INF; + return NULL; + } + else + { + return best_interval; + } +} + +inline void GeodesicAlgorithmExact::trace_back(SurfacePoint& destination, //trace back piecewise-linear path + std::vector& path) +{ + path.clear(); + double best_total_distance; + double best_interval_position; + unsigned source_index = std::numeric_limits::max(); + interval_pointer best_interval = best_first_interval(destination, + best_total_distance, + best_interval_position, + source_index); + + if(best_total_distance >= GEODESIC_INF/2.0) //unable to find the right path + { + return; + } + + path.push_back(destination); + + if(best_interval) //if we did not hit the face source immediately + { + std::vector possible_edges; + possible_edges.reserve(10); + + while(visible_from_source(path.back()) < 0) //while this point is not in the direct visibility of some source (if we are inside the FACE, we obviously hit the source) + { + SurfacePoint& q = path.back(); + + possible_traceback_edges(q, possible_edges); + + interval_pointer interval; + double total_distance; + double position; + + best_point_on_the_edge_set(q, + possible_edges, + interval, + total_distance, + position); + + //std::cout << total_distance + length(path) << std::endl; + assert(total_distancesource_index(); + + edge_pointer e = interval->edge(); + double local_epsilon = SMALLEST_INTERVAL_RATIO*e->length(); + if(position < local_epsilon) + { + path.push_back(SurfacePoint(e->v0())); + } + else if(position > e->length()-local_epsilon) + { + path.push_back(SurfacePoint(e->v1())); + } + else + { + double normalized_position = position/e->length(); + path.push_back(SurfacePoint(e, normalized_position)); + } + } + } + + SurfacePoint& source = static_cast(m_sources[source_index]); + if(path.back().distance(&source) > 0) + { + path.push_back(source); + } +} + +inline void GeodesicAlgorithmExact::print_statistics() +{ + GeodesicAlgorithmBase::print_statistics(); + + unsigned interval_counter = 0; + for(unsigned i=0; i +IGL_INLINE void igl::exact_geodesic( + const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &VS, + const Eigen::MatrixBase &FS, + const Eigen::MatrixBase &VT, + const Eigen::MatrixBase &FT, + Eigen::PlainObjectBase &D) +{ + assert(V.cols() == 3 && F.cols() == 3 && "Only support 3D triangle mesh"); + assert(VS.cols() <=1 && FS.cols() <= 1 && VT.cols() <= 1 && FT.cols() <=1 && "Only support one dimensional inputs"); + std::vector points(V.rows() * V.cols()); + std::vector faces(F.rows() * F.cols()); + for (int i = 0; i < points.size(); i++) + { + points[i] = V(i / 3, i % 3); + } + for (int i = 0; i < faces.size(); i++) + { + faces[i] = F(i / 3, i % 3); + } + + igl::geodesic::Mesh mesh; + mesh.initialize_mesh_data(points, faces); + igl::geodesic::GeodesicAlgorithmExact exact_algorithm(&mesh); + + std::vector source(VS.rows() + FS.rows()); + std::vector target(VT.rows() + FT.rows()); + for (int i = 0; i < VS.rows(); i++) + { + source[i] = (igl::geodesic::SurfacePoint(&mesh.vertices()[VS(i, 0)])); + } + for (int i = 0; i < FS.rows(); i++) + { + source[i] = (igl::geodesic::SurfacePoint(&mesh.faces()[FS(i, 0)])); + } + + for (int i = 0; i < VT.rows(); i++) + { + target[i] = (igl::geodesic::SurfacePoint(&mesh.vertices()[VT(i, 0)])); + } + for (int i = 0; i < FT.rows(); i++) + { + target[i] = (igl::geodesic::SurfacePoint(&mesh.faces()[FT(i, 0)])); + } + + exact_algorithm.propagate(source); + std::vector path; + D.resize(target.size(), 1); + for (int i = 0; i < target.size(); i++) + { + exact_algorithm.trace_back(target[i], path); + D(i) = igl::geodesic::length(path); + } +} + +#ifdef IGL_STATIC_LIBRARY +template void igl::exact_geodesic, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::PlainObjectBase> &); +template void igl::exact_geodesic, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/extension.cpp b/vendor/libigl/include/igl/extension.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6bb6ee3e5eee0a8771211ba97f77a8696f4a4315 --- /dev/null +++ b/vendor/libigl/include/igl/extension.cpp @@ -0,0 +1,9 @@ +#include "extension.h" +#include "pathinfo.h" + +IGL_INLINE std::string igl::extension( const std::string & path) +{ + std::string d,b,e,f; + pathinfo(path,d,b,e,f); + return e; +} diff --git a/vendor/libigl/include/igl/face_occurrences.h b/vendor/libigl/include/igl/face_occurrences.h new file mode 100644 index 0000000000000000000000000000000000000000..48f4b11e233b9d81953ee27397d8a94a880eea57 --- /dev/null +++ b/vendor/libigl/include/igl/face_occurrences.h @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_FACE_OCCURRENCES +#define IGL_FACE_OCCURRENCES +#include "igl_inline.h" +#include + +#include +namespace igl +{ + // Count the occurances of each face (row) in a list of face indices + // (irrespecitive of order) + // Inputs: + // F #F by simplex-size + // Outputs + // C #F list of counts + // Known bug: triangles/tets only (where ignoring order still gives simplex) + template + IGL_INLINE void face_occurrences( + const std::vector > & F, + std::vector & C); + template + IGL_INLINE void face_occurrences( + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & C); +} + +#ifndef IGL_STATIC_LIBRARY +# include "face_occurrences.cpp" +#endif + +#endif + + diff --git a/vendor/libigl/include/igl/facet_components.h b/vendor/libigl/include/igl/facet_components.h new file mode 100644 index 0000000000000000000000000000000000000000..d043b0fc94e3191b25ad5d649402b7128073274d --- /dev/null +++ b/vendor/libigl/include/igl/facet_components.h @@ -0,0 +1,50 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef FACET_COMPONENTS_H +#define FACET_COMPONENTS_H +#include "igl_inline.h" +#include +#include +namespace igl +{ + // Compute connected components of facets based on edge-edge adjacency. + // + // For connected components on vertices see igl::vertex_components + // + // Inputs: + // F #F by 3 list of triangle indices + // Outputs: + // C #F list of connected component ids + template + IGL_INLINE int facet_components( + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & C); + + // Compute connected components of facets based on edge-edge adjacency. + // + // For connected components on vertices see igl::vertex_components + // + // Inputs: + // TT #TT by 3 list of list of adjacency triangles (see + // triangle_triangle_adjacency.h) + // Outputs: + // C #F list of connected component ids + // counts #C list of number of facets in each components + template < + typename TTIndex, + typename DerivedC, + typename Derivedcounts> + IGL_INLINE void facet_components( + const std::vector > > & TT, + Eigen::PlainObjectBase & C, + Eigen::PlainObjectBase & counts); +} +#ifndef IGL_STATIC_LIBRARY +# include "facet_components.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/file_dialog_open.cpp b/vendor/libigl/include/igl/file_dialog_open.cpp new file mode 100644 index 0000000000000000000000000000000000000000..037dffa90714e18b58a5485a362f670df61ccb5d --- /dev/null +++ b/vendor/libigl/include/igl/file_dialog_open.cpp @@ -0,0 +1,113 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "file_dialog_open.h" +#include +#include + +#ifdef _WIN32 + #include + #undef max + #undef min + + #include +#endif + +IGL_INLINE std::string igl::file_dialog_open() +{ + const int FILE_DIALOG_MAX_BUFFER = 1024; + char buffer[FILE_DIALOG_MAX_BUFFER]; + buffer[0] = '\0'; + buffer[FILE_DIALOG_MAX_BUFFER - 1] = 'x'; // Initialize last character with a char != '\0' + +#ifdef __APPLE__ + // For apple use applescript hack + FILE * output = popen( + "osascript -e \"" + " tell application \\\"System Events\\\"\n" + " activate\n" + " set existing_file to choose file\n" + " end tell\n" + " set existing_file_path to (POSIX path of (existing_file))\n" + "\" 2>/dev/null | tr -d '\n' ","r"); + if (output) + { + auto ret = fgets(buffer, FILE_DIALOG_MAX_BUFFER, output); + if (ret == NULL || ferror(output)) + { + // I/O error + buffer[0] = '\0'; + } + if (buffer[FILE_DIALOG_MAX_BUFFER - 1] == '\0') + { + // File name too long, buffer has been filled, so we return empty string instead + buffer[0] = '\0'; + } + } +#elif defined _WIN32 + + // Use native windows file dialog box + // (code contributed by Tino Weinkauf) + + OPENFILENAME ofn; // common dialog box structure + char szFile[260]; // buffer for file name + + // Initialize OPENFILENAME + ZeroMemory(&ofn, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = NULL; + ofn.lpstrFile = szFile; + // Set lpstrFile[0] to '\0' so that GetOpenFileName does not + // use the contents of szFile to initialize itself. + ofn.lpstrFile[0] = '\0'; + ofn.nMaxFile = sizeof(szFile); + ofn.lpstrFilter = "*.*\0";//off\0*.off\0obj\0*.obj\0mp\0*.mp\0"; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + // Display the Open dialog box. + int pos = 0; + if (GetOpenFileName(&ofn)==TRUE) + { + while(ofn.lpstrFile[pos] != '\0') + { + buffer[pos] = (char)ofn.lpstrFile[pos]; + pos++; + } + } + buffer[pos] = 0; +#else + + // For linux use zenity + FILE * output = popen("/usr/bin/zenity --file-selection","r"); + if (output) + { + auto ret = fgets(buffer, FILE_DIALOG_MAX_BUFFER, output); + if (ret == NULL || ferror(output)) + { + // I/O error + buffer[0] = '\0'; + } + if (buffer[FILE_DIALOG_MAX_BUFFER - 1] == '\0') + { + // File name too long, buffer has been filled, so we return empty string instead + buffer[0] = '\0'; + } + } + + // Replace last '\n' by '\0' + if(strlen(buffer) > 0) + { + buffer[strlen(buffer)-1] = '\0'; + } + +#endif + return std::string(buffer); +} diff --git a/vendor/libigl/include/igl/file_dialog_open.h b/vendor/libigl/include/igl/file_dialog_open.h new file mode 100644 index 0000000000000000000000000000000000000000..1b17ea4c6a83933f54a29252eda6c8f4630a9422 --- /dev/null +++ b/vendor/libigl/include/igl/file_dialog_open.h @@ -0,0 +1,30 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_FILE_DIALOG_OPEN_H +#define IGL_FILE_DIALOG_OPEN_H +#include "igl_inline.h" + +#include + +namespace igl +{ + // Returns a string with a path to an existing file + // The string is returned empty if no file is selected + // (on Linux machines, it assumes that Zenity is installed) + // + // Usage: + // std::string str = get_open_file_path(); + IGL_INLINE std::string file_dialog_open(); +} + +#ifndef IGL_STATIC_LIBRARY +# include "file_dialog_open.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/file_dialog_save.h b/vendor/libigl/include/igl/file_dialog_save.h new file mode 100644 index 0000000000000000000000000000000000000000..f0407575892479a15be0e70a4b9f403dda263e06 --- /dev/null +++ b/vendor/libigl/include/igl/file_dialog_save.h @@ -0,0 +1,31 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_FILE_DIALOG_SAVE_H +#define IGL_FILE_DIALOG_SAVE_H +#include "igl_inline.h" + +#include + +namespace igl +{ + // Returns a string with a path to a new/existing file + // The string is returned empty if no file is selected + // (on Linux machines, it assumes that Zenity is installed) + // + // Usage: + // char buffer[FILE_DIALOG_MAX_BUFFER]; + // get_save_file_path(buffer); + IGL_INLINE std::string file_dialog_save(); +} + +#ifndef IGL_STATIC_LIBRARY +# include "file_dialog_save.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/find_cross_field_singularities.cpp b/vendor/libigl/include/igl/find_cross_field_singularities.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f3e3f491db12756aae30cc186397aab12be1ee4d --- /dev/null +++ b/vendor/libigl/include/igl/find_cross_field_singularities.cpp @@ -0,0 +1,85 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo , Olga Diamanti +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "find_cross_field_singularities.h" + +#include +#include +#include +#include +#include + + +template +IGL_INLINE void igl::find_cross_field_singularities(const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &Handle_MMatch, + Eigen::PlainObjectBase &isSingularity, + Eigen::PlainObjectBase &singularityIndex) +{ + std::vector V_border = igl::is_border_vertex(F); + + std::vector > VF; + std::vector > VFi; + igl::vertex_triangle_adjacency(V,F,VF,VFi); + + + isSingularity.setZero(V.rows(),1); + singularityIndex.setZero(V.rows(),1); + for (unsigned int vid=0;vid +IGL_INLINE void igl::find_cross_field_singularities(const Eigen::MatrixBase &V, + const Eigen::MatrixBase &F, + const Eigen::MatrixBase &PD1, + const Eigen::MatrixBase &PD2, + Eigen::PlainObjectBase &isSingularity, + Eigen::PlainObjectBase &singularityIndex, + bool isCombed) +{ + Eigen::Matrix Handle_MMatch; + + igl::cross_field_mismatch(V, F, PD1, PD2, isCombed, Handle_MMatch); + igl::find_cross_field_singularities(V, F, Handle_MMatch, isSingularity, singularityIndex); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::find_cross_field_singularities, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::find_cross_field_singularities, Eigen::Matrix, Eigen::Matrix>(Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::PlainObjectBase> &, + Eigen::PlainObjectBase> &, bool); +template void igl::find_cross_field_singularities, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::find_cross_field_singularities, Eigen::Matrix, Eigen::Matrix>(Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::MatrixBase> const &, Eigen::PlainObjectBase> &, Eigen::PlainObjectBase> &, bool); +template void igl::find_cross_field_singularities, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::find_cross_field_singularities, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/find_zero.h b/vendor/libigl/include/igl/find_zero.h new file mode 100644 index 0000000000000000000000000000000000000000..0739be1cf242b9d30a64f03965b9e97648c4c92b --- /dev/null +++ b/vendor/libigl/include/igl/find_zero.h @@ -0,0 +1,28 @@ +#ifndef IGL_FIND_ZERO_H +#define IGL_FIND_ZERO_H +#include "igl_inline.h" +#include +#include +namespace igl +{ + // Find the first zero (whether implicit or explicitly stored) in the + // rows/columns of a matrix. + // Inputs: + // A m by n sparse matrix + // dim dimension along which to check for any (1 or 2) + // Output: + // I n-long vector (if dim == 1) {m means no zeros found} + // or + // I m-long vector (if dim == 2) {n means no zeros found} + // + template + IGL_INLINE void find_zero( + const Eigen::SparseMatrix & A, + const int dim, + Eigen::PlainObjectBase & I); +} +#ifndef IGL_STATIC_LIBRARY +# include "find_zero.cpp" +#endif +#endif + diff --git a/vendor/libigl/include/igl/fit_cubic_bezier.h b/vendor/libigl/include/igl/fit_cubic_bezier.h new file mode 100644 index 0000000000000000000000000000000000000000..cdc4b52050d57d4b6de8f249d1e38416c47a5d86 --- /dev/null +++ b/vendor/libigl/include/igl/fit_cubic_bezier.h @@ -0,0 +1,57 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef FIT_CUBIC_BEZIER_H +#define FIT_CUBIC_BEZIER_H +#include "igl_inline.h" +#include +#include +namespace igl +{ + // Fit a cubic bezier spline (G1 continuous) to an ordered list of input + // points in any dimension, according to "An algorithm for automatically + // fitting digitized curves" [Schneider 1990]. + // + // Inputs: + // d #d by dim list of points along a curve to be fit with a cubic bezier + // spline (should probably be roughly uniformly spaced). If d(0)==d(end), + // then will treat as a closed curve. + // error maximum squared distance allowed + // Output: + // cubics #cubics list of 4 by dim lists of cubic control points + IGL_INLINE void fit_cubic_bezier( + const Eigen::MatrixXd & d, + const double error, + std::vector & cubics); + // Recursive helper function. + // + // Inputs: + // first index of first point in d of substring + // last index of last point in d of substring + // tHat1 tangent to use at beginning of spline + // tHat2 tangent to use at end of spline + // error see above + // force_split whether to force a split (i.e., force a recursive call) + // cubics running list of cubics so far + // Outputs + // cubics running list of cubics so far (new cubics appended) + IGL_INLINE void fit_cubic_bezier_substring( + const Eigen::MatrixXd & d, + const int first, + const int last, + const Eigen::RowVectorXd & tHat1, + const Eigen::RowVectorXd & tHat2, + const double error, + const bool force_split, + std::vector & cubics); +} + +#ifndef IGL_STATIC_LIBRARY +#include "fit_cubic_bezier.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/flood_fill.cpp b/vendor/libigl/include/igl/flood_fill.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3272ca1b2ce88aef9ea6f2640303f502f53f1da8 --- /dev/null +++ b/vendor/libigl/include/igl/flood_fill.cpp @@ -0,0 +1,103 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "flood_fill.h" +#include + +template +IGL_INLINE void igl::flood_fill( + const Eigen::MatrixBase& res, + Eigen::PlainObjectBase & S) +{ + using namespace Eigen; + using namespace std; + typedef typename DerivedS::Scalar Scalar; + const auto flood = [&res,&S] ( + const int xi, + const int yi, + const int zi, + const int signed_xi, + const int signed_yi, + const int signed_zi, + const Scalar s) + { + // flood fill this value back on this row + for(int bxi = xi;signed_xi<--bxi;) + { + S(bxi+int(res(0))*(yi + int(res(1))*zi)) = s; + } + // flood fill this value back on any previous rows + for(int byi = yi;signed_yi<--byi;) + { + for(int xi = 0;xi::quiet_NaN(); + for(int zi = 0;zi, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::flood_fill, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::flood_fill, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::flood_fill, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::flood_fill, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/forward_kinematics.cpp b/vendor/libigl/include/igl/forward_kinematics.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c473453c909da3e4f17086283f65a7e7425ce395 --- /dev/null +++ b/vendor/libigl/include/igl/forward_kinematics.cpp @@ -0,0 +1,115 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "forward_kinematics.h" +#include +#include + +IGL_INLINE void igl::forward_kinematics( + const Eigen::MatrixXd & C, + const Eigen::MatrixXi & BE, + const Eigen::VectorXi & P, + const std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & dQ, + const std::vector & dT, + std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & vQ, + std::vector & vT) +{ + using namespace std; + using namespace Eigen; + const int m = BE.rows(); + assert(m == P.rows()); + assert(m == (int)dQ.size()); + assert(m == (int)dT.size()); + vector computed(m,false); + vQ.resize(m); + vT.resize(m); + // Dynamic programming + function fk_helper = [&] (int b) + { + if(!computed[b]) + { + if(P(b) < 0) + { + // base case for roots + vQ[b] = dQ[b]; + const Vector3d r = C.row(BE(b,0)).transpose(); + vT[b] = r-dQ[b]*r + dT[b]; + }else + { + // Otherwise first compute parent's + const int p = P(b); + fk_helper(p); + vQ[b] = vQ[p] * dQ[b]; + const Vector3d r = C.row(BE(b,0)).transpose(); + vT[b] = vT[p] - vQ[b]*r + vQ[p]*(r + dT[b]); + } + computed[b] = true; + } + }; + for(int b = 0;b > & dQ, + std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & vQ, + std::vector & vT) +{ + std::vector dT(BE.rows(),Eigen::Vector3d(0,0,0)); + return forward_kinematics(C,BE,P,dQ,dT,vQ,vT); +} + +IGL_INLINE void igl::forward_kinematics( + const Eigen::MatrixXd & C, + const Eigen::MatrixXi & BE, + const Eigen::VectorXi & P, + const std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & dQ, + const std::vector & dT, + Eigen::MatrixXd & T) +{ + using namespace Eigen; + using namespace std; + vector< Quaterniond,aligned_allocator > vQ; + vector< Vector3d> vT; + forward_kinematics(C,BE,P,dQ,dT,vQ,vT); + const int dim = C.cols(); + T.resize(BE.rows()*(dim+1),dim); + for(int e = 0;e > & dQ, + Eigen::MatrixXd & T) +{ + std::vector dT(BE.rows(),Eigen::Vector3d(0,0,0)); + return forward_kinematics(C,BE,P,dQ,dT,T); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/forward_kinematics.h b/vendor/libigl/include/igl/forward_kinematics.h new file mode 100644 index 0000000000000000000000000000000000000000..2b3d2db6dd1c66c336b84d64f9fc03592385e780 --- /dev/null +++ b/vendor/libigl/include/igl/forward_kinematics.h @@ -0,0 +1,74 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_FORWARD_KINEMATICS_H +#define IGL_FORWARD_KINEMATICS_H +#include "igl_inline.h" +#include +#include +#include +#include + +namespace igl +{ + // Given a skeleton and a set of relative bone rotations compute absolute + // rigid transformations for each bone. + // + // Inputs: + // C #C by dim list of joint positions + // BE #BE by 2 list of bone edge indices + // P #BE list of parent indices into BE + // dQ #BE list of relative rotations + // dT #BE list of relative translations + // Outputs: + // vQ #BE list of absolute rotations + // vT #BE list of absolute translations + IGL_INLINE void forward_kinematics( + const Eigen::MatrixXd & C, + const Eigen::MatrixXi & BE, + const Eigen::VectorXi & P, + const std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & dQ, + const std::vector & dT, + std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & vQ, + std::vector & vT); + // Wrapper assuming each dT[i] == {0,0,0} + IGL_INLINE void forward_kinematics( + const Eigen::MatrixXd & C, + const Eigen::MatrixXi & BE, + const Eigen::VectorXi & P, + const std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & dQ, + std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & vQ, + std::vector & vT); + + // Outputs: + // T #BE*(dim+1) by dim stack of transposed transformation matrices + IGL_INLINE void forward_kinematics( + const Eigen::MatrixXd & C, + const Eigen::MatrixXi & BE, + const Eigen::VectorXi & P, + const std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & dQ, + const std::vector & dT, + Eigen::MatrixXd & T); + IGL_INLINE void forward_kinematics( + const Eigen::MatrixXd & C, + const Eigen::MatrixXi & BE, + const Eigen::VectorXi & P, + const std::vector< + Eigen::Quaterniond,Eigen::aligned_allocator > & dQ, + Eigen::MatrixXd & T); + +}; + +#ifndef IGL_STATIC_LIBRARY +# include "forward_kinematics.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/frame_field_deformer.cpp b/vendor/libigl/include/igl/frame_field_deformer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c22200f1b57078f04450a63c5d75126ae8e36c35 --- /dev/null +++ b/vendor/libigl/include/igl/frame_field_deformer.cpp @@ -0,0 +1,411 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "frame_field_deformer.h" + +#include +#include +#include + +#include +#include +#include + +namespace igl +{ + +class Frame_field_deformer +{ +public: + + IGL_INLINE Frame_field_deformer(); + IGL_INLINE ~Frame_field_deformer(); + + // Initialize the optimizer + IGL_INLINE void init(const Eigen::MatrixXd& _V, const Eigen::MatrixXi& _F, const Eigen::MatrixXd& _D1, const Eigen::MatrixXd& _D2, double _Lambda, double _perturb_rotations, int _fixed = 1); + + // Run N optimization steps + IGL_INLINE void optimize(int N, bool reset = false); + + // Reset optimization + IGL_INLINE void reset_opt(); + + // Precomputation of all components + IGL_INLINE void precompute_opt(); + + // Precomputation for deformation energy + IGL_INLINE void precompute_ARAP(Eigen::SparseMatrix & Lff, Eigen::MatrixXd & LfcVc); + + // Precomputation for regularization + IGL_INLINE void precompute_SMOOTH(Eigen::SparseMatrix & MS, Eigen::MatrixXd & bS); + + // extracts a r x c block from sparse matrix mat into sparse matrix m1 + // (r0,c0) is upper left entry of block + IGL_INLINE void extractBlock(Eigen::SparseMatrix & mat, int r0, int c0, int r, int c, Eigen::SparseMatrix & m1); + + // computes optimal rotations for faces of m wrt current coords in mw.V + // returns a 3x3 matrix + IGL_INLINE void compute_optimal_rotations(); + + // global optimization step - linear system + IGL_INLINE void compute_optimal_positions(); + + // compute the output XField from deformation gradient + IGL_INLINE void computeXField(std::vector< Eigen::Matrix > & XF); + + // computes in WW the ideal warp at each tri to make the frame field a cross + IGL_INLINE void compute_idealWarp(std::vector< Eigen::Matrix > & WW); + + // -------------------------------- Variables ---------------------------------------------------- + + // Mesh I/O: + + Eigen::MatrixXd V; // Original mesh - vertices + Eigen::MatrixXi F; // Original mesh - faces + + std::vector > VT; // Vertex to triangle topology + std::vector > VTi; // Vertex to triangle topology + + Eigen::MatrixXd V_w; // Warped mesh - vertices + + std::vector< Eigen::Matrix > FF; // frame field FF in 3D (parallel to m.F) + std::vector< Eigen::Matrix > WW; // warping matrices to make a cross field (parallel to m.F) + std::vector< Eigen::Matrix > XF; // pseudo-cross field from solution (parallel to m.F) + + int fixed; + + double perturb_rotations; // perturbation to rotation matrices + + // Numerics + int nfree,nconst; // number of free/constrained vertices in the mesh - default all-but-1/1 + Eigen::MatrixXd C; // cotangent matrix of m + Eigen::SparseMatrix L; // Laplacian matrix of m + + Eigen::SparseMatrix M; // matrix for global optimization - pre-conditioned + Eigen::MatrixXd RHS; // pre-computed part of known term in global optimization + std::vector< Eigen::Matrix > RW; // optimal rotation-warping matrices (parallel to m.F) -- INCORPORATES WW + Eigen::SimplicialCholesky > solver; // solver for linear system in global opt. + + // Parameters +private: + double Lambda = 0.1; // weight of energy regularization + +}; + + IGL_INLINE Frame_field_deformer::Frame_field_deformer() {} + + IGL_INLINE Frame_field_deformer::~Frame_field_deformer() {} + + IGL_INLINE void Frame_field_deformer::init(const Eigen::MatrixXd& _V, + const Eigen::MatrixXi& _F, + const Eigen::MatrixXd& _D1, + const Eigen::MatrixXd& _D2, + double _Lambda, + double _perturb_rotations, + int _fixed) +{ + V = _V; + F = _F; + + assert(_D1.rows() == _D2.rows()); + + FF.clear(); + for (unsigned i=0; i < _D1.rows(); ++i) + { + Eigen::Matrix ff; + ff.col(0) = _D1.row(i); + ff.col(1) = _D2.row(i); + FF.push_back(ff); + } + + fixed = _fixed; + Lambda = _Lambda; + perturb_rotations = _perturb_rotations; + + reset_opt(); + precompute_opt(); +} + + +IGL_INLINE void Frame_field_deformer::optimize(int N, bool reset) +{ + //Reset optimization + if (reset) + reset_opt(); + + // Iterative Local/Global optimization + for (int i=0; i MA; // internal matrix for ARAP-warping energy + MatrixXd LfcVc; // RHS (partial) for ARAP-warping energy + SparseMatrix MS; // internal matrix for smoothing energy + MatrixXd bS; // RHS (full) for smoothing energy + + precompute_ARAP(MA,LfcVc); // precompute terms for the ARAP-warp part + precompute_SMOOTH(MS,bS); // precompute terms for the smoothing part + compute_idealWarp(WW); // computes the ideal warps + RW.resize(F.rows()); // init rotation matrices - global + + M = (1-Lambda)*MA + Lambda*MS; // matrix for linear system - global + + RHS = (1-Lambda)*LfcVc + Lambda*bS; // RHS (partial) for linear system - global + solver.compute(M); // system pre-conditioning + if (solver.info()!=Eigen::Success) {fprintf(stderr,"Decomposition failed in pre-conditioning!\n"); exit(-1);} + + fprintf(stdout,"Preconditioning done.\n"); + +} + +IGL_INLINE void Frame_field_deformer::precompute_ARAP(Eigen::SparseMatrix & Lff, Eigen::MatrixXd & LfcVc) +{ + using namespace Eigen; + fprintf(stdout,"Precomputing ARAP terms\n"); + SparseMatrix LL = -4*L; + Lff = SparseMatrix(nfree,nfree); + extractBlock(LL,0,0,nfree,nfree,Lff); + SparseMatrix Lfc = SparseMatrix(nfree,nconst); + extractBlock(LL,0,nfree,nfree,nconst,Lfc); + LfcVc = - Lfc * V_w.block(nfree,0,nconst,3); +} + +IGL_INLINE void Frame_field_deformer::precompute_SMOOTH(Eigen::SparseMatrix & MS, Eigen::MatrixXd & bS) +{ + using namespace Eigen; + fprintf(stdout,"Precomputing SMOOTH terms\n"); + + SparseMatrix LL = 4*L*L; + + // top-left + MS = SparseMatrix(nfree,nfree); + extractBlock(LL,0,0,nfree,nfree,MS); + + // top-right + SparseMatrix Mfc = SparseMatrix(nfree,nconst); + extractBlock(LL,0,nfree,nfree,nconst,Mfc); + + MatrixXd MfcVc = Mfc * V_w.block(nfree,0,nconst,3); + bS = (LL*V).block(0,0,nfree,3)-MfcVc; + +} + + IGL_INLINE void Frame_field_deformer::extractBlock(Eigen::SparseMatrix & mat, int r0, int c0, int r, int c, Eigen::SparseMatrix & m1) +{ + std::vector > tripletList; + for (int k=c0; k::InnerIterator it(mat,k); it; ++it) + { + if (it.row()>=r0 && it.row()(it.row()-r0,it.col()-c0,it.value())); + } + m1.setFromTriplets(tripletList.begin(), tripletList.end()); +} + +IGL_INLINE void Frame_field_deformer::compute_optimal_rotations() +{ + using namespace Eigen; + Matrix r,S,P,PP,D; + + for (int i=0;i > svd(S, Eigen::ComputeFullU | Eigen::ComputeFullV ); + Matrix su = svd.matrixU(); + Matrix sv = svd.matrixV(); + r = su*sv.transpose(); + + if (r.determinant()<0) // correct reflections + { + su(0,2)=-su(0,2); su(1,2)=-su(1,2); su(2,2)=-su(2,2); + r = su*sv.transpose(); + } + RW[i] = r*WW[i]; // RW INCORPORATES IDEAL WARP WW!!! + } +} + +IGL_INLINE void Frame_field_deformer::compute_optimal_positions() +{ + using namespace Eigen; + // compute variable RHS of ARAP-warp part of the system + MatrixXd b(nfree,3); // fx3 known term of the system + MatrixXd X; // result + int t; // triangles incident to edge (i,j) + int vi,i1,i2; // index of vertex i wrt tri t0 + + for (int i=0;i > & XF) +{ + using namespace Eigen; + Matrix P,PP,DG; + XF.resize(F.rows()); + + for (int i=0;i > & WW) +{ + using namespace Eigen; + + WW.resize(F.rows()); + for (int i=0;i<(int)FF.size();i++) + { + Vector3d v0,v1,v2; + v0 = FF[i].col(0); + v1 = FF[i].col(1); + v2=v0.cross(v1); v2.normalize(); // normal + + Matrix3d A,AI; // compute affine map A that brings: + A << v0[0], v1[0], v2[0], // first vector of FF to x unary vector + v0[1], v1[1], v2[1], // second vector of FF to xy plane + v0[2], v1[2], v2[2]; // triangle normal to z unary vector + AI = A.inverse(); + + // polar decomposition to discard rotational component (unnecessary but makes it easier) + Eigen::JacobiSVD > svd(AI, Eigen::ComputeFullU | Eigen::ComputeFullV ); + //Matrix au = svd.matrixU(); + Matrix av = svd.matrixV(); + DiagonalMatrix as(svd.singularValues()); + WW[i] = av*as*av.transpose(); + } +} + +} + + +IGL_INLINE void igl::frame_field_deformer( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::MatrixXd& FF1, + const Eigen::MatrixXd& FF2, + Eigen::MatrixXd& V_d, + Eigen::MatrixXd& FF1_d, + Eigen::MatrixXd& FF2_d, + const int iterations, + const double lambda, + const bool perturb_initial_guess) +{ + using namespace Eigen; + // Solvers + Frame_field_deformer deformer; + + // Init optimizer + deformer.init(V, F, FF1, FF2, lambda, perturb_initial_guess ? 0.1 : 0); + + // Optimize + deformer.optimize(iterations,true); + + // Copy positions + V_d = deformer.V_w; + + // Allocate + FF1_d.resize(F.rows(),3); + FF2_d.resize(F.rows(),3); + + // Copy frame field + for(unsigned i=0; i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_FRAME_FIELD_DEFORMER_H +#define IGL_FRAME_FIELD_DEFORMER_H +#include "igl_inline.h" + +#include + +namespace igl +{ + // Deform a mesh to transform the given per-face frame field to be as close + // as possible to a cross field, in the least square sense. + // + // Inputs: + // V #V by 3 coordinates of the vertices + // F #F by 3 list of mesh faces (must be triangles) + // FF1 #F by 3 first representative vector of the frame field + // FF2 #F by 3 second representative vector of the frame field + // lambda laplacian regularization parameter 0=no regularization 1=full regularization + // + // Outputs: + // V_d #F by 3 deformed, first representative vector + // V_d #F by 3 deformed, first representative vector + // V_d #F by 3 deformed, first representative vector + // + IGL_INLINE void frame_field_deformer( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::MatrixXd& FF1, + const Eigen::MatrixXd& FF2, + Eigen::MatrixXd& V_d, + Eigen::MatrixXd& FF1_d, + Eigen::MatrixXd& FF2_d, + const int iterations = 50, + const double lambda = 0.1, + const bool perturb_initial_guess = true); + +} + +#ifndef IGL_STATIC_LIBRARY +# include "frame_field_deformer.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/get_seconds_hires.h b/vendor/libigl/include/igl/get_seconds_hires.h new file mode 100644 index 0000000000000000000000000000000000000000..abe8956b5c0996f068a00230f711eba13be61397 --- /dev/null +++ b/vendor/libigl/include/igl/get_seconds_hires.h @@ -0,0 +1,22 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_GET_SECONDS_HIRES_H +#define IGL_GET_SECONDS_HIRES_H +#include "igl_inline.h" + +namespace igl +{ + // Return the current time in seconds using performance counters + IGL_INLINE double get_seconds_hires(); +} + +#ifndef IGL_STATIC_LIBRARY +# include "get_seconds_hires.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/grad.cpp b/vendor/libigl/include/igl/grad.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ab1a52fa0fab3a5173456d0e45cbe481aab77785 --- /dev/null +++ b/vendor/libigl/include/igl/grad.cpp @@ -0,0 +1,240 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "grad.h" +#include +#include + +#include "PI.h" +#include "per_face_normals.h" +#include "volume.h" +#include "doublearea.h" + +namespace igl { + +namespace { + +template +IGL_INLINE void grad_tet( + const Eigen::MatrixBase&V, + const Eigen::MatrixBase&T, + Eigen::SparseMatrix &G, + bool uniform) +{ + using namespace Eigen; + assert(T.cols() == 4); + const int n = V.rows(); int m = T.rows(); + + /* + F = [ ... + T(:,1) T(:,2) T(:,3); ... + T(:,1) T(:,3) T(:,4); ... + T(:,1) T(:,4) T(:,2); ... + T(:,2) T(:,4) T(:,3)]; */ + MatrixXi F(4*m,3); + for (int i = 0; i < m; i++) { + F.row(0*m + i) << T(i,0), T(i,1), T(i,2); + F.row(1*m + i) << T(i,0), T(i,2), T(i,3); + F.row(2*m + i) << T(i,0), T(i,3), T(i,1); + F.row(3*m + i) << T(i,1), T(i,3), T(i,2); + } + // compute volume of each tet + Eigen::Matrix vol; + igl::volume(V,T,vol); + + Eigen::Matrix A(F.rows()); + Eigen::Matrix N(F.rows(),3); + if (!uniform) { + // compute tetrahedron face normals + igl::per_face_normals(V,F,N); int norm_rows = N.rows(); + for (int i = 0; i < norm_rows; i++) + N.row(i) /= N.row(i).norm(); + igl::doublearea(V,F,A); A/=2.; + } else { + // Use a uniform tetrahedra as a reference, with the same volume as the original one: + // + // Use normals of the uniform tet (V = h*[0,0,0;1,0,0;0.5,sqrt(3)/2.,0;0.5,sqrt(3)/6.,sqrt(2)/sqrt(3)]) + // 0 0 1.0000 + // 0.8165 -0.4714 -0.3333 + // 0 0.9428 -0.3333 + // -0.8165 -0.4714 -0.3333 + for (int i = 0; i < m; i++) { + N.row(0*m+i) << 0,0,1; + double a = sqrt(2)*std::cbrt(3*vol(i)); // area of a face in a uniform tet with volume = vol(i) + A(0*m+i) = (pow(a,2)*sqrt(3))/4.; + } + for (int i = 0; i < m; i++) { + N.row(1*m+i) << 0.8165,-0.4714,-0.3333; + double a = sqrt(2)*std::cbrt(3*vol(i)); + A(1*m+i) = (pow(a,2)*sqrt(3))/4.; + } + for (int i = 0; i < m; i++) { + N.row(2*m+i) << 0,0.9428,-0.3333; + double a = sqrt(2)*std::cbrt(3*vol(i)); + A(2*m+i) = (pow(a,2)*sqrt(3))/4.; + } + for (int i = 0; i < m; i++) { + N.row(3*m+i) << -0.8165,-0.4714,-0.3333; + double a = sqrt(2)*std::cbrt(3*vol(i)); + A(3*m+i) = (pow(a,2)*sqrt(3))/4.; + } + + } + + /* G = sparse( ... + [0*m + repmat(1:m,1,4) ... + 1*m + repmat(1:m,1,4) ... + 2*m + repmat(1:m,1,4)], ... + repmat([T(:,4);T(:,2);T(:,3);T(:,1)],3,1), ... + repmat(A./(3*repmat(vol,4,1)),3,1).*N(:), ... + 3*m,n);*/ + std::vector > G_t; + for (int i = 0; i < 4*m; i++) { + int T_j; // j indexes : repmat([T(:,4);T(:,2);T(:,3);T(:,1)],3,1) + switch (i/m) { + case 0: + T_j = 3; + break; + case 1: + T_j = 1; + break; + case 2: + T_j = 2; + break; + case 3: + T_j = 0; + break; + } + int i_idx = i%m; + int j_idx = T(i_idx,T_j); + + double val_before_n = A(i)/(3*vol(i_idx)); + G_t.push_back(Triplet(0*m+i_idx, j_idx, val_before_n * N(i,0))); + G_t.push_back(Triplet(1*m+i_idx, j_idx, val_before_n * N(i,1))); + G_t.push_back(Triplet(2*m+i_idx, j_idx, val_before_n * N(i,2))); + } + G.resize(3*m,n); + G.setFromTriplets(G_t.begin(), G_t.end()); +} + +template +IGL_INLINE void grad_tri( + const Eigen::MatrixBase&V, + const Eigen::MatrixBase&F, + Eigen::SparseMatrix &G, + bool uniform) +{ + // Number of faces + const int m = F.rows(); + // Number of vertices + const int nv = V.rows(); + // Number of dimensions + const int dims = V.cols(); + Eigen::Matrix + eperp21(m,3), eperp13(m,3); + + for (int i=0;i RowVector3S; + RowVector3S v32 = RowVector3S::Zero(1,3); + RowVector3S v13 = RowVector3S::Zero(1,3); + RowVector3S v21 = RowVector3S::Zero(1,3); + v32.head(V.cols()) = V.row(i3) - V.row(i2); + v13.head(V.cols()) = V.row(i1) - V.row(i3); + v21.head(V.cols()) = V.row(i2) - V.row(i1); + RowVector3S n = v32.cross(v13); + // area of parallelogram is twice area of triangle + // area of parallelogram is || v1 x v2 || + // This does correct l2 norm of rows, so that it contains #F list of twice + // triangle areas + double dblA = std::sqrt(n.dot(n)); + Eigen::Matrix u(0,0,1); + if (!uniform) { + // now normalize normals to get unit normals + u = n / dblA; + } else { + // Abstract equilateral triangle v1=(0,0), v2=(h,0), v3=(h/2, (sqrt(3)/2)*h) + + // get h (by the area of the triangle) + double h = sqrt( (dblA)/sin(igl::PI / 3.0)); // (h^2*sin(60))/2. = Area => h = sqrt(2*Area/sin_60) + + Eigen::Matrix v1,v2,v3; + v1 << 0,0,0; + v2 << h,0,0; + v3 << h/2.,(sqrt(3)/2.)*h,0; + + // now fix v32,v13,v21 and the normal + v32 = v3-v2; + v13 = v1-v3; + v21 = v2-v1; + n = v32.cross(v13); + } + + // rotate each vector 90 degrees around normal + double norm21 = std::sqrt(v21.dot(v21)); + double norm13 = std::sqrt(v13.dot(v13)); + eperp21.row(i) = u.cross(v21); + eperp21.row(i) = eperp21.row(i) / std::sqrt(eperp21.row(i).dot(eperp21.row(i))); + eperp21.row(i) *= norm21 / dblA; + eperp13.row(i) = u.cross(v13); + eperp13.row(i) = eperp13.row(i) / std::sqrt(eperp13.row(i).dot(eperp13.row(i))); + eperp13.row(i) *= norm13 / dblA; + } + + // create sparse gradient operator matrix + G.resize(dims*m,nv); + std::vector > Gijv; + Gijv.reserve(4*dims*m); + for(int f = 0;f +IGL_INLINE void igl::grad( + const Eigen::MatrixBase&V, + const Eigen::MatrixBase&F, + Eigen::SparseMatrix &G, + bool uniform) +{ + assert(F.cols() == 3 || F.cols() == 4); + switch(F.cols()) + { + case 3: + return grad_tri(V,F,G,uniform); + case 4: + return grad_tet(V,F,G,uniform); + default: + assert(false); + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::grad, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::SparseMatrix::Scalar, 0, int>&, bool); +template void igl::grad, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::SparseMatrix::Scalar, 0, int>&, bool); +template void igl::grad, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::SparseMatrix::Scalar, 0, int>&, bool); +#endif diff --git a/vendor/libigl/include/igl/group_sum_matrix.cpp b/vendor/libigl/include/igl/group_sum_matrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d3cf0bff27de7246f8dd6d43843c93189e6619aa --- /dev/null +++ b/vendor/libigl/include/igl/group_sum_matrix.cpp @@ -0,0 +1,46 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "group_sum_matrix.h" + +template +IGL_INLINE void igl::group_sum_matrix( + const Eigen::Matrix & G, + const int k, + Eigen::SparseMatrix& A) +{ + // number of vertices + int n = G.rows(); + assert(k > G.maxCoeff()); + + A.resize(k,n); + + // builds A such that A(i,j) = 1 where i corresponds to group i and j + // corresponds to vertex j + + // Loop over vertices + for(int j = 0;j +IGL_INLINE void igl::group_sum_matrix( + const Eigen::Matrix & G, + Eigen::SparseMatrix& A) +{ + return group_sum_matrix(G,G.maxCoeff()+1,A); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::group_sum_matrix(Eigen::Matrix const&, int, Eigen::SparseMatrix&); +template void igl::group_sum_matrix(Eigen::Matrix const&, Eigen::SparseMatrix&); +#endif diff --git a/vendor/libigl/include/igl/group_sum_matrix.h b/vendor/libigl/include/igl/group_sum_matrix.h new file mode 100644 index 0000000000000000000000000000000000000000..805544b0bcd2d9acfe2986080339b173f78a8bac --- /dev/null +++ b/vendor/libigl/include/igl/group_sum_matrix.h @@ -0,0 +1,45 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_GROUP_SUM_MATRIX_H +#define IGL_GROUP_SUM_MATRIX_H +#include "igl_inline.h" + +#include +#include + +namespace igl +{ + // GROUP_SUM_MATRIX Builds a matrix A such that A*V computes the sum of + // vertices in each group specified by G + // + // group_sum_matrix(G,k,A); + // + // Templates: + // T should be a eigen sparse matrix primitive type like int or double + // Inputs: + // G #V list of group indices (0 to k-1) for each vertex, such that vertex i + // is assigned to group G(i) + // k #groups, good choice is max(G)+1 + // Outputs: + // A #groups by #V sparse matrix such that A*V = group_sums + // + template + IGL_INLINE void group_sum_matrix( + const Eigen::Matrix & G, + const int k, + Eigen::SparseMatrix& A); + // Wrapper with k = max(G)+1 + template + IGL_INLINE void group_sum_matrix( + const Eigen::Matrix & G, + Eigen::SparseMatrix& A); +} +#ifndef IGL_STATIC_LIBRARY +# include "group_sum_matrix.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/harwell_boeing.h b/vendor/libigl/include/igl/harwell_boeing.h new file mode 100644 index 0000000000000000000000000000000000000000..df166ab829faacf6380e17169d718cd6f3ad51af --- /dev/null +++ b/vendor/libigl/include/igl/harwell_boeing.h @@ -0,0 +1,48 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_HARWELL_BOEING_H +#define IGL_HARWELL_BOEING_H +#include "igl_inline.h" + +#include +#include + + +namespace igl +{ + // Convert the matrix to Compressed sparse column (CSC or CCS) format, + // also known as Harwell Boeing format. As described: + // http://netlib.org/linalg/html_templates/node92.html + // or + // http://en.wikipedia.org/wiki/Sparse_matrix + // #Compressed_sparse_column_.28CSC_or_CCS.29 + // Templates: + // Scalar type of sparse matrix like double + // Inputs: + // A sparse m by n matrix + // Outputs: + // num_rows number of rows + // V non-zero values, row indices running fastest, size(V) = nnz + // R row indices corresponding to vals, size(R) = nnz + // C index in vals of first entry in each column, size(C) = num_cols+1 + // + // All indices and pointers are 0-based + template + IGL_INLINE void harwell_boeing( + const Eigen::SparseMatrix & A, + int & num_rows, + std::vector & V, + std::vector & R, + std::vector & C); +} + +#ifndef IGL_STATIC_LIBRARY +# include "harwell_boeing.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/in_element.h b/vendor/libigl/include/igl/in_element.h new file mode 100644 index 0000000000000000000000000000000000000000..c438f62eebf3fb420801516b753f9c4ef1c0111c --- /dev/null +++ b/vendor/libigl/include/igl/in_element.h @@ -0,0 +1,54 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_IN_ELEMENT_H +#define IGL_IN_ELEMENT_H + +#include "igl_inline.h" +#include "AABB.h" +#include +#include + +namespace igl +{ + // Determine whether each point in a list of points is in the elements of a + // mesh. + // + // templates: + // DIM dimension of vertices in V (# of columns) + // Inputs: + // V #V by dim list of mesh vertex positions. + // Ele #Ele by dim+1 list of mesh indices into #V. + // Q #Q by dim list of query point positions + // aabb axis-aligned bounding box tree object (see AABB.h) + // Outputs: + // I #Q list of indices into Ele of first containing element (-1 means no + // containing element) + template + IGL_INLINE void in_element( + const Eigen::MatrixBase & V, + const Eigen::MatrixXi & Ele, + const Eigen::MatrixBase & Q, + const AABB & aabb, + Eigen::VectorXi & I); + // Outputs: + // I #Q by #Ele sparse matrix revealing whether each element contains each + // point: I(q,e) means point q is in element e + template + IGL_INLINE void in_element( + const Eigen::MatrixBase & V, + const Eigen::MatrixXi & Ele, + const Eigen::MatrixBase & Q, + const AABB & aabb, + Eigen::SparseMatrix & I); +}; + +#ifndef IGL_STATIC_LIBRARY +#include "in_element.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/infinite_cost_stopping_condition.cpp b/vendor/libigl/include/igl/infinite_cost_stopping_condition.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8d6f15be8ef2f4477840c84d07c1cdcfebdfac02 --- /dev/null +++ b/vendor/libigl/include/igl/infinite_cost_stopping_condition.cpp @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "infinite_cost_stopping_condition.h" + +IGL_INLINE void igl::infinite_cost_stopping_condition( + const decimate_cost_and_placement_callback & cost_and_placement, + decimate_stopping_condition_callback & stopping_condition) +{ + stopping_condition = + [&cost_and_placement] + ( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXi & E, + const Eigen::VectorXi & EMAP, + const Eigen::MatrixXi & EF, + const Eigen::MatrixXi & EI, + const igl::min_heap< std::tuple > & ,/*Q*/ + const Eigen::VectorXi & ,/*EQ*/ + const Eigen::MatrixXd & /*C*/, + const int e, + const int /*e1*/, + const int /*e2*/, + const int /*f1*/, + const int /*f2*/)->bool + { + Eigen::RowVectorXd p; + double cost; + cost_and_placement(e,V,F,E,EMAP,EF,EI,cost,p); + return std::isinf(cost); + }; +} + +IGL_INLINE igl::decimate_stopping_condition_callback + igl::infinite_cost_stopping_condition( + const decimate_cost_and_placement_callback & cost_and_placement) +{ + decimate_stopping_condition_callback stopping_condition; + infinite_cost_stopping_condition(cost_and_placement,stopping_condition); + return stopping_condition; +} + diff --git a/vendor/libigl/include/igl/internal_angles.h b/vendor/libigl/include/igl/internal_angles.h new file mode 100644 index 0000000000000000000000000000000000000000..1469549d9aae9b99695c34bf7c50a2b993da1e4f --- /dev/null +++ b/vendor/libigl/include/igl/internal_angles.h @@ -0,0 +1,51 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_INTERNAL_ANGLES_H +#define IGL_INTERNAL_ANGLES_H +#include "igl_inline.h" +#include "deprecated.h" +#include +namespace igl +{ + // Compute internal angles for a triangle mesh + // + // Inputs: + // V #V by dim eigen Matrix of mesh vertex nD positions + // F #F by poly-size eigen Matrix of face (triangle) indices + // Output: + // K #F by poly-size eigen Matrix of internal angles + // for triangles, columns correspond to edges [1,2],[2,0],[0,1] + // + // Known Issues: + // if poly-size ≠ 3 then dim must equal 3. + template + IGL_INLINE void internal_angles( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + Eigen::PlainObjectBase & K); + // Inputs: + // L_sq #F by 3 list of squared edge lengths + // Output: + // K #F by poly-size eigen Matrix of internal angles + // for triangles, columns correspond to edges [1,2],[2,0],[0,1] + // + // Note: + // Usage of internal_angles_using_squared_edge_lengths is preferred to internal_angles_using_squared_edge_lengths + template + IGL_INLINE void internal_angles_using_squared_edge_lengths( + const Eigen::MatrixBase& L_sq, + Eigen::PlainObjectBase & K); +} + +#ifndef IGL_STATIC_LIBRARY +# include "internal_angles.cpp" +#endif + +#endif + + diff --git a/vendor/libigl/include/igl/is_border_vertex.cpp b/vendor/libigl/include/igl/is_border_vertex.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2bd4c60f6ef1b7098dcfdaca64c43d058f570288 --- /dev/null +++ b/vendor/libigl/include/igl/is_border_vertex.cpp @@ -0,0 +1,37 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "is_border_vertex.h" +#include + +#include "triangle_triangle_adjacency.h" + +template +IGL_INLINE std::vector igl::is_border_vertex( + const Eigen::MatrixBase &F) +{ + Eigen::Matrix FF; + igl::triangle_triangle_adjacency(F,FF); + std::vector ret(F.maxCoeff()+1); + for(unsigned i=0; i > igl::is_border_vertex >(Eigen::MatrixBase > const&); +template std::vector > igl::is_border_vertex >(Eigen::MatrixBase > const&); +#endif diff --git a/vendor/libigl/include/igl/is_edge_manifold.h b/vendor/libigl/include/igl/is_edge_manifold.h new file mode 100644 index 0000000000000000000000000000000000000000..3ed18ceb2df2e7565a6d8a0a8a82166e2496dbcc --- /dev/null +++ b/vendor/libigl/include/igl/is_edge_manifold.h @@ -0,0 +1,72 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_IS_EDGE_MANIFOLD_H +#define IGL_IS_EDGE_MANIFOLD_H +#include "igl_inline.h" + +#include + +namespace igl +{ + // check if the mesh is edge-manifold (every edge is incident one one face + // (boundary) or two oppositely oriented faces). + // + // Inputs: + // F #F by 3 list of triangle indices + // Returns true iff all edges are manifold + // + // See also: is_vertex_manifold + template + IGL_INLINE bool is_edge_manifold( + const Eigen::MatrixBase& F); + // Inputs: + // F #F by 3 list of triangle indices + // Outputs: + // BF #F by 3 list of flags revealing if edge opposite corresponding vertex + // is non-manifold. + // E #E by 2 list of unique edges + // EMAP 3*#F list of indices of opposite edges in "E" + // BE #E list of flages whether edge is non-manifold + template < + typename DerivedF, + typename DerivedBF, + typename DerivedE, + typename DerivedEMAP, + typename DerivedBE> + IGL_INLINE bool is_edge_manifold( + const Eigen::MatrixBase& F, + Eigen::PlainObjectBase& BF, + Eigen::PlainObjectBase& E, + Eigen::PlainObjectBase& EMAP, + Eigen::PlainObjectBase& BE); + // Inputs: + // F #F by 3 list of triangle indices + // ne number of edges (#E) + // EMAP 3*#F list of indices of opposite edges in "E" + // Outputs: + // BF #F by 3 list of flags revealing if edge opposite corresponding vertex + // is non-manifold. + // BE ne list of flages whether edge is non-manifold + template < + typename DerivedF, + typename DerivedEMAP, + typename DerivedBF, + typename DerivedBE> + IGL_INLINE bool is_edge_manifold( + const Eigen::MatrixBase& F, + const typename DerivedF::Index ne, + const Eigen::MatrixBase& EMAP, + Eigen::PlainObjectBase& BF, + Eigen::PlainObjectBase& BE); +} + +#ifndef IGL_STATIC_LIBRARY +# include "is_edge_manifold.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/is_intrinsic_delaunay.cpp b/vendor/libigl/include/igl/is_intrinsic_delaunay.cpp new file mode 100644 index 0000000000000000000000000000000000000000..84afd29961671cee69ca1ec31ce02425ab8b928c --- /dev/null +++ b/vendor/libigl/include/igl/is_intrinsic_delaunay.cpp @@ -0,0 +1,146 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "is_intrinsic_delaunay.h" +#include "unique_edge_map.h" +#include "tan_half_angle.h" +#include "EPS.h" +#include "cotmatrix_entries.h" +#include +#include +template < + typename Derivedl, + typename DerivedF, + typename DerivedD> +IGL_INLINE void igl::is_intrinsic_delaunay( + const Eigen::MatrixBase & l, + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & D) +{ + typedef Eigen::Matrix MatrixX2I; + typedef Eigen::Matrix VectorXI; + MatrixX2I E,uE; + VectorXI EMAP; + std::vector > uE2E; + igl::unique_edge_map(F, E, uE, EMAP, uE2E); + return is_intrinsic_delaunay(l,F,uE2E,D); +} + +template < + typename Derivedl, + typename DerivedF, + typename uE2EType, + typename DerivedD> +IGL_INLINE void igl::is_intrinsic_delaunay( + const Eigen::MatrixBase & l, + const Eigen::MatrixBase & F, + const std::vector > & uE2E, + Eigen::PlainObjectBase & D) +{ + const int num_faces = F.rows(); + D.setConstant(F.rows(),F.cols(),false); + // loop over all unique edges + for(int ue = 0;ue < uE2E.size(); ue++) + { + const bool ue_is_d = is_intrinsic_delaunay(l,uE2E,num_faces,ue); + // Set for all instances + for(int e = 0;e +IGL_INLINE bool igl::is_intrinsic_delaunay( + const Eigen::MatrixBase & l, + const std::vector > & uE2E, + const Index num_faces, + const Index uei) +{ + if(uE2E[uei].size() == 1) return true; + if(uE2E[uei].size() > 2) return false; + typedef typename Derivedl::Scalar Scalar; + + const auto cot_alpha = []( + const Scalar & a, + const Scalar & b, + const Scalar & c)->Scalar + { + // Fisher 2007 + const Scalar t = tan_half_angle(a,b,c); + return (1.0-t*t)/(2*t); + }; + + // 2 // + // /|\ // + // a/ | \d // + // / e \ // + // / | \ // + //0.α---|-f-β.3 // + // \ | / // + // \ | / // + // b\ | /c // + // \|/ // + // . // + // 1 + + // Fisher 2007 + assert(uE2E[uei].size() == 2 && "edge should have 2 incident faces"); + const Index he1 = uE2E[uei][0]; + const Index he2 = uE2E[uei][1]; + const Index f1 = he1%num_faces; + const Index c1 = he1/num_faces; + const Index f2 = he2%num_faces; + const Index c2 = he2/num_faces; + assert( std::abs(l(f1,c1)-l(f2,c2)) < igl::EPS()); + const Scalar e = l(f1,c1); + const Scalar a = l(f1,(c1+1)%3); + const Scalar b = l(f1,(c1+2)%3); + const Scalar c = l(f2,(c2+1)%3); + const Scalar d = l(f2,(c2+2)%3); + const Scalar w = cot_alpha(e,a,b) + cot_alpha(e,c,d); + + //// Test + //{ + // Eigen::MatrixXd l(2,3); + // l<1e-10) + // { + // std::cout<= 0; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::is_intrinsic_delaunay, int, int>(Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&, int, int); +// generated by autoexplicit.sh +template bool igl::is_intrinsic_delaunay, int, int>(Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&, int, int); +// generated by autoexplicit.sh +template void igl::is_intrinsic_delaunay, Eigen::Matrix, int, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::is_intrinsic_delaunay, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::is_intrinsic_delaunay, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/is_sparse.cpp b/vendor/libigl/include/igl/is_sparse.cpp new file mode 100644 index 0000000000000000000000000000000000000000..507393d853d8277bc70a002c0784515b6d2312d1 --- /dev/null +++ b/vendor/libigl/include/igl/is_sparse.cpp @@ -0,0 +1,28 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "is_sparse.h" +template +IGL_INLINE bool igl::is_sparse( + const Eigen::SparseMatrix & A) +{ + return true; +} +template +IGL_INLINE bool igl::is_sparse( + const Eigen::PlainObjectBase& A) +{ + return false; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::is_sparse(Eigen::SparseMatrix const&); +// generated by autoexplicit.sh +template bool igl::is_sparse >(Eigen::PlainObjectBase > const&); +#endif diff --git a/vendor/libigl/include/igl/is_stl.cpp b/vendor/libigl/include/igl/is_stl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..adaea0c70e9268a1de25a07aea6d06898e095148 --- /dev/null +++ b/vendor/libigl/include/igl/is_stl.cpp @@ -0,0 +1,66 @@ +#include "is_stl.h" +#include +IGL_INLINE bool igl::is_stl(FILE * stl_file, bool & is_ascii) +{ + + // solid? + // YES NO + // / if .stl, definitely binary + // / + // perfect size? + // YES NO + // + const auto perfect_size = [](FILE * stl_file)->bool + { + //stl_file = freopen(NULL,"rb",stl_file); + // Read 80 header + char header[80]; + if(fread(header,sizeof(char),80,stl_file)!=80) + { + return false; + } + // Read number of triangles + unsigned int num_tri; + if(fread(&num_tri,sizeof(unsigned int),1,stl_file)!=1) + { + return false; + } + fseek(stl_file,0,SEEK_END); + int file_size = ftell(stl_file); + fseek(stl_file,0,SEEK_SET); + //stl_file = freopen(NULL,"r",stl_file); + return (file_size == 80 + 4 + (4*12 + 2) * num_tri); + }; + // Specifically 80 character header + char header[80]; + char solid[80]; + is_ascii = true; + bool f = true; + if(fread(header,1,80,stl_file) != 80) + { + f = false; + goto finish; + } + // make sure sscanf doesn't read past the end of the header, overwriting stack + header[sizeof(header)-1]='\0'; + + sscanf(header,"%s",solid); + if(std::string("solid") == solid) + { + f = true; + is_ascii = !perfect_size(stl_file); + }else + { + is_ascii = false; + f = perfect_size(stl_file); + } +finish: + rewind(stl_file); + return f; +} + +IGL_INLINE bool igl::is_stl(FILE * stl_file) +{ + bool is_ascii; + return is_stl(stl_file,is_ascii); +} diff --git a/vendor/libigl/include/igl/isdiag.h b/vendor/libigl/include/igl/isdiag.h new file mode 100644 index 0000000000000000000000000000000000000000..48b359245019e63ec6248c24f16936b47b9078bd --- /dev/null +++ b/vendor/libigl/include/igl/isdiag.h @@ -0,0 +1,26 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_ISDIAG_H +#define IGL_ISDIAG_H +#include "igl_inline.h" +#include +namespace igl +{ + // Determine if a given matrix is diagonal: all non-zeros lie on the + // main diagonal. + // + // Inputs: + // A m by n sparse matrix + // Returns true iff and only if the matrix is diagonal. + template + IGL_INLINE bool isdiag(const Eigen::SparseCompressedBase & A); +}; +#ifndef IGL_STATIC_LIBRARY +# include "isdiag.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/ismember.h b/vendor/libigl/include/igl/ismember.h new file mode 100644 index 0000000000000000000000000000000000000000..72be6006d7e0f7f0910018c09bde116aa212618b --- /dev/null +++ b/vendor/libigl/include/igl/ismember.h @@ -0,0 +1,52 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_ISMEMBER_H +#define IGL_ISMEMBER_H +#include "igl_inline.h" +#include +namespace igl +{ + // Determine if elements of A exist in elements of B + // + // Inputs: + // A ma by na matrix + // B mb by nb matrix + // Outputs: + // IA ma by na matrix of flags whether corresponding element of A exists in + // B + // LOCB ma by na matrix of indices in B locating matching element (-1 if + // not found), indices assume column major ordering + // + template < + typename DerivedA, + typename DerivedB, + typename DerivedIA, + typename DerivedLOCB> + IGL_INLINE void ismember( + const Eigen::MatrixBase & A, + const Eigen::MatrixBase & B, + Eigen::PlainObjectBase & IA, + Eigen::PlainObjectBase & LOCB); + template < + typename DerivedA, + typename DerivedB, + typename DerivedIA, + typename DerivedLOCB> + IGL_INLINE void ismember_rows( + const Eigen::MatrixBase & A, + const Eigen::MatrixBase & B, + Eigen::PlainObjectBase & IA, + Eigen::PlainObjectBase & LOCB); + +} + +#ifndef IGL_STATIC_LIBRARY +# include "ismember.cpp" +#endif +#endif + diff --git a/vendor/libigl/include/igl/iterative_closest_point.cpp b/vendor/libigl/include/igl/iterative_closest_point.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bf947e0f6a02db31f18130e094dce83c25a3f3a6 --- /dev/null +++ b/vendor/libigl/include/igl/iterative_closest_point.cpp @@ -0,0 +1,120 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "iterative_closest_point.h" +#include "AABB.h" +#include "per_face_normals.h" +#include "slice.h" +#include "random_points_on_mesh.h" +#include "rigid_alignment.h" +#include +#include + +template < + typename DerivedVX, + typename DerivedFX, + typename DerivedVY, + typename DerivedFY, + typename DerivedR, + typename Derivedt + > +IGL_INLINE void igl::iterative_closest_point( + const Eigen::MatrixBase & VX, + const Eigen::MatrixBase & FX, + const Eigen::MatrixBase & VY, + const Eigen::MatrixBase & FY, + const int num_samples, + const int max_iters, + Eigen::PlainObjectBase & R, + Eigen::PlainObjectBase & t) +{ + + assert(VX.cols() == 3 && "X should be a mesh in 3D"); + assert(VY.cols() == 3 && "Y should be a mesh in 3D"); + + typedef typename DerivedVX::Scalar Scalar; + typedef Eigen::Matrix MatrixXS; + typedef Eigen::Matrix VectorXS; + typedef Eigen::Matrix Matrix3S; + typedef Eigen::Matrix RowVector3S; + + // Precompute BVH on Y + AABB Ytree; + Ytree.init(VY,FY); + MatrixXS NY; + per_face_normals(VY,FY,NY); + return iterative_closest_point( + VX,FX,VY,FY,Ytree,NY,num_samples,max_iters,R,t); +} + +template < + typename DerivedVX, + typename DerivedFX, + typename DerivedVY, + typename DerivedFY, + typename DerivedNY, + typename DerivedR, + typename Derivedt + > +IGL_INLINE void igl::iterative_closest_point( + const Eigen::MatrixBase & VX, + const Eigen::MatrixBase & FX, + const Eigen::MatrixBase & VY, + const Eigen::MatrixBase & FY, + const igl::AABB & Ytree, + const Eigen::MatrixBase & NY, + const int num_samples, + const int max_iters, + Eigen::PlainObjectBase & R, + Eigen::PlainObjectBase & t) +{ + typedef typename DerivedVX::Scalar Scalar; + typedef Eigen::Matrix MatrixXS; + typedef Eigen::Matrix VectorXS; + typedef Eigen::Matrix Matrix3S; + typedef Eigen::Matrix RowVector3S; + R.setIdentity(3,3); + t.setConstant(1,3,0); + + for(int iter = 0;iter, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/kelvinlets.cpp b/vendor/libigl/include/igl/kelvinlets.cpp new file mode 100644 index 0000000000000000000000000000000000000000..28c6ed146a803689eaf27828d630284504e06cf6 --- /dev/null +++ b/vendor/libigl/include/igl/kelvinlets.cpp @@ -0,0 +1,246 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can + +#include "kelvinlets.h" +#include "PI.h" +#include "parallel_for.h" + +namespace igl { + +// Performs the deformation of a single point based on the regularized +// kelvinlets +// +// Inputs: +// dt delta time used to calculate brush tip displacement +// x dim-vector of point to be deformed +// x0 dim-vector of brush tip +// f dim-vector of brush force (translation) +// F dim by dim matrix of brush force matrix (linear) +// kp parameters for the kelvinlet brush like brush radius, scale etc +// Returns: +// X dim-vector of the new point x gets displaced to post deformation +template +IGL_INLINE auto kelvinlet_evaluator(const Scalar dt, + const Eigen::MatrixBase& x, + const Eigen::MatrixBase& x0, + const Eigen::MatrixBase& f, + const Eigen::MatrixBase& F, + const igl::KelvinletParams& kp) + -> Eigen::Matrix +{ + static constexpr double POISSON_RATIO = 0.5; + static constexpr double SHEAR_MODULUS = 1; + static constexpr double a = 1 / (4 * igl::PI * SHEAR_MODULUS); + static constexpr double b = a / (4 * (1 - POISSON_RATIO)); + static constexpr double c = 2 / (3 * a - 2 * b); + + const auto linearVelocity = f / c / kp.epsilon; + + const auto originAdjusted = x0 + linearVelocity * dt; + const auto r = x - originAdjusted; + const auto r_norm_sq = r.squaredNorm(); + + std::function(const Scalar&)> kelvinlet; + + switch (kp.brushType) { + case igl::BrushType::GRAB: { + // Regularized Kelvinlets: Formula (6) + kelvinlet = [&r, &f, &r_norm_sq](const Scalar& epsilon) { + const auto r_epsilon = sqrt(r_norm_sq + epsilon * epsilon); + const auto r_epsilon_3 = r_epsilon * r_epsilon * r_epsilon; + auto t1 = ((a - b) / r_epsilon) * f; + auto t2 = ((b / r_epsilon_3) * r * r.transpose()) * f; + auto t3 = ((a * epsilon * epsilon) / (2 * r_epsilon_3)) * f; + return t1 + t2 + t3; + }; + break; + } + case igl::BrushType::TWIST: { + // Regularized Kelvinlets: Formula (15) + kelvinlet = [&r, &F, &r_norm_sq](const Scalar& epsilon) { + const auto r_epsilon = sqrt(r_norm_sq + epsilon * epsilon); + const auto r_epsilon_3 = r_epsilon * r_epsilon * r_epsilon; + return -a * + (1 / (r_epsilon_3) + + 3 * epsilon * epsilon / + (2 * r_epsilon_3 * r_epsilon * r_epsilon)) * + F * r; + }; + break; + } + case igl::BrushType::SCALE: { + // Regularized Kelvinlets: Formula (16) + kelvinlet = [&r, &F, &r_norm_sq](const Scalar& epsilon) { + static constexpr auto b_compressible = a / 4; // assumes poisson ratio 0 + const auto r_epsilon = sqrt(r_norm_sq + epsilon * epsilon); + const auto r_epsilon_3 = r_epsilon * r_epsilon * r_epsilon; + auto coeff = + (2 * b_compressible - a) * + (1 / (r_epsilon_3) + + 3 * (epsilon * epsilon) / (2 * r_epsilon_3 * r_epsilon * r_epsilon)); + return coeff * F * r; + }; + break; + } + case igl::BrushType::PINCH: { + // Regularized Kelvinlets: Formula (17) + kelvinlet = [&r, &F, &r_norm_sq, &kp](const Scalar& epsilon) { + const auto r_epsilon = sqrt(r_norm_sq + kp.epsilon * kp.epsilon); + const auto r_epsilon_3 = r_epsilon * r_epsilon * r_epsilon; + auto t1 = ((2 * b - a) / r_epsilon_3) * F * r; + auto t2_coeff = 3 / (2 * r_epsilon * r_epsilon * r_epsilon_3); + auto t2 = t2_coeff * (2 * b * (r.transpose().dot(F * r)) * r + + a * epsilon * epsilon * epsilon * F * r); + return t1 - t2; + }; + break; + } + } + + if (kp.scale == 1) { + return kelvinlet(kp.ep[0]); + } else if (kp.scale == 2) { + // Regularized Kelvinlets: Formula (8) + return (kelvinlet(kp.ep[0]) - kelvinlet(kp.ep[1])) * 10; + } + // Regularized Kelvinlets: Formula (10) + return (kp.w[0] * kelvinlet(kp.ep[0]) + kp.w[1] * kelvinlet(kp.ep[1]) + + kp.w[2] * kelvinlet(kp.ep[2])) * + 20; +}; + +// Implements the Bogacki-Shrampine ODE Solver +// https://en.wikipedia.org/wiki/Bogacki%E2%80%93Shampine_method +// +// It calculates the second and third order approximations which can be used to +// estimate the error in the integration step +// +// Inputs: +// t starting time +// dt delta time used to calculate brush tip displacement +// x dim-vector of point to be deformed +// x0 dim-vector of brush tip +// f dim-vector of brush force (translation) +// F dim by dim matrix of brush force matrix (linear) +// kp parameters for the kelvinlet brush like brush radius, scale etc +// Outputs: +// result dim vector holding the third order approximation result +// error The euclidean distance between the second and third order +// approximations +template +IGL_INLINE void integrate(const Scalar t, + const Scalar dt, + const Eigen::MatrixBase& x, + const Eigen::MatrixBase& x0, + const Eigen::MatrixBase& f, + const Eigen::MatrixBase& F, + const igl::KelvinletParams& kp, + Eigen::MatrixBase& result, + Scalar& error) +{ + constexpr Scalar a1 = 0; + constexpr Scalar a2 = 1 / 2.0f; + constexpr Scalar a3 = 3 / 4.0f; + constexpr Scalar a4 = 1.0f; + + constexpr Scalar b21 = 1 / 2.0f; + constexpr Scalar b31 = 0; + constexpr Scalar b32 = 3 / 4.0f; + constexpr Scalar b41 = 2 / 9.0f; + constexpr Scalar b42 = 1 / 3.0f; + constexpr Scalar b43 = 4 / 9.0f; + + constexpr Scalar c1 = 2 / 9.0f; // third order answer + constexpr Scalar c2 = 1 / 3.0f; + constexpr Scalar c3 = 4 / 9.0f; + + constexpr Scalar d1 = 7 / 24.0f; // second order answer + constexpr Scalar d2 = 1 / 4.0f; + constexpr Scalar d3 = 1 / 3.0f; + constexpr Scalar d4 = 1 / 8.0f; + + auto k1 = dt * kelvinlet_evaluator(t + dt * a1, x, x0, f, F, kp); + auto k2 = dt * kelvinlet_evaluator(t + dt * a2, x + k1 * b21, x0, f, F, kp); + auto k3 = dt * kelvinlet_evaluator( + t + dt * a3, x + k1 * b31 + k2 * b32, x0, f, F, kp); + auto k4 = + dt * kelvinlet_evaluator( + t + dt * a4, x + k1 * b41 + k2 * b42 + k3 * b43, x0, f, F, kp); + auto r1 = x + k1 * d1 + k2 * d2 + k3 * d3 + k4 * d4; + auto r2 = x + k1 * c1 + k2 * c2 + k3 * c3; + result = r2; + error = (r2 - r1).norm() / dt; +}; + +template +IGL_INLINE void kelvinlets( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& x0, + const Eigen::MatrixBase& f, + const Eigen::MatrixBase& F, + const KelvinletParams& params, + Eigen::PlainObjectBase& U) +{ + using Scalar = typename DerivedV::Scalar; + constexpr auto max_error = 0.001f; + constexpr Scalar safety = 0.9; + + const auto calc_displacement = [&](const int index) { + Scalar dt = 0.1; + Scalar t = 0; + + Eigen::Matrix x = V.row(index).transpose(); + decltype(x) result; + Scalar error; + // taking smaller steps seems to prevents weird inside-out artifacts in the + // final result. This implementation used an adaptive time step solver to + // numerically integrate the ODEs + while (t < 1) { + dt = std::min(dt, 1 - t); + integrate(t, dt, x, x0, f, F, params, result, error); + auto new_dt = dt * safety * std::pow(max_error / error, 1 / 3.0); + if (error <= max_error || dt <= 0.001) { + x = result; + t += dt; + dt = new_dt; + } else { + dt = std::max(abs(new_dt - dt) < 0.001 ? dt / 2.f : new_dt, 0.001); + } + } + U.row(index) = x.transpose(); + }; + + const int n = V.rows(); + U.resize(n, V.cols()); + igl::parallel_for(n, calc_displacement, 1000); +} +} +#ifdef IGL_STATIC_LIBRARY +template void igl::kelvinlets, + Eigen::Matrix, + Eigen::Matrix, + Eigen::Matrix, + Eigen::Matrix>( + Eigen::MatrixBase> const&, + Eigen::MatrixBase> const&, + Eigen::MatrixBase> const&, + Eigen::MatrixBase> const&, + igl::KelvinletParams const&, + Eigen::PlainObjectBase>&); +#endif diff --git a/vendor/libigl/include/igl/knn.cpp b/vendor/libigl/include/igl/knn.cpp new file mode 100644 index 0000000000000000000000000000000000000000..689e2f5995c93b06a173509d297d608f159b49d5 --- /dev/null +++ b/vendor/libigl/include/igl/knn.cpp @@ -0,0 +1,148 @@ +#include "knn.h" +#include "sort.h" +#include "parallel_for.h" + +#include +#include +#include +#include + +namespace igl { + template + IGL_INLINE void knn(const Eigen::MatrixBase& P, + size_t k, + const std::vector > & point_indices, + const Eigen::MatrixBase& CH, + const Eigen::MatrixBase& CN, + const Eigen::MatrixBase& W, + Eigen::PlainObjectBase & I) { + knn(P,P,k,point_indices,CH,CN,W,I); + } + + template + IGL_INLINE void knn( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& V, + size_t k, + const std::vector > & point_indices, + const Eigen::MatrixBase& CH, + const Eigen::MatrixBase& CN, + const Eigen::MatrixBase& W, + Eigen::PlainObjectBase & I) { + typedef typename DerivedCN::Scalar CentersType; + typedef typename DerivedW::Scalar WidthsType; + + using Scalar = typename DerivedP::Scalar; + typedef Eigen::Matrix RowVector3PType; + + + const size_t Psize = P.rows(); + const size_t Vsize = V.rows(); + if(Vsize <= k) { + I.resize(Psize,Vsize); + for(size_t i = 0; i < Psize; ++i) { + Eigen::Matrix D = (V.rowwise() - P.row(i)).rowwise().norm(); + Eigen::Matrix S; + Eigen::VectorXi R; + igl::sort(D,1,true,S,R); + I.row(i) = R.transpose(); + } + return; + } + + I.resize(Psize,k); + + + auto distance_to_width_one_cube = [](const RowVector3PType& point) -> Scalar { + return std::sqrt(std::pow(std::max(std::abs(point(0))-1,0.0),2) + + std::pow(std::max(std::abs(point(1))-1,0.0),2) + + std::pow(std::max(std::abs(point(2))-1,0.0),2)); + }; + + auto distance_to_cube = [&distance_to_width_one_cube] + (const RowVector3PType& point, + Eigen::Matrix cube_center, + WidthsType cube_width) -> Scalar { + RowVector3PType transformed_point = (point-cube_center)/cube_width; + return cube_width*distance_to_width_one_cube(transformed_point); + }; + + + igl::parallel_for(Psize,[&](size_t i) + { + int points_found = 0; + RowVector3PType point_of_interest = P.row(i); + + //To make my priority queue take both points and octree cells, + //I use the indices 0 to n-1 for the n points, + // and the indices n to n+m-1 for the m octree cells + + // Using lambda to compare elements. + auto cmp = [&point_of_interest, &V, &CN, &W, + Vsize, &distance_to_cube](int left, int right) { + Scalar leftdistance, rightdistance; + if(left < Vsize){ //left is a point index + leftdistance = (V.row(left) - point_of_interest).norm(); + } else { //left is an octree cell + leftdistance = distance_to_cube(point_of_interest, + CN.row(left-Vsize), + W(left-Vsize)); + } + + if(right < Vsize){ //left is a point index + rightdistance = (V.row(right) - point_of_interest).norm(); + } else { //left is an octree cell + rightdistance = distance_to_cube(point_of_interest, + CN.row(right-Vsize), + W(right-Vsize)); + } + return leftdistance > rightdistance; + }; + + std::priority_queue, + decltype(cmp)> queue(cmp); + + queue.push(Vsize); //This is the 0th octree cell (ie the root) + while(points_found < k){ + IndexType curr_cell_or_point = queue.top(); + queue.pop(); + if(curr_cell_or_point < Vsize){ //current index is for is a point + I(i,points_found) = curr_cell_or_point; + points_found++; + } else { + IndexType curr_cell = curr_cell_or_point - Vsize; + if(CH(curr_cell,0) == -1){ //In the case of a leaf + if(point_indices.at(curr_cell).size() > 0){ + //Assumption: Leaves either have one point, or none + queue.push(point_indices.at(curr_cell).at(0)); + } + } else { //Not a leaf + for(int j = 0; j < 8; j++){ + //+n to adjust for the octree cells + queue.push(CH(curr_cell,j)+Vsize); + } + } + } + } + },1000); + } +} + + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh + +template void igl::knn, Eigen::Matrix, int, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned long, std::vector >, std::allocator > > > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::knn, int, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, unsigned long, std::vector >, std::allocator > > > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#ifdef WIN32 +template void igl::knn,int,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(Eigen::MatrixBase > const &,unsigned __int64,std::vector >,std::allocator > > > const &,Eigen::MatrixBase > const &,Eigen::MatrixBase > const &,Eigen::MatrixBase > const &,Eigen::PlainObjectBase > &); +template void igl::knn,Eigen::Matrix,int,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(Eigen::MatrixBase > const &,Eigen::MatrixBase > const &,unsigned __int64,std::vector >,std::allocator > > > const &,Eigen::MatrixBase > const &,Eigen::MatrixBase > const &,Eigen::MatrixBase > const &,Eigen::PlainObjectBase > &); +#endif + +#endif diff --git a/vendor/libigl/include/igl/launch_medit.h b/vendor/libigl/include/igl/launch_medit.h new file mode 100644 index 0000000000000000000000000000000000000000..8a324bb228dff4c2b54bffb9051260a34ab91f85 --- /dev/null +++ b/vendor/libigl/include/igl/launch_medit.h @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_LAUNCH_MEDIT_H +#define IGL_LAUNCH_MEDIT_H +#include "igl_inline.h" + +#include + +namespace igl +{ + // Writes the tetmesh in (V,T,F) to a temporary file, opens it with medit + // (forking with a system call) and returns + // + // + // Templates: + // DerivedV real-value: i.e. from MatrixXd + // DerivedT integer-value: i.e. from MatrixXi + // DerivedF integer-value: i.e. from MatrixXi + // Inputs: + // V double matrix of vertex positions #V by 3 + // T #T list of tet indices into vertex positions + // F #F list of face indices into vertex positions + // wait whether to wait for medit process to finish before returning + // Returns returned value of system call (probably not useful if wait=false + // because of the fork) + template + IGL_INLINE int launch_medit( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & T, + const Eigen::PlainObjectBase & F, + const bool wait); +} + +#ifndef IGL_STATIC_LIBRARY +# include "launch_medit.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/lbs_matrix.cpp b/vendor/libigl/include/igl/lbs_matrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a80f74be0d0e23d5902079d9083a0a9018adda8b --- /dev/null +++ b/vendor/libigl/include/igl/lbs_matrix.cpp @@ -0,0 +1,184 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "lbs_matrix.h" + +IGL_INLINE void igl::lbs_matrix( + const Eigen::MatrixXd & V, + const Eigen::MatrixXd & W, + Eigen::MatrixXd & M) +{ + using namespace Eigen; + // Number of dimensions + const int dim = V.cols(); + // Number of model points + const int n = V.rows(); + // Number of skinning transformations/weights + const int m = W.cols(); + + // Assumes that first n rows of weights correspond to V + assert(W.rows() >= n); + + M.resize(n,(dim+1)*m); + for(int j = 0;j& M) +{ + // number of mesh vertices + int n = V.rows(); + assert(n == W.rows()); + // dimension of mesh + int dim = V.cols(); + // number of handles + int m = W.cols(); + + M.resize(n*dim,m*dim*(dim+1)); + + // loop over coordinates of mesh vertices + for(int x = 0; x < dim; x++) + { + // loop over mesh vertices + for(int j = 0; j < n; j++) + { + // loop over handles + for(int i = 0; i < m; i++) + { + // loop over cols of affine transformations + for(int c = 0; c < (dim+1); c++) + { + double value = W(j,i); + if(c& M) +{ + // number of mesh vertices + int n = V.rows(); + assert(n == W.rows()); + assert(n == WI.rows()); + // dimension of mesh + int dim = V.cols(); + // number of handles + int m = WI.maxCoeff()+1; + // max number of influencing handles + int k = W.cols(); + assert(k == WI.cols()); + + M.resize(n*dim,m*dim*(dim+1)); + + // loop over coordinates of mesh vertices + for(int x = 0; x < dim; x++) + { + // loop over mesh vertices + for(int j = 0; j < n; j++) + { + // loop over handles + for(int i = 0; i < k; i++) + { + // loop over cols of affine transformations + for(int c = 0; c < (dim+1); c++) + { + double value = W(j,i); + if(c sM; + lbs_matrix_column(V,W,WI,sM); + M = MatrixXd(sM); +} diff --git a/vendor/libigl/include/igl/lexicographic_triangulation.h b/vendor/libigl/include/igl/lexicographic_triangulation.h new file mode 100644 index 0000000000000000000000000000000000000000..635f35e533e13031acdc80337a5b1f22dac844a4 --- /dev/null +++ b/vendor/libigl/include/igl/lexicographic_triangulation.h @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// Qingan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_LEXICOGRAPHIC_TRIANGULATION_H +#define IGL_LEXICOGRAPHIC_TRIANGULATION_H +#include "igl_inline.h" +#include + +namespace igl +{ + // Given a set of points in 2D, return a lexicographic triangulation of these + // points. + // + // Inputs: + // P #P by 2 list of vertex positions + // orient2D A functor such that orient2D(pa, pb, pc) returns + // 1 if pa,pb,pc forms a conterclockwise triangle. + // -1 if pa,pb,pc forms a clockwise triangle. + // 0 if pa,pb,pc are collinear. + // where the argument pa,pb,pc are of type Scalar[2]. + // + // Outputs: + // F #F by 3 of faces in lexicographic triangulation. + template< + typename DerivedP, + typename Orient2D, + typename DerivedF + > + IGL_INLINE void lexicographic_triangulation( + const Eigen::MatrixBase& P, + Orient2D orient2D, + Eigen::PlainObjectBase& F); +} + + + + +#ifndef IGL_STATIC_LIBRARY +# include "lexicographic_triangulation.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/line_segment_in_rectangle.h b/vendor/libigl/include/igl/line_segment_in_rectangle.h new file mode 100644 index 0000000000000000000000000000000000000000..6d7eaf4044023926f26c33cc7441c73c98e3c999 --- /dev/null +++ b/vendor/libigl/include/igl/line_segment_in_rectangle.h @@ -0,0 +1,33 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_LINE_SEGMENT_IN_RECTANGLE_H +#define IGL_LINE_SEGMENT_IN_RECTANGLE_H +#include "igl_inline.h" +#include +namespace igl +{ + // Determine whether a line segment overlaps with a rectangle. + // + // Inputs: + // s source point of line segment + // d dest point of line segment + // A first corner of rectangle + // B opposite corner of rectangle + // Returns true if line segment is at all inside rectangle + IGL_INLINE bool line_segment_in_rectangle( + const Eigen::Vector2d & s, + const Eigen::Vector2d & d, + const Eigen::Vector2d & A, + const Eigen::Vector2d & B); +} + +#ifndef IGL_STATIC_LIBRARY +# include "line_segment_in_rectangle.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/look_at.h b/vendor/libigl/include/igl/look_at.h new file mode 100644 index 0000000000000000000000000000000000000000..883cbf94e9612609ad4627e868db856be8ca7e70 --- /dev/null +++ b/vendor/libigl/include/igl/look_at.h @@ -0,0 +1,42 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_LOOK_AT_H +#define IGL_LOOK_AT_H +#include "igl_inline.h" + +#include + +namespace igl +{ + // Implementation of the deprecated gluLookAt function. + // + // Inputs: + // eye 3-vector of eye position + // center 3-vector of center reference point + // up 3-vector of up vector + // Outputs: + // R 4x4 rotation matrix + // + template < + typename Derivedeye, + typename Derivedcenter, + typename Derivedup, + typename DerivedR > + IGL_INLINE void look_at( + const Eigen::PlainObjectBase & eye, + const Eigen::PlainObjectBase & center, + const Eigen::PlainObjectBase & up, + Eigen::PlainObjectBase & R); +} + +#ifndef IGL_STATIC_LIBRARY +# include "look_at.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/loop.h b/vendor/libigl/include/igl/loop.h new file mode 100644 index 0000000000000000000000000000000000000000..8e70a40b1038fb51c6066ea8c09f377b2b44202a --- /dev/null +++ b/vendor/libigl/include/igl/loop.h @@ -0,0 +1,63 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Oded Stein +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_LOOP_H +#define IGL_LOOP_H + +#include +#include +#include + +namespace igl +{ + // LOOP Given the triangle mesh [V, F], where n_verts = V.rows(), computes + // newV and a sparse matrix S s.t. [newV, newF] is the subdivided mesh where + // newV = S*V. + // + // Inputs: + // n_verts an integer (number of mesh vertices) + // F an m by 3 matrix of integers of triangle faces + // Outputs: + // S a sparse matrix (will become the subdivision matrix) + // newF a matrix containing the new faces + template < + typename DerivedF, + typename SType, + typename DerivedNF> + IGL_INLINE void loop( + const int n_verts, + const Eigen::MatrixBase & F, + Eigen::SparseMatrix& S, + Eigen::PlainObjectBase & NF); + // LOOP Given the triangle mesh [V, F], computes number_of_subdivs steps of loop subdivision and outputs the new mesh [newV, newF] + // + // Inputs: + // V an n by 3 matrix of vertices + // F an m by 3 matrix of integers of triangle faces + // number_of_subdivs an integer that specifies how many subdivision steps to do + // Outputs: + // NV a matrix containing the new vertices + // NF a matrix containing the new faces + template < + typename DerivedV, + typename DerivedF, + typename DerivedNV, + typename DerivedNF> + IGL_INLINE void loop( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + Eigen::PlainObjectBase& NV, + Eigen::PlainObjectBase& NF, + const int number_of_subdivs = 1); +} + +#ifndef IGL_STATIC_LIBRARY +# include "loop.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/lscm.cpp b/vendor/libigl/include/igl/lscm.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d97cad8a235848249fb480adcf1cf118b4be465d --- /dev/null +++ b/vendor/libigl/include/igl/lscm.cpp @@ -0,0 +1,84 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "lscm.h" + +#include "vector_area_matrix.h" +#include "cotmatrix.h" +#include "repdiag.h" +#include "min_quad_with_fixed.h" +#include + +IGL_INLINE bool igl::lscm( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::VectorXi& b, + const Eigen::MatrixXd& bc, + Eigen::MatrixXd & V_uv, + Eigen::SparseMatrix & Q) +{ + using namespace Eigen; + using namespace std; + + // Assemble the area matrix (note that A is #Vx2 by #Vx2) + SparseMatrix A; + igl::vector_area_matrix(F,A); + + // Assemble the cotan laplacian matrix + SparseMatrix L; + igl::cotmatrix(V,F,L); + + SparseMatrix L_flat; + repdiag(L,2,L_flat); + + VectorXi b_flat(b.size()*bc.cols(),1); + VectorXd bc_flat(bc.size(),1); + for(int c = 0;c data; + if(!igl::min_quad_with_fixed_precompute(Q,b_flat,SparseMatrix(),true,data)) + { + return false; + } + + MatrixXd W_flat; + if(!min_quad_with_fixed_solve(data,B_flat,bc_flat,VectorXd(),W_flat)) + { + return false; + } + + + assert(W_flat.rows() == V.rows()*2); + V_uv.resize(V.rows(),2); + for (unsigned i=0;i Q; + return lscm(V, F, b, bc, V_uv, Q); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/marching_cubes.h b/vendor/libigl/include/igl/marching_cubes.h new file mode 100644 index 0000000000000000000000000000000000000000..e56d3bb87775b872cdb7d8ccef1dd4d32fca57eb --- /dev/null +++ b/vendor/libigl/include/igl/marching_cubes.h @@ -0,0 +1,65 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MARCHING_CUBES_H +#define IGL_MARCHING_CUBES_H +#include "igl_inline.h" + +#include +namespace igl +{ + // marching_cubes( values, points, x_res, y_res, z_res, isovalue, vertices, faces ) + // + // performs marching cubes reconstruction on a grid defined by values, and + // points, and generates a mesh defined by vertices and faces + // + // Input: + // S nx*ny*nz list of values at each grid corner + // i.e. S(x + y*xres + z*xres*yres) for corner (x,y,z) + // GV nx*ny*nz by 3 array of corresponding grid corner vertex locations + // nx resolutions of the grid in x dimension + // ny resolutions of the grid in y dimension + // nz resolutions of the grid in z dimension + // isovalue the isovalue of the surface to reconstruct + // Output: + // V #V by 3 list of mesh vertex positions + // F #F by 3 list of mesh triangle indices into rows of V + // + template < + typename DerivedS, + typename DerivedGV, + typename DerivedV, + typename DerivedF> + IGL_INLINE void marching_cubes( + const Eigen::MatrixBase & S, + const Eigen::MatrixBase & GV, + const unsigned nx, + const unsigned ny, + const unsigned nz, + const typename DerivedS::Scalar isovalue, + Eigen::PlainObjectBase &V, + Eigen::PlainObjectBase &F); + template < + typename DerivedS, + typename DerivedGV, + typename DerivedGI, + typename DerivedV, + typename DerivedF> + IGL_INLINE void marching_cubes( + const Eigen::MatrixBase & S, + const Eigen::MatrixBase & GV, + const Eigen::MatrixBase & GI, + const typename DerivedS::Scalar isovalue, + Eigen::PlainObjectBase &V, + Eigen::PlainObjectBase &F); +} + +#ifndef IGL_STATIC_LIBRARY +# include "marching_cubes.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/marching_tets.cpp b/vendor/libigl/include/igl/marching_tets.cpp new file mode 100644 index 0000000000000000000000000000000000000000..08b22711bd6aa9f41c4979d0a14d2a3fd9ab06b8 --- /dev/null +++ b/vendor/libigl/include/igl/marching_tets.cpp @@ -0,0 +1,195 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Francis Williams +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "marching_tets.h" + +#include +#include +#include +#include +#include + +template +void igl::marching_tets( + const Eigen::MatrixBase& TV, + const Eigen::MatrixBase& TT, + const Eigen::MatrixBase& isovals, + double isovalue, + Eigen::PlainObjectBase& outV, + Eigen::PlainObjectBase& outF, + Eigen::PlainObjectBase& J, + Eigen::SparseMatrix& BC) +{ + using namespace std; + + // We're hashing edges to deduplicate using 64 bit ints. The upper and lower + // 32 bits of a key are the indices of vertices in the mesh. The implication is + // that you can only have 2^32 vertices which I have deemed sufficient for + // anything reasonable. + const auto make_edge_key = [](const pair& p) -> int64_t + { + std::int64_t ret = 0; + ret |= p.first; + ret |= static_cast(p.second) << 32; + return ret; + }; + + const int mt_cell_lookup[16][4] = + { + { -1, -1, -1, -1 }, + { 0, 2, 1, -1 }, + { 0, 3, 4, -1 }, + { 2, 1, 3, 4 }, + { 5, 3, 1, -1 }, + { 0, 2, 5, 3 }, + { 0, 1, 5, 4 }, + { 2, 5, 4, -1 }, + { 4, 5, 2, -1 }, + { 0, 4, 5, 1 }, + { 0, 3, 5, 2 }, + { 1, 3, 5, -1 }, + { 4, 3, 1, 2 }, + { 0, 4, 3, -1 }, + { 0, 1, 2, -1 }, + { -1, -1, -1, -1 }, + }; + + const int mt_edge_lookup[6][2] = + { + {0, 1}, + {0, 2}, + {0, 3}, + {1, 2}, + {1, 3}, + {2, 3}, + }; + + // Store the faces and the tet they are in + vector> faces; + + // Store the edges in the tet mesh which we add vertices on + // so we can deduplicate + vector> edge_table; + + + assert(TT.cols() == 4 && TT.rows() >= 1); + assert(TV.cols() == 3 && TV.rows() >= 4); + assert(isovals.cols() == 1); + + // For each tet + for (int i = 0; i < TT.rows(); i++) + { + uint8_t key = 0; + for (int v = 0; v < 4; v++) + { + const int vid = TT(i, v); + const uint8_t flag = isovals(vid, 0) > isovalue; + key |= flag << v; + } + + // This will contain the index in TV of each vertex in the tet + int v_ids[4] = {-1, -1, -1, -1}; + + // Insert any vertices if the tet intersects the level surface + for (int e = 0; e < 4 && mt_cell_lookup[key][e] != -1; e++) + { + const int tv1_idx = TT(i, mt_edge_lookup[mt_cell_lookup[key][e]][0]); + const int tv2_idx = TT(i, mt_edge_lookup[mt_cell_lookup[key][e]][1]); + const int vertex_id = edge_table.size(); + edge_table.push_back(make_pair(min(tv1_idx, tv2_idx), max(tv1_idx, tv2_idx))); + v_ids[e] = vertex_id; + } + + // Insert the corresponding faces + if (v_ids[0] != -1) + { + bool is_quad = mt_cell_lookup[key][3] != -1; + if (is_quad) + { + const Eigen::RowVector3i f1(v_ids[0], v_ids[1], v_ids[3]); + const Eigen::RowVector3i f2(v_ids[1], v_ids[2], v_ids[3]); + faces.push_back(make_pair(f1, i)); + faces.push_back(make_pair(f2, i)); + } + else + { + const Eigen::RowVector3i f(v_ids[0], v_ids[1], v_ids[2]); + faces.push_back(make_pair(f, i)); + } + + } + } + + int num_unique = 0; + outV.resize(edge_table.size(), 3); + outF.resize(faces.size(), 3); + J.resize(faces.size()); + + // Sparse matrix triplets for BC + vector> bc_triplets; + bc_triplets.reserve(edge_table.size()); + + // Deduplicate vertices + unordered_map emap; + emap.max_load_factor(0.5); + emap.reserve(edge_table.size()); + + for (int f = 0; f < faces.size(); f++) + { + const int ti = faces[f].second; + assert(ti>=0); + assert(ti edge = edge_table[vi]; + const int64_t key = make_edge_key(edge); + auto it = emap.find(key); + if (it == emap.end()) // New unique vertex, insert it + { + // Typedef to make sure we handle floats properly + typedef Eigen::Matrix RowVector; + const RowVector v1 = TV.row(edge.first); + const RowVector v2 = TV.row(edge.second); + const double a = fabs(isovals(edge.first, 0) - isovalue); + const double b = fabs(isovals(edge.second, 0) - isovalue); + const double w = a / (a+b); + + // Create a casted copy in case BCType is a float and we need to downcast + const BCType bc_w = static_cast(w); + bc_triplets.push_back(Eigen::Triplet(num_unique, edge.first, 1-bc_w)); + bc_triplets.push_back(Eigen::Triplet(num_unique, edge.second, bc_w)); + + // Create a casted copy in case DerivedTV::Scalar is a float and we need to downcast + const typename DerivedTV::Scalar v_w = static_cast(w); + outV.row(num_unique) = (1-v_w)*v1 + v_w*v2; + outF(f, v) = num_unique; + + emap.emplace(key, num_unique); + num_unique += 1; + } else { + outF(f, v) = it->second; + } + } + } + outV.conservativeResize(num_unique, 3); + BC.resize(num_unique, TV.rows()); + BC.setFromTriplets(bc_triplets.begin(), bc_triplets.end()); +} + + +#ifdef IGL_STATIC_LIBRARY +template void igl::marching_tets, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, double>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, double, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::SparseMatrix&); +#endif // IGL_STATIC_LIBRARY diff --git a/vendor/libigl/include/igl/massmatrix_intrinsic.h b/vendor/libigl/include/igl/massmatrix_intrinsic.h new file mode 100644 index 0000000000000000000000000000000000000000..cc491666da4122307e5cfd1ff7b18c8f3faf7ce0 --- /dev/null +++ b/vendor/libigl/include/igl/massmatrix_intrinsic.h @@ -0,0 +1,56 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MASSMATRIX_INTRINSIC_H +#define IGL_MASSMATRIX_INTRINSIC_H +#include "igl_inline.h" +#include "massmatrix.h" + +#include +#include + +namespace igl +{ + + // Constructs the mass (area) matrix for a given mesh (V,F). + // + // Inputs: + // l #l by simplex_size list of mesh edge lengths + // F #F by simplex_size list of mesh elements (triangles or tetrahedra) + // type one of the following ints: + // MASSMATRIX_TYPE_BARYCENTRIC barycentric + // MASSMATRIX_TYPE_VORONOI voronoi-hybrid {default} + // MASSMATRIX_TYPE_FULL full {not implemented} + // Outputs: + // M #V by #V mass matrix + // + // See also: adjacency_matrix + // + template + IGL_INLINE void massmatrix_intrinsic( + const Eigen::MatrixBase & l, + const Eigen::MatrixBase & F, + const MassMatrixType type, + Eigen::SparseMatrix& M); + // Inputs: + // n number of vertices (>= F.maxCoeff()+1) + template + IGL_INLINE void massmatrix_intrinsic( + const Eigen::MatrixBase & l, + const Eigen::MatrixBase & F, + const MassMatrixType type, + const int n, + Eigen::SparseMatrix& M); +} + +#ifndef IGL_STATIC_LIBRARY +# include "massmatrix_intrinsic.cpp" +#endif + +#endif + + diff --git a/vendor/libigl/include/igl/mat_max.h b/vendor/libigl/include/igl/mat_max.h new file mode 100644 index 0000000000000000000000000000000000000000..ad3ec6e61d3b34e5a674333774784b6b4ee182a0 --- /dev/null +++ b/vendor/libigl/include/igl/mat_max.h @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MAT_MAX_H +#define IGL_MAT_MAX_H +#include "igl_inline.h" +#include + +namespace igl +{ + // Ideally this becomes a super overloaded function supporting everything + // that matlab's max supports + + // Max function for matrices to act like matlab's max function. Specifically + // like [Y,I] = max(X,[],dim); + // + // Templates: + // T should be a eigen matrix primitive type like int or double + // Inputs: + // X m by n matrix + // dim dimension along which to take max + // Outputs: + // Y n-long vector (if dim == 1) + // or + // Y m-long vector (if dim == 2) + // I vector the same size as Y containing the indices along dim of maximum + // entries + template + IGL_INLINE void mat_max( + const Eigen::DenseBase & X, + const int dim, + Eigen::PlainObjectBase & Y, + Eigen::PlainObjectBase & I); +} + +#ifndef IGL_STATIC_LIBRARY +# include "mat_max.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/mat_min.h b/vendor/libigl/include/igl/mat_min.h new file mode 100644 index 0000000000000000000000000000000000000000..3673aeded8bba40c9b6277c929772d3847bb41d4 --- /dev/null +++ b/vendor/libigl/include/igl/mat_min.h @@ -0,0 +1,52 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MAT_MIN_H +#define IGL_MAT_MIN_H +#include "igl_inline.h" +#include + +namespace igl +{ + // Ideally this becomes a super overloaded function supporting everything + // that matlab's min supports + + // Min function for matrices to act like matlab's min function. Specifically + // like [Y,I] = min(X,[],dim); + // + // Templates: + // T should be a eigen matrix primitive type like int or double + // Inputs: + // X m by n matrix + // dim dimension along which to take min + // Outputs: + // Y n-long sparse vector (if dim == 1) + // or + // Y m-long sparse vector (if dim == 2) + // I vector the same size as Y containing the indices along dim of minimum + // entries + // + // See also: mat_max + template + IGL_INLINE void mat_min( + const Eigen::DenseBase & X, + const int dim, + Eigen::PlainObjectBase & Y, + Eigen::PlainObjectBase & I); + // Use Y = X.colwise().minCoeff() instead + //// In-line wrapper + //template + //IGL_INLINE Eigen::Matrix mat_min( + // const Eigen::Matrix & X, + // const int dim); +} + +#ifndef IGL_STATIC_LIBRARY +# include "mat_min.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/mat_to_quat.cpp b/vendor/libigl/include/igl/mat_to_quat.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5c8e04b1fa05d2cf82255fa00254d07e54e1cf50 --- /dev/null +++ b/vendor/libigl/include/igl/mat_to_quat.cpp @@ -0,0 +1,141 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mat_to_quat.h" +#include + +// This could be replaced by something fast +template +static inline Q_type ReciprocalSqrt( const Q_type x ) +{ + return 1.0/sqrt(x); +} + +//// Converts row major order matrix to quat +//// http://software.intel.com/sites/default/files/m/d/4/1/d/8/293748.pdf +//template +//IGL_INLINE void igl::mat4_to_quat(const Q_type * m, Q_type * q) +//{ +// Q_type t = + m[0 * 4 + 0] + m[1 * 4 + 1] + m[2 * 4 + 2] + 1.0f; +// Q_type s = ReciprocalSqrt( t ) * 0.5f; +// q[3] = s * t; +// q[2] = ( m[0 * 4 + 1] - m[1 * 4 + 0] ) * s; +// q[1] = ( m[2 * 4 + 0] - m[0 * 4 + 2] ) * s; +// q[0] = ( m[1 * 4 + 2] - m[2 * 4 + 1] ) * s; +//} + +// https://bmgame.googlecode.com/svn/idlib/math/Simd_AltiVec.cpp +template +IGL_INLINE void igl::mat4_to_quat(const Q_type * mat, Q_type * q) +{ + Q_type trace; + Q_type s; + Q_type t; + int i; + int j; + int k; + + static int next[3] = { 1, 2, 0 }; + + trace = mat[0 * 4 + 0] + mat[1 * 4 + 1] + mat[2 * 4 + 2]; + + if ( trace > 0.0f ) { + + t = trace + 1.0f; + s = ReciprocalSqrt( t ) * 0.5f; + + q[3] = s * t; + q[0] = ( mat[1 * 4 + 2] - mat[2 * 4 + 1] ) * s; + q[1] = ( mat[2 * 4 + 0] - mat[0 * 4 + 2] ) * s; + q[2] = ( mat[0 * 4 + 1] - mat[1 * 4 + 0] ) * s; + + } else { + + i = 0; + if ( mat[1 * 4 + 1] > mat[0 * 4 + 0] ) { + i = 1; + } + if ( mat[2 * 4 + 2] > mat[i * 4 + i] ) { + i = 2; + } + j = next[i]; + k = next[j]; + + t = ( mat[i * 4 + i] - ( mat[j * 4 + j] + mat[k * 4 + k] ) ) + 1.0f; + s = ReciprocalSqrt( t ) * 0.5f; + + q[i] = s * t; + q[3] = ( mat[j * 4 + k] - mat[k * 4 + j] ) * s; + q[j] = ( mat[i * 4 + j] + mat[j * 4 + i] ) * s; + q[k] = ( mat[i * 4 + k] + mat[k * 4 + i] ) * s; + } + + //// Unused translation + //jq.t[0] = mat[0 * 4 + 3]; + //jq.t[1] = mat[1 * 4 + 3]; + //jq.t[2] = mat[2 * 4 + 3]; +} + +template +IGL_INLINE void igl::mat3_to_quat(const Q_type * mat, Q_type * q) +{ + Q_type trace; + Q_type s; + Q_type t; + int i; + int j; + int k; + + static int next[3] = { 1, 2, 0 }; + + trace = mat[0 * 3 + 0] + mat[1 * 3 + 1] + mat[2 * 3 + 2]; + + if ( trace > 0.0f ) { + + t = trace + 1.0f; + s = ReciprocalSqrt( t ) * 0.5f; + + q[3] = s * t; + q[0] = ( mat[1 * 3 + 2] - mat[2 * 3 + 1] ) * s; + q[1] = ( mat[2 * 3 + 0] - mat[0 * 3 + 2] ) * s; + q[2] = ( mat[0 * 3 + 1] - mat[1 * 3 + 0] ) * s; + + } else { + + i = 0; + if ( mat[1 * 3 + 1] > mat[0 * 3 + 0] ) { + i = 1; + } + if ( mat[2 * 3 + 2] > mat[i * 3 + i] ) { + i = 2; + } + j = next[i]; + k = next[j]; + + t = ( mat[i * 3 + i] - ( mat[j * 3 + j] + mat[k * 3 + k] ) ) + 1.0f; + s = ReciprocalSqrt( t ) * 0.5f; + + q[i] = s * t; + q[3] = ( mat[j * 3 + k] - mat[k * 3 + j] ) * s; + q[j] = ( mat[i * 3 + j] + mat[j * 3 + i] ) * s; + q[k] = ( mat[i * 3 + k] + mat[k * 3 + i] ) * s; + } + + //// Unused translation + //jq.t[0] = mat[0 * 4 + 3]; + //jq.t[1] = mat[1 * 4 + 3]; + //jq.t[2] = mat[2 * 4 + 3]; +} + + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::mat4_to_quat(double const*, double*); +template void igl::mat4_to_quat(float const*, float*); +template void igl::mat3_to_quat(double const*, double*); +#endif diff --git a/vendor/libigl/include/igl/matlab/MatlabWorkspace.h b/vendor/libigl/include/igl/matlab/MatlabWorkspace.h new file mode 100644 index 0000000000000000000000000000000000000000..c8dcaf9ed7e8adeeda167cb21d75791a334a2b4e --- /dev/null +++ b/vendor/libigl/include/igl/matlab/MatlabWorkspace.h @@ -0,0 +1,579 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MATLAB_MATLAB_WORKSPACE_H +#define IGL_MATLAB_MATLAB_WORKSPACE_H + +#include +#include + +#include + +#include +#include + +namespace igl +{ + namespace matlab + { + // It would be really great to replicate this for a simple XML-based + // workspace. + // + // Class which contains data of a matlab workspace which can be written to a + // .mat file and loaded from matlab + // + // This depends on matlab at compile time (though it shouldn't necessarily + // have to) but it does not depend on running the matlab engine at run-time. + // + // Known bugs: Treats all matrices as doubles (this may actually be desired + // for some "index" matrices since matlab's sparse command takes doubles + // rather than int class matrices). It is of course not desired when dealing + // with logicals or uint's for images. + class MatlabWorkspace + { + private: + // KNOWN BUG: Why not use a map? Any reason to allow duplicate names? + // + // List of names + std::vector names; + // List of data pointers + std::vector data; + public: + MatlabWorkspace(); + ~MatlabWorkspace(); + // Clear names and data of variables in workspace + inline void clear(); + // Save current list of variables + // + // Inputs: + // path path to .mat file + // Returns true on success, false on failure + inline bool write(const std::string & path) const; + // Load list of variables from .mat file + // + // Inputs: + // path path to .mat file + // Returns true on success, false on failure + inline bool read(const std::string & path); + // Assign data to a variable name in the workspace + // + // Template: + // DerivedM eigen matrix (e.g. MatrixXd) + // Inputs: + // M data (usually a matrix) + // name variable name to save into work space + // Returns true on success, false on failure + // + // Known Bugs: Assumes Eigen is using column major ordering + template + inline MatlabWorkspace& save( + const Eigen::PlainObjectBase& M, + const std::string & name); + // Template: + // MT sparse matrix type (e.g. double) + template + inline MatlabWorkspace& save( + const Eigen::SparseMatrix& M, + const std::string & name); + // Templates: + // ScalarM scalar type, e.g. double + template + inline MatlabWorkspace& save( + const std::vector > & vM, + const std::string & name); + // Templates: + // ScalarV scalar type, e.g. double + template + inline MatlabWorkspace& save( + const std::vector & vV, + const std::string & name); + // NOTE: Eigen stores quaternions coefficients as (i,j,k,1), but most of + // our matlab code stores them as (1,i,j,k) This takes a quaternion and + // saves it as a (1,i,j,k) row vector + // + // Templates: + // Q quaternion type + template + inline MatlabWorkspace& save( + const Eigen::Quaternion & q, + const std::string & name); + inline MatlabWorkspace& save( + const double d, + const std::string & name); + // Same as save() but adds 1 to each element, useful for saving "index" + // matrices like lists of faces or elements + template + inline MatlabWorkspace& save_index( + const Eigen::DenseBase& M, + const std::string & name); + template + inline MatlabWorkspace& save_index( + const std::vector > & vM, + const std::string & name); + template + inline MatlabWorkspace& save_index( + const std::vector & vV, + const std::string & name); + // Find a certain matrix by name. + // + // KNOWN BUG: Outputs the first found (not necessarily unique lists). + // + // Template: + // DerivedM eigen matrix (e.g. MatrixXd) + // Inputs: + // name exact name of matrix as string + // Outputs: + // M matrix + // Returns true only if found. + template + inline bool find( + const std::string & name, + Eigen::PlainObjectBase& M); + template + inline bool find( + const std::string & name, + Eigen::SparseMatrix& M); + inline bool find( + const std::string & name, + double & d); + inline bool find( + const std::string & name, + int & v); + // Subtracts 1 from all entries + template + inline bool find_index( + const std::string & name, + Eigen::PlainObjectBase& M); + }; + } +} + +// Implementation + +// Be sure that this is not compiled into libigl.a +// http://stackoverflow.com/a/3318993/148668 + +// IGL +#include "igl/list_to_matrix.h" + +// MATLAB +#include "mat.h" + +// STL +#include +#include +#include + +inline igl::matlab::MatlabWorkspace::MatlabWorkspace(): + names(), + data() +{ +} + +inline igl::matlab::MatlabWorkspace::~MatlabWorkspace() +{ + // clean up data + clear(); +} + +inline void igl::matlab::MatlabWorkspace::clear() +{ + for_each(data.begin(),data.end(),&mxDestroyArray); + data.clear(); + names.clear(); +} + +inline bool igl::matlab::MatlabWorkspace::write(const std::string & path) const +{ + using namespace std; + MATFile * mat_file = matOpen(path.c_str(), "w"); + if(mat_file == NULL) + { + fprintf(stderr,"Error opening file %s\n",path.c_str()); + return false; + } + assert(names.size() == data.size()); + // loop over names and data + for(int i = 0;i < (int)names.size(); i++) + { + // Put variable as LOCAL variable + int status = matPutVariable(mat_file,names[i].c_str(), data[i]); + if(status != 0) + { + cerr<<"^MatlabWorkspace::save Error: matPutVariable ("< +inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save( + const Eigen::PlainObjectBase& M, + const std::string & name) +{ + using namespace std; + const int m = M.rows(); + const int n = M.cols(); + mxArray * mx_data = mxCreateDoubleMatrix(m,n,mxREAL); + data.push_back(mx_data); + names.push_back(name); + // Copy data immediately + // Use Eigen's map and cast to copy + Eigen::Map< Eigen::Matrix > + map(mxGetPr(mx_data),m,n); + map = M.template cast(); + return *this; +} + +// Treat everything as a double +template +inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save( + const Eigen::SparseMatrix& M, + const std::string & name) +{ + using namespace std; + const int m = M.rows(); + const int n = M.cols(); + // THIS WILL NOT WORK FOR ROW-MAJOR + assert(n==M.outerSize()); + const int nzmax = M.nonZeros(); + mxArray * mx_data = mxCreateSparse(m, n, nzmax, mxREAL); + data.push_back(mx_data); + names.push_back(name); + // Copy data immediately + double * pr = mxGetPr(mx_data); + mwIndex * ir = mxGetIr(mx_data); + mwIndex * jc = mxGetJc(mx_data); + + // Iterate over outside + int k = 0; + for(int j=0; j::InnerIterator it (M,j); it; ++it) + { + pr[k] = it.value(); + ir[k] = it.row(); + k++; + } + } + jc[M.outerSize()] = k; + + return *this; +} + +template +inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save( + const std::vector > & vM, + const std::string & name) +{ + Eigen::MatrixXd M; + list_to_matrix(vM,M); + return this->save(M,name); +} + +template +inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save( + const std::vector & vV, + const std::string & name) +{ + Eigen::MatrixXd V; + list_to_matrix(vV,V); + return this->save(V,name); +} + +template +inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save( + const Eigen::Quaternion & q, + const std::string & name) +{ + Eigen::Matrix qm; + qm(0,0) = q.w(); + qm(0,1) = q.x(); + qm(0,2) = q.y(); + qm(0,3) = q.z(); + return save(qm,name); +} + +inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save( + const double d, + const std::string & name) +{ + Eigen::VectorXd v(1); + v(0) = d; + return save(v,name); +} + +template +inline igl::matlab::MatlabWorkspace& + igl::matlab::MatlabWorkspace::save_index( + const Eigen::DenseBase& M, + const std::string & name) +{ + DerivedM Mp1 = M; + Mp1.array() += 1; + return this->save(Mp1,name); +} + +template +inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save_index( + const std::vector > & vM, + const std::string & name) +{ + Eigen::MatrixXd M; + list_to_matrix(vM,M); + return this->save_index(M,name); +} + +template +inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save_index( + const std::vector & vV, + const std::string & name) +{ + Eigen::MatrixXd V; + list_to_matrix(vV,V); + return this->save_index(V,name); +} + +template +inline bool igl::matlab::MatlabWorkspace::find( + const std::string & name, + Eigen::PlainObjectBase& M) +{ + using namespace std; + const int i = std::find(names.begin(), names.end(), name)-names.begin(); + if(i>=(int)names.size()) + { + return false; + } + assert(i<=(int)data.size()); + mxArray * mx_data = data[i]; + assert(!mxIsSparse(mx_data)); + assert(mxGetNumberOfDimensions(mx_data) == 2); + //cout< > + (mxGetPr(mx_data),M.rows(),M.cols()).cast(); + return true; +} + +template +inline bool igl::matlab::MatlabWorkspace::find( + const std::string & name, + Eigen::SparseMatrix& M) +{ + using namespace std; + using namespace Eigen; + const int i = std::find(names.begin(), names.end(), name)-names.begin(); + if(i>=(int)names.size()) + { + return false; + } + assert(i<=(int)data.size()); + mxArray * mx_data = data[i]; + // Handle boring case where matrix is actually an empty dense matrix + if(mxGetNumberOfElements(mx_data) == 0) + { + M.resize(0,0); + return true; + } + assert(mxIsSparse(mx_data)); + assert(mxGetNumberOfDimensions(mx_data) == 2); + //cout< > MIJV; + const int nnz = mxGetNzmax(mx_data); + MIJV.reserve(nnz); + // Iterate over outside + int k = 0; + for(int j=0; j(ir[k],j,pr[k])); + k++; + } + } + M.resize(m,n); + M.setFromTriplets(MIJV.begin(),MIJV.end()); + + return true; +} + +inline bool igl::matlab::MatlabWorkspace::find( + const std::string & name, + int & v) +{ + using namespace std; + const int i = std::find(names.begin(), names.end(), name)-names.begin(); + if(i>=(int)names.size()) + { + return false; + } + assert(i<=(int)data.size()); + mxArray * mx_data = data[i]; + assert(!mxIsSparse(mx_data)); + assert(mxGetNumberOfDimensions(mx_data) == 2); + //cout<=(int)names.size()) + { + return false; + } + assert(i<=(int)data.size()); + mxArray * mx_data = data[i]; + assert(!mxIsSparse(mx_data)); + assert(mxGetNumberOfDimensions(mx_data) == 2); + //cout< +inline bool igl::matlab::MatlabWorkspace::find_index( + const std::string & name, + Eigen::PlainObjectBase& M) +{ + if(!find(name,M)) + { + return false; + } + M.array() -= 1; + return true; +} + + +//template +//bool igl::matlab::MatlabWorkspace::save(const Data & M, const std::string & name) +//{ +// using namespace std; +// // If I don't know the type then I can't save it +// cerr<<"^MatlabWorkspace::save Error: Unknown data type. "<< +// name<<" not saved."< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MATLAB_MEX_STREAM_H +#define IGL_MATLAB_MEX_STREAM_H +#include +namespace igl +{ + namespace matlab + { + // http://stackoverflow.com/a/249008/148668 + + // Class to implement "cout" for mex files to print to the matlab terminal + // window. + // + // Insert at the beginning of mexFunction(): + // MexStream mout; + // std::streambuf *outbuf = std::cout.rdbuf(&mout); + // ... + // ALWAYS restore original buffer to avoid memory leak problems in matlab + // std::cout.rdbuf(outbuf); + // + class MexStream : public std::streambuf + { + public: + protected: + inline virtual std::streamsize xsputn(const char *s, std::streamsize n); + inline virtual int overflow(int c = EOF); + }; + } +} + +// Implementation +#include +inline std::streamsize igl::matlab::MexStream::xsputn( + const char *s, + std::streamsize n) +{ + mexPrintf("%.*s",n,s); + mexEvalString("drawnow;"); // to dump string. + return n; +} + +inline int igl::matlab::MexStream::overflow(int c) +{ + if (c != EOF) { + mexPrintf("%.1s",&c); + mexEvalString("drawnow;"); // to dump string. + } + return 1; +} +#endif diff --git a/vendor/libigl/include/igl/matlab/matlabinterface.cpp b/vendor/libigl/include/igl/matlab/matlabinterface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6c03485de987977658d1c76bbfd435ddac6bd82a --- /dev/null +++ b/vendor/libigl/include/igl/matlab/matlabinterface.cpp @@ -0,0 +1,330 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include + +// Implementation + +// Init the MATLAB engine +// (no need to call it directly since it is automatically invoked by any other command) +IGL_INLINE void igl::matlab::mlinit(Engine** mlengine) +{ + *mlengine = engOpen("\0"); +} + +// Closes the MATLAB engine +IGL_INLINE void igl::matlab::mlclose(Engine** mlengine) +{ + engClose(*mlengine); + *mlengine = 0; +} + +// Send a matrix to MATLAB +IGL_INLINE void igl::matlab::mlsetmatrix(Engine** mlengine, std::string name, const Eigen::MatrixXd& M) +{ + if (*mlengine == 0) + mlinit(mlengine); + + mxArray *A = mxCreateDoubleMatrix(M.rows(), M.cols(), mxREAL); + double *pM = mxGetPr(A); + + int c = 0; + for(int j=0; j& M) +{ + if (*mlengine == 0) + mlinit(mlengine); + + mxArray *A = mxCreateDoubleMatrix(M.rows(), M.cols(), mxREAL); + double *pM = mxGetPr(A); + + int c = 0; + for(int j=0; j t; + + mxArray *ary = engGetVariable(*mlengine, name.c_str()); + if (ary == NULL) + { + m = 0; + n = 0; + M = Eigen::MatrixXd(0,0); + } + else + { + m = mxGetM(ary); + n = mxGetN(ary); + M = Eigen::MatrixXd(m,n); + + double *pM = mxGetPr(ary); + + int c = 0; + for(int j=0; j t; + + mxArray *ary = engGetVariable(*mlengine, name.c_str()); + if (ary == NULL) + { + m = 0; + n = 0; + M = Eigen::MatrixXf(0,0); + } + else + { + m = mxGetM(ary); + n = mxGetN(ary); + M = Eigen::MatrixXf(m,n); + + double *pM = mxGetPr(ary); + + int c = 0; + for(int j=0; j t; + + mxArray *ary = engGetVariable(*mlengine, name.c_str()); + if (ary == NULL) + { + m = 0; + n = 0; + M = Eigen::MatrixXi(0,0); + } + else + { + m = mxGetM(ary); + n = mxGetN(ary); + M = Eigen::MatrixXi(m,n); + + double *pM = mxGetPr(ary); + + int c = 0; + for(int j=0; j& M) +{ + if (*mlengine == 0) + mlinit(mlengine); + + unsigned long m = 0; + unsigned long n = 0; + std::vector t; + + mxArray *ary = engGetVariable(*mlengine, name.c_str()); + if (ary == NULL) + { + m = 0; + n = 0; + M = Eigen::Matrix(0,0); + } + else + { + m = mxGetM(ary); + n = mxGetN(ary); + M = Eigen::Matrix(m,n); + + double *pM = mxGetPr(ary); + + int c = 0; + for(int j=0; j' && buf[1] == '>' && buf[2] == ' ') + buf += 3; + if (buf[0] == '\n') ++buf; + + return std::string(buf); +} + +// Send a sparse matrix +IGL_INLINE void igl::matlab::mlsetmatrix(Engine** mlengine, std::string name, const Eigen::SparseMatrix& M) +{ + int count = 0; +// // Count non-zero +// for (unsigned k=0; k::InnerIterator it(M,k); it; ++it) +// if (it.value() != 0) +// ++count; + + Eigen::MatrixXd T(M.nonZeros(),3); + for (unsigned k=0; k<(unsigned)M.outerSize(); ++k) + { + for (Eigen::SparseMatrix::InnerIterator it(M,k); it; ++it) + { + T(count,0) = it.row(); + T(count,1) = it.col(); + T(count,2) = it.value(); + ++count; + } + } + + T.col(0) = T.col(0).array()+1; + T.col(1) = T.col(1).array()+1; + + mlsetmatrix(mlengine,"temp93765",T); + + std::string temp = name + " = sparse(temp93765(:,1),temp93765(:,2),temp93765(:,3)," + + std::to_string(M.rows()) + "," + + std::to_string(M.cols()) + ");"; + + mleval(mlengine,temp); + mleval(mlengine,"clear temp93765"); +} diff --git a/vendor/libigl/include/igl/matlab/matlabinterface.h b/vendor/libigl/include/igl/matlab/matlabinterface.h new file mode 100644 index 0000000000000000000000000000000000000000..63d72c74e2ab4f6f76793fb15a19b98e44ecc382 --- /dev/null +++ b/vendor/libigl/include/igl/matlab/matlabinterface.h @@ -0,0 +1,90 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MATLAB_MATLAB_INTERFACE_H +#define IGL_MATLAB_MATLAB_INTERFACE_H +#include "../igl_inline.h" +// WARNING: These functions require matlab installed +// Additional header folder required: +// /Applications/MATLAB_R2011a.app/extern/include +// Additional binary lib to be linked with: +// /Applications/MATLAB_R2011a.app/bin/maci64/libeng.dylib +// /Applications/MATLAB_R2011a.app/bin/maci64/libmx.dylib + +// MAC ONLY: +// Add to the environment variables: +// DYLD_LIBRARY_PATH = /Applications/MATLAB_R2011a.app/bin/maci64/ +// PATH = /opt/local/bin:/opt/local/sbin:/Applications/MATLAB_R2011a.app/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include // Matlab engine header + +namespace igl +{ + namespace matlab + { + // Init the MATLAB engine + // (no need to call it directly since it is automatically invoked by any other command) + IGL_INLINE void mlinit(Engine** engine); + + // Closes the MATLAB engine + IGL_INLINE void mlclose(Engine** engine); + + // Send a matrix to MATLAB + IGL_INLINE void mlsetmatrix(Engine** engine, std::string name, const Eigen::MatrixXd& M); + + // Send a matrix to MATLAB + IGL_INLINE void mlsetmatrix(Engine** engine, std::string name, const Eigen::MatrixXf& M); + + // Send a matrix to MATLAB + IGL_INLINE void mlsetmatrix(Engine** engine, std::string name, const Eigen::MatrixXi& M); + + // Send a matrix to MATLAB + IGL_INLINE void mlsetmatrix(Engine** mlengine, std::string name, const Eigen::Matrix& M); + + // Receive a matrix from MATLAB + IGL_INLINE void mlgetmatrix(Engine** engine, std::string name, Eigen::MatrixXd& M); + + // Receive a matrix from MATLAB + IGL_INLINE void mlgetmatrix(Engine** engine, std::string name, Eigen::MatrixXf& M); + + // Receive a matrix from MATLAB + IGL_INLINE void mlgetmatrix(Engine** engine, std::string name, Eigen::MatrixXi& M); + + // Receive a matrix from MATLAB + IGL_INLINE void mlgetmatrix(Engine** mlengine, std::string name, Eigen::Matrix& M); + + // Send a single scalar to MATLAB + IGL_INLINE void mlsetscalar(Engine** engine, std::string name, double s); + + // Receive a single scalar from MATLAB + IGL_INLINE double mlgetscalar(Engine** engine, std::string name); + + // Execute arbitrary MATLAB code and return the MATLAB output + IGL_INLINE std::string mleval(Engine** engine, std::string code); + + // Send a sparse matrix to MATLAB + IGL_INLINE void mlsetmatrix(Engine** mlengine, std::string name, const Eigen::SparseMatrix& M); + + } +} + +// Be sure that this is not compiled into libigl.a +#ifndef IGL_STATIC_LIBRARY +# include "matlabinterface.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/matlab/mexErrMsgTxt.cpp b/vendor/libigl/include/igl/matlab/mexErrMsgTxt.cpp new file mode 100644 index 0000000000000000000000000000000000000000..89dda1fa379bb0321c494be893cb0ad18297d8eb --- /dev/null +++ b/vendor/libigl/include/igl/matlab/mexErrMsgTxt.cpp @@ -0,0 +1,17 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mexErrMsgTxt.h" + +IGL_INLINE void igl::matlab::mexErrMsgTxt(bool assertion, const char * text) +{ + if(!assertion) + { + ::mexErrMsgTxt(text); + } +} + diff --git a/vendor/libigl/include/igl/matlab/mexErrMsgTxt.h b/vendor/libigl/include/igl/matlab/mexErrMsgTxt.h new file mode 100644 index 0000000000000000000000000000000000000000..61b838e6e86d4b6e27f12af481d1d68e146ac4e2 --- /dev/null +++ b/vendor/libigl/include/igl/matlab/mexErrMsgTxt.h @@ -0,0 +1,25 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MATLAB_MEXERRMSGTXT_H +#define IGL_MATLAB_MEXERRMSGTXT_H +#include "../igl_inline.h" +// Overload mexErrMsgTxt to check an assertion then print text only if +// assertion fails +#include "mex.h" +namespace igl +{ + namespace matlab + { + // Wrapper for mexErrMsgTxt that only calls error if test fails + IGL_INLINE void mexErrMsgTxt(bool test, const char * message); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "mexErrMsgTxt.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/matlab/parse_rhs.cpp b/vendor/libigl/include/igl/matlab/parse_rhs.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ac8d6b377062bebd44d12c4a9d0b148859ac5459 --- /dev/null +++ b/vendor/libigl/include/igl/matlab/parse_rhs.cpp @@ -0,0 +1,85 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "parse_rhs.h" +#include + +template +IGL_INLINE void igl::matlab::parse_rhs_double( + const mxArray *prhs[], + Eigen::PlainObjectBase & V) +{ + using namespace Eigen; + // Use Eigen's map and cast to copy + V = Map< Matrix > + (mxGetPr(prhs[0]),mxGetM(prhs[0]),mxGetN(prhs[0])) + .cast(); +} + +template +IGL_INLINE void igl::matlab::parse_rhs_index( + const mxArray *prhs[], + Eigen::PlainObjectBase & V) +{ + parse_rhs_double(prhs,V); + V.array() -= 1; +} + +template +IGL_INLINE void igl::matlab::parse_rhs( + const mxArray *prhs[], + Eigen::SparseMatrix & M) +{ + using namespace Eigen; + using namespace std; + const mxArray * mx_data = prhs[0]; + // Handle boring case where matrix is actually an empty dense matrix + if(mxGetNumberOfElements(mx_data) == 0) + { + M.resize(0,0); + return; + } + assert(mxIsSparse(mx_data)); + assert(mxGetNumberOfDimensions(mx_data) == 2); + //cout< > MIJV; + MIJV.reserve(mxGetNumberOfElements(mx_data)); + // Iterate over outside + int k = 0; + for(int j=0; j(ir[k],j,pr[k])); + k++; + } + } + M.resize(m,n); + M.setFromTriplets(MIJV.begin(),MIJV.end()); +} + +#ifdef IGL_STATIC_LIBRARY +template void igl::matlab::parse_rhs_index >(mxArray_tag const**, Eigen::PlainObjectBase >&); +template void igl::matlab::parse_rhs_index >(mxArray_tag const**, Eigen::PlainObjectBase >&); +template void igl::matlab::parse_rhs_double >(mxArray_tag const**, Eigen::PlainObjectBase >&); +template void igl::matlab::parse_rhs_index >(mxArray_tag const**, Eigen::PlainObjectBase >&); +template void igl::matlab::parse_rhs_double >(mxArray_tag const**, Eigen::PlainObjectBase >&); +template void igl::matlab::parse_rhs_double >(mxArray_tag const**, Eigen::PlainObjectBase >&); +template void igl::matlab::parse_rhs_double >(mxArray_tag const**, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/matlab/parse_rhs.h b/vendor/libigl/include/igl/matlab/parse_rhs.h new file mode 100644 index 0000000000000000000000000000000000000000..3cabec73491c67032279856a1b4aefca654e933b --- /dev/null +++ b/vendor/libigl/include/igl/matlab/parse_rhs.h @@ -0,0 +1,42 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MATLAB_PARSE_RHS_H +#define IGL_MATLAB_PARSE_RHS_H +#include +#include +#include +#include +namespace igl +{ + namespace matlab + { + // Reads in a matrix as a double + // + // Inputs: + // prhs points to rhs argument + // Outputs: + // V M by N matrix + template + IGL_INLINE void parse_rhs_double( + const mxArray *prhs[], + Eigen::PlainObjectBase & V); + // Reads in a matrix and subtracts 1 + template + IGL_INLINE void parse_rhs_index( + const mxArray *prhs[], + Eigen::PlainObjectBase & V); + template + IGL_INLINE void parse_rhs( + const mxArray *prhs[], + Eigen::SparseMatrix & M); + } +}; +#ifndef IGL_STATIC_LIBRARY +# include "parse_rhs.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/matlab/prepare_lhs.cpp b/vendor/libigl/include/igl/matlab/prepare_lhs.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d01697be770d4b703a6b2cf8992f8ca7e58c1814 --- /dev/null +++ b/vendor/libigl/include/igl/matlab/prepare_lhs.cpp @@ -0,0 +1,126 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "prepare_lhs.h" +#include +template +IGL_INLINE void igl::matlab::prepare_lhs_double( + const Eigen::PlainObjectBase & V, + mxArray *plhs[]) +{ + using namespace std; + using namespace Eigen; + const auto m = V.rows(); + const auto n = V.cols(); + plhs[0] = mxCreateDoubleMatrix(m,n, mxREAL); + Eigen::Map< Eigen::Matrix > + map(mxGetPr(plhs[0]),m,n); + map = V.template cast(); +} + +template +IGL_INLINE void igl::matlab::prepare_lhs_logical( + const Eigen::PlainObjectBase & V, + mxArray *plhs[]) +{ + using namespace std; + using namespace Eigen; + const auto m = V.rows(); + const auto n = V.cols(); + plhs[0] = mxCreateLogicalMatrix(m,n); + mxLogical * Vp = static_cast(mxGetData(plhs[0])); + Eigen::Map< Eigen::Matrix > + map(static_cast(mxGetData(plhs[0])),m,n); + map = V.template cast(); +} + +template +IGL_INLINE void igl::matlab::prepare_lhs_index( + const Eigen::PlainObjectBase & V, + mxArray *plhs[]) +{ + // Treat indices as reals + const auto Vd = (V.template cast().array()+1).eval(); + return prepare_lhs_double(Vd,plhs); +} + +template +IGL_INLINE void igl::matlab::prepare_lhs_double( + const Eigen::SparseMatrix & M, + mxArray *plhs[]) +{ + using namespace std; + const auto m = M.rows(); + const auto n = M.cols(); + // THIS WILL NOT WORK FOR ROW-MAJOR + assert(n==M.outerSize()); + const int nzmax = M.nonZeros(); + plhs[0] = mxCreateSparse(m, n, nzmax, mxREAL); + mxArray * mx_data = plhs[0]; + // Copy data immediately + double * pr = mxGetPr(mx_data); + mwIndex * ir = mxGetIr(mx_data); + mwIndex * jc = mxGetJc(mx_data); + + // Iterate over outside + int k = 0; + for(int j=0; j::InnerIterator it (M,j); it; ++it) + { + // copy (cast to double) + pr[k] = it.value(); + ir[k] = it.row(); + k++; + } + } + jc[M.outerSize()] = k; + +} + + +template +IGL_INLINE void igl::matlab::prepare_lhs_double( + const std::vector & V, + mxArray *plhs[]) +{ + plhs[0] = mxCreateCellMatrix(V.size(), 1); + for(int i=0; i > + map(mxGetPr(ai),m,n); + map = V[i].template cast(); + mxSetCell(plhs[0],i,ai); + } +} + + + +#ifdef IGL_STATIC_LIBRARY +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_index >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_index >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_index >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_logical >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_logical >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_index >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(Eigen::PlainObjectBase > const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double(Eigen::SparseMatrix const&, mxArray_tag**); +template void igl::matlab::prepare_lhs_double >(std::vector, std::allocator > > const&, mxArray_tag**); +#endif diff --git a/vendor/libigl/include/igl/matlab/prepare_lhs.h b/vendor/libigl/include/igl/matlab/prepare_lhs.h new file mode 100644 index 0000000000000000000000000000000000000000..e3596db1f5339f280f48fba09d416e4defee0aa1 --- /dev/null +++ b/vendor/libigl/include/igl/matlab/prepare_lhs.h @@ -0,0 +1,54 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MATLAB_PREPARE_LHS_H +#define IGL_MATLAB_PREPARE_LHS_H +#include +#include +#include +#include +namespace igl +{ + namespace matlab + { + // Writes out a matrix as a double + // + // Inputs: + // prhs points to rhs argument + // Outputs: + // V M by N matrix + template + IGL_INLINE void prepare_lhs_double( + const Eigen::PlainObjectBase & V, + mxArray *plhs[]); + // Casts to logical + template + IGL_INLINE void prepare_lhs_logical( + const Eigen::PlainObjectBase & V, + mxArray *plhs[]); + // Writes out a matrix and adds 1 + template + IGL_INLINE void prepare_lhs_index( + const Eigen::PlainObjectBase & V, + mxArray *plhs[]); + // SparseMatrix + template + IGL_INLINE void prepare_lhs_double( + const Eigen::SparseMatrix & V, + mxArray *plhs[]); + // Vector of matrices -> cell array of matrices + template + IGL_INLINE void prepare_lhs_double( + const std::vector & V, + mxArray *plhs[]); + }; +} +#ifndef IGL_STATIC_LIBRARY +# include "prepare_lhs.cpp" +#endif +#endif + diff --git a/vendor/libigl/include/igl/matlab/requires_arg.cpp b/vendor/libigl/include/igl/matlab/requires_arg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a0346918362c0de389b5b6cacb210d50f81f0330 --- /dev/null +++ b/vendor/libigl/include/igl/matlab/requires_arg.cpp @@ -0,0 +1,16 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "requires_arg.h" +#include "mexErrMsgTxt.h" +#include "../C_STR.h" + +IGL_INLINE void igl::matlab::requires_arg(const int i, const int nrhs, const char *name) +{ + mexErrMsgTxt((i+1) +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_REQUIRES_ARG_H +#define IGL_REQUIRES_ARG_H +#include "../igl_inline.h" +#include +namespace igl +{ + namespace matlab + { + // Simply throw an error if (i+1) +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "validate_arg.h" +#include "requires_arg.h" +#include "mexErrMsgTxt.h" +#include "../C_STR.h" + +IGL_INLINE void igl::matlab::validate_arg_scalar( + const int i, const int nrhs, const mxArray * prhs[], const char * name) +{ + requires_arg(i,nrhs,name); + mexErrMsgTxt(mxGetN(prhs[i+1])==1 && mxGetM(prhs[i+1])==1, + C_STR("Parameter '"< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_VALIDATE_ARG_H +#define IGL_VALIDATE_ARG_H +#include "../igl_inline.h" +#include +namespace igl +{ + namespace matlab + { + // Throw an error if arg i+1 is not a scalar + // + // Inputs: + // i index of current argument + // nrhs total number of arguments + // prhs pointer to arguments array + // name name of current argument + IGL_INLINE void validate_arg_scalar( + const int i, const int nrhs, const mxArray * prhs[], const char * name); + IGL_INLINE void validate_arg_logical( + const int i, const int nrhs, const mxArray * prhs[], const char * name); + IGL_INLINE void validate_arg_char( + const int i, const int nrhs, const mxArray * prhs[], const char * name); + IGL_INLINE void validate_arg_double( + const int i, const int nrhs, const mxArray * prhs[], const char * name); + IGL_INLINE void validate_arg_function_handle( + const int i, const int nrhs, const mxArray * prhs[], const char * name); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "validate_arg.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/matlab_format.h b/vendor/libigl/include/igl/matlab_format.h new file mode 100644 index 0000000000000000000000000000000000000000..c5c6a26904c4f2c6434a859b29b8509ef73c0ded --- /dev/null +++ b/vendor/libigl/include/igl/matlab_format.h @@ -0,0 +1,93 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MATLAB_FORMAT_H +#define IGL_MATLAB_FORMAT_H + +#include "igl_inline.h" + +#include +#include +#include + +namespace igl +{ + // This is a routine to print a matrix using format suitable for pasting into + // the matlab IDE + // + // Templates: + // DerivedM e.g. derived from MatrixXd + // Input: + // input some matrix to be formatted + // name name of matrix + // Returns Formatted matrix + // + // Example: + // // M := [1 2 3;4 5 6]; + // cout< + IGL_INLINE const Eigen::WithFormat< DerivedM > matlab_format( + const Eigen::DenseBase & M, + const std::string name = ""); + template + IGL_INLINE std::string matlab_format_index( + const Eigen::MatrixBase & M, + const std::string name = ""); + // Same but for sparse matrices. Print IJV format into an auxiliary variable + // and then print a call to sparse which will construct the sparse matrix + // Example: + // // S := [0 2 3;4 5 0]; + // cout< + IGL_INLINE const std::string matlab_format( + const Eigen::SparseMatrix & S, + const std::string name = ""); + IGL_INLINE const std::string matlab_format( + const double v, + const std::string name = ""); + IGL_INLINE const std::string matlab_format( + const float v, + const std::string name = ""); + // Return just IOFormat + // + // Example: + // // M := [1 2 3;4 5 6]; + // cout< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MATRIX_TO_LIST_H +#define IGL_MATRIX_TO_LIST_H +#include "igl_inline.h" +#include +#include + +namespace igl +{ + // Convert a matrix to a list (std::vector) of row vectors of the same size + // + // Template: + // Mat Matrix type, must implement: + // .resize(m,n) + // .row(i) = Row + // T type that can be safely cast to type in Mat via '=' + // Inputs: + // M an m by n matrix + // Outputs: + // V a m-long list of vectors of size n + // + // See also: list_to_matrix + template + IGL_INLINE void matrix_to_list( + const Eigen::MatrixBase & M, + std::vector > & V); + // Convert a matrix to a list (std::vector) of elements in column-major + // ordering. + // + // Inputs: + // M an m by n matrix + // Outputs: + // V an m*n list of elements + template + IGL_INLINE void matrix_to_list( + const Eigen::MatrixBase & M, + std::vector & V); + // Return wrapper + template + IGL_INLINE std::vector matrix_to_list( + const Eigen::MatrixBase & M); +} + +#ifndef IGL_STATIC_LIBRARY +# include "matrix_to_list.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/max.h b/vendor/libigl/include/igl/max.h new file mode 100644 index 0000000000000000000000000000000000000000..554a19b13277c6aefee40231a3443434d6592d5e --- /dev/null +++ b/vendor/libigl/include/igl/max.h @@ -0,0 +1,27 @@ +#ifndef IGL_MAX_H +#define IGL_MAX_H +#include "igl_inline.h" +#include +#include +namespace igl +{ + // Inputs: + // X m by n matrix + // dim dimension along which to take max + // Outputs: + // Y n-long vector (if dim == 1) + // or + // Y m-long vector (if dim == 2) + // I vector the same size as Y containing the indices along dim of maximum + // entries + template + IGL_INLINE void max( + const Eigen::SparseMatrix & A, + const int dim, + Eigen::PlainObjectBase & B, + Eigen::PlainObjectBase & I); +} +#ifndef IGL_STATIC_LIBRARY +# include "max.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/min_heap.h b/vendor/libigl/include/igl/min_heap.h new file mode 100644 index 0000000000000000000000000000000000000000..b5503ca292abcbc0d30cfcabcf9f408234f2862f --- /dev/null +++ b/vendor/libigl/include/igl/min_heap.h @@ -0,0 +1,20 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MIN_HEAP_H +#define IGL_MIN_HEAP_H +#include +#include +#include +namespace igl +{ + // Templated min heap (reverses sort order of std::priority_queue) + template using min_heap = + std::priority_queue< T, std::vector, std::greater >; +} +#endif + diff --git a/vendor/libigl/include/igl/mosek/bbw.cpp b/vendor/libigl/include/igl/mosek/bbw.cpp new file mode 100644 index 0000000000000000000000000000000000000000..99d28ab1524111131d53df53f73bc0cdc38362c1 --- /dev/null +++ b/vendor/libigl/include/igl/mosek/bbw.cpp @@ -0,0 +1,88 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "bbw.h" +#include "mosek_quadprog.h" +#include "../harmonic.h" +#include "../slice_into.h" +#include +#include +#include + + +template < + typename DerivedV, + typename DerivedEle, + typename Derivedb, + typename Derivedbc, + typename DerivedW> +IGL_INLINE bool igl::mosek::bbw( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & Ele, + const Eigen::PlainObjectBase & b, + const Eigen::PlainObjectBase & bc, + igl::BBWData & data, + igl::mosek::MosekData & mosek_data, + Eigen::PlainObjectBase & W + ) +{ + using namespace std; + using namespace Eigen; + assert(!data.partition_unity && "partition_unity not implemented yet"); + // number of domain vertices + int n = V.rows(); + // number of handles + int m = bc.cols(); + // Build biharmonic operator + Eigen::SparseMatrix Q; + harmonic(V,Ele,2,Q); + W.derived().resize(n,m); + // No linear terms + VectorXd c = VectorXd::Zero(n); + // No linear constraints + SparseMatrix A(0,n); + VectorXd uc(0,1),lc(0,1); + // Upper and lower box constraints (Constant bounds) + VectorXd ux = VectorXd::Ones(n); + VectorXd lx = VectorXd::Zero(n); + // Loop over handles + for(int i = 0;i= 1) + { + cout<<"BBW: Computing weight for handle "<, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, igl::BBWData&, igl::mosek::MosekData&, Eigen::PlainObjectBase >&); +#endif + diff --git a/vendor/libigl/include/igl/mosek/bbw.h b/vendor/libigl/include/igl/mosek/bbw.h new file mode 100644 index 0000000000000000000000000000000000000000..5dcae0fedcee04eebd91c6da8d2bf023edbfe01d --- /dev/null +++ b/vendor/libigl/include/igl/mosek/bbw.h @@ -0,0 +1,60 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MOSEK_BBW_H +#define IGL_MOSEK_BBW_H +#include "../igl_inline.h" +#include "mosek_quadprog.h" +#include "../bbw.h" +#include + +namespace igl +{ + namespace mosek + { + // Compute Bounded Biharmonic Weights on a given domain (V,Ele) with a given + // set of boundary conditions + // + // Templates + // DerivedV derived type of eigen matrix for V (e.g. MatrixXd) + // DerivedF derived type of eigen matrix for F (e.g. MatrixXi) + // Derivedb derived type of eigen matrix for b (e.g. VectorXi) + // Derivedbc derived type of eigen matrix for bc (e.g. MatrixXd) + // DerivedW derived type of eigen matrix for W (e.g. MatrixXd) + // Inputs: + // V #V by dim vertex positions + // Ele #Elements by simplex-size list of element indices + // b #b boundary indices into V + // bc #b by #W list of boundary values + // data object containing options, initial guess --> solution and results + // mosek_data object containing mosek options + // Outputs: + // W #V by #W list of *unnormalized* weights to normalize use + // igl::normalize_row_sums(W,W); + // Returns true on success, false on failure + template < + typename DerivedV, + typename DerivedEle, + typename Derivedb, + typename Derivedbc, + typename DerivedW> + IGL_INLINE bool bbw( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & Ele, + const Eigen::PlainObjectBase & b, + const Eigen::PlainObjectBase & bc, + igl::BBWData & data, + igl::mosek::MosekData & mosek_data, + Eigen::PlainObjectBase & W); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "bbw.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/mosek/mosek_guarded.cpp b/vendor/libigl/include/igl/mosek/mosek_guarded.cpp new file mode 100644 index 0000000000000000000000000000000000000000..242d928f6fe1a83597ea12ee82258e6e5f79f5d2 --- /dev/null +++ b/vendor/libigl/include/igl/mosek/mosek_guarded.cpp @@ -0,0 +1,24 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mosek_guarded.h" +#include + +IGL_INLINE MSKrescodee igl::mosek::mosek_guarded(const MSKrescodee r) +{ + using namespace std; + if(r != MSK_RES_OK) + { + /* In case of an error print error code and description. */ + char symname[MSK_MAX_STR_LEN]; + char desc[MSK_MAX_STR_LEN]; + MSK_getcodedesc(r,symname,desc); + cerr<<"MOSEK ERROR ("< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MOSEK_MOSEK_GUARDED_H +#define IGL_MOSEK_MOSEK_GUARDED_H +#include "../igl_inline.h" + +#include +namespace igl +{ + namespace mosek + { + // Little function to wrap around mosek call to handle errors + // + // Inputs: + // r mosek error code returned from mosek call + // Returns r untouched + IGL_INLINE MSKrescodee mosek_guarded(const MSKrescodee r); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "mosek_guarded.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/mosek/mosek_linprog.cpp b/vendor/libigl/include/igl/mosek/mosek_linprog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..38ea88141c84b5cb0507b8ac4aa8e4a212c43192 --- /dev/null +++ b/vendor/libigl/include/igl/mosek/mosek_linprog.cpp @@ -0,0 +1,168 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mosek_linprog.h" +#include "../mosek/mosek_guarded.h" +#include "../harwell_boeing.h" +#include +#include +#include + +IGL_INLINE bool igl::mosek::mosek_linprog( + const Eigen::VectorXd & c, + const Eigen::SparseMatrix & A, + const Eigen::VectorXd & lc, + const Eigen::VectorXd & uc, + const Eigen::VectorXd & lx, + const Eigen::VectorXd & ux, + Eigen::VectorXd & x) +{ + // variables for mosek task, env and result code + MSKenv_t env; + // Create the MOSEK environment + mosek_guarded(MSK_makeenv(&env,NULL)); + // initialize mosek environment +#if MSK_VERSION_MAJOR <= 7 + mosek_guarded(MSK_initenv(env)); +#endif + const bool ret = mosek_linprog(c,A,lc,uc,lx,ux,env,x); + MSK_deleteenv(&env); + return ret; +} + +IGL_INLINE bool igl::mosek::mosek_linprog( + const Eigen::VectorXd & c, + const Eigen::SparseMatrix & A, + const Eigen::VectorXd & lc, + const Eigen::VectorXd & uc, + const Eigen::VectorXd & lx, + const Eigen::VectorXd & ux, + const MSKenv_t & env, + Eigen::VectorXd & x) +{ + // following http://docs.mosek.com/7.1/capi/Linear_optimization.html + using namespace std; + // number of constraints + const int m = A.rows(); + // number of variables + const int n = A.cols(); + + + vector vAv; + vector vAri,vAcp; + int nr; + harwell_boeing(A,nr,vAv,vAri,vAcp); + + MSKtask_t task; + // Create the optimization task + mosek_guarded(MSK_maketask(env,m,n,&task)); + // no threads + mosek_guarded(MSK_putintparam(task,MSK_IPAR_NUM_THREADS,1)); + if(m>0) + { + // Append 'm' empty constraints, the constrainst will initially have no + // bounds + mosek_guarded(MSK_appendcons(task,m)); + } + mosek_guarded(MSK_appendvars(task,n)); + + + const auto & key = [](const double lxj, const double uxj) -> + MSKboundkeye + { + MSKboundkeye k = MSK_BK_FR; + if(isfinite(lxj) && isfinite(uxj)) + { + if(lxj == uxj) + { + k = MSK_BK_FX; + }else{ + k = MSK_BK_RA; + } + }else if(isfinite(lxj)) + { + k = MSK_BK_LO; + }else if(isfinite(uxj)) + { + k = MSK_BK_UP; + } + return k; + }; + + // loop over variables + for(int j = 0;j 0) + { + // Set linear term c_j in the objective + mosek_guarded(MSK_putcj(task,j,c(j))); + } + + // Set constant bounds on variable j + const double lxj = lx.size()>0?lx[j]:-numeric_limits::infinity(); + const double uxj = ux.size()>0?ux[j]: numeric_limits::infinity(); + mosek_guarded(MSK_putvarbound(task,j,key(lxj,uxj),lxj,uxj)); + + if(m>0) + { + // Input column j of A + mosek_guarded( + MSK_putacol( + task, + j, + vAcp[j+1]-vAcp[j], + &vAri[vAcp[j]], + &vAv[vAcp[j]]) + ); + } + } + // loop over constraints + for(int i = 0;i0?lc[i]:-numeric_limits::infinity(); + const double uci = uc.size()>0?uc[i]: numeric_limits::infinity(); + mosek_guarded(MSK_putconbound(task,i,key(lci,uci),lci,uci)); + } + + // Now the optimizer has been prepared + MSKrescodee trmcode; + // run the optimizer + mosek_guarded(MSK_optimizetrm(task,&trmcode)); + // Get status + MSKsolstae solsta; + MSK_getsolsta (task,MSK_SOL_ITR,&solsta); + bool success = false; + switch(solsta) + { + case MSK_SOL_STA_OPTIMAL: +#if MSK_VERSION_MAJOR <= 8 + case MSK_SOL_STA_NEAR_OPTIMAL: +#endif + x.resize(n); + /* Request the basic solution. */ + MSK_getxx(task,MSK_SOL_BAS,x.data()); + success = true; + break; + case MSK_SOL_STA_DUAL_INFEAS_CER: + case MSK_SOL_STA_PRIM_INFEAS_CER: +#if MSK_VERSION_MAJOR <= 8 + case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER: + case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER: +#endif + //printf("Primal or dual infeasibility certificate found.\n"); + break; + case MSK_SOL_STA_UNKNOWN: + //printf("The status of the solution could not be determined.\n"); + break; + default: + //printf("Other solution status."); + break; + } + MSK_deletetask(&task); + return success; +} diff --git a/vendor/libigl/include/igl/mosek/mosek_linprog.h b/vendor/libigl/include/igl/mosek/mosek_linprog.h new file mode 100644 index 0000000000000000000000000000000000000000..57791cd609828c248432522aabbb046c8db3957c --- /dev/null +++ b/vendor/libigl/include/igl/mosek/mosek_linprog.h @@ -0,0 +1,59 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MOSEK_MOSEK_LINPROG_H +#define IGL_MOSEK_MOSEK_LINPROG_H +#include "../igl_inline.h" +#include +#include +#include +namespace igl +{ + namespace mosek + { + // Solve a linear program using mosek: + // + // min c'x + // s.t. lc <= A x <= uc + // lx <= x <= ux + // + // Inputs: + // c #x list of linear objective coefficients + // A #A by #x matrix of linear inequality constraint coefficients + // lc #A list of lower constraint bounds + // uc #A list of upper constraint bounds + // lx #x list of lower variable bounds + // ux #x list of upper variable bounds + // Outputs: + // x #x list of solution values + // Returns true iff success. + IGL_INLINE bool mosek_linprog( + const Eigen::VectorXd & c, + const Eigen::SparseMatrix & A, + const Eigen::VectorXd & lc, + const Eigen::VectorXd & uc, + const Eigen::VectorXd & lx, + const Eigen::VectorXd & ux, + Eigen::VectorXd & x); + // Wrapper that keeps mosek environment alive (if licence checking is + // becoming a bottleneck) + IGL_INLINE bool mosek_linprog( + const Eigen::VectorXd & c, + const Eigen::SparseMatrix & A, + const Eigen::VectorXd & lc, + const Eigen::VectorXd & uc, + const Eigen::VectorXd & lx, + const Eigen::VectorXd & ux, + const MSKenv_t & env, + Eigen::VectorXd & x); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "mosek_linprog.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/mosek/mosek_quadprog.cpp b/vendor/libigl/include/igl/mosek/mosek_quadprog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..382c29284cee3c1c3cbab508971666d2d0b65cfd --- /dev/null +++ b/vendor/libigl/include/igl/mosek/mosek_quadprog.cpp @@ -0,0 +1,344 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mosek_quadprog.h" +#include "mosek_guarded.h" +#include +#include "../find.h" +#include "../verbose.h" +#include "../speye.h" +#include "../matrix_to_list.h" +#include "../list_to_matrix.h" +#include "../harwell_boeing.h" +#include "../EPS.h" + + +igl::mosek::MosekData::MosekData() +{ + // These are the default settings that worked well for BBW. Your miles may + // very well be kilometers. + + // >1e0 NONSOLUTION + // 1e-1 artifacts in deformation + // 1e-3 artifacts in isolines + // 1e-4 seems safe + // 1e-8 MOSEK DEFAULT SOLUTION + douparam[MSK_DPAR_INTPNT_TOL_REL_GAP]=1e-8; +#if MSK_VERSION_MAJOR >= 8 + douparam[MSK_DPAR_INTPNT_QO_TOL_REL_GAP]=1e-12; +#endif + // Force using multiple threads, not sure if MOSEK is properly destroying + //extra threads... +#if MSK_VERSION_MAJOR >= 7 + intparam[MSK_IPAR_NUM_THREADS] = 6; +#elif MSK_VERSION_MAJOR == 6 + intparam[MSK_IPAR_INTPNT_NUM_THREADS] = 6; +#endif +#if MSK_VERSION_MAJOR == 6 + // Force turn off data check + intparam[MSK_IPAR_DATA_CHECK]=MSK_OFF; +#endif + // Turn off presolving + // intparam[MSK_IPAR_PRESOLVE_USE] = MSK_PRESOLVE_MODE_OFF; + // Force particular matrix reordering method + // MSK_ORDER_METHOD_NONE cuts time in half roughly, since half the time is + // usually spent reordering the matrix + // !! WARNING Setting this parameter to anything but MSK_ORDER_METHOD_FREE + // seems to have the effect of setting it to MSK_ORDER_METHOD_NONE + // *Or maybe Mosek is spending a bunch of time analyzing the matrix to + // choose the right ordering method when really any of them are + // instantaneous + intparam[MSK_IPAR_INTPNT_ORDER_METHOD] = MSK_ORDER_METHOD_NONE; + // 1.0 means optimizer is very lenient about declaring model infeasible + douparam[MSK_DPAR_INTPNT_TOL_INFEAS] = 1e-8; + // Hard to say if this is doing anything, probably nothing dramatic + douparam[MSK_DPAR_INTPNT_TOL_PSAFE]= 1e2; + // Turn off convexity check + intparam[MSK_IPAR_CHECK_CONVEXITY] = MSK_CHECK_CONVEXITY_NONE; +} + +template +IGL_INLINE bool igl::mosek::mosek_quadprog( + const Index n, + std::vector & Qi, + std::vector & Qj, + std::vector & Qv, + const std::vector & c, + const Scalar cf, + const Index m, + std::vector & Av, + std::vector & Ari, + const std::vector & Acp, + const std::vector & lc, + const std::vector & uc, + const std::vector & lx, + const std::vector & ux, + MosekData & mosek_data, + std::vector & x) +{ + // I J V vectors of Q should all be same length + assert(Qv.size() == Qi.size()); + assert(Qv.size() == Qj.size()); + // number of columns in linear constraint matrix must be ≤ number of + // variables + assert( (int)Acp.size() == (n+1)); + // linear bound vectors must be size of number of constraints or empty + assert( ((int)lc.size() == m) || ((int)lc.size() == 0)); + assert( ((int)uc.size() == m) || ((int)uc.size() == 0)); + // constant bound vectors must be size of number of variables or empty + assert( ((int)lx.size() == n) || ((int)lx.size() == 0)); + assert( ((int)ux.size() == n) || ((int)ux.size() == 0)); + + // allocate space for solution in x + x.resize(n); + + // variables for mosek task, env and result code + MSKenv_t env; + MSKtask_t task; + + // Create the MOSEK environment +#if MSK_VERSION_MAJOR >= 7 + mosek_guarded(MSK_makeenv(&env,NULL)); +#elif MSK_VERSION_MAJOR == 6 + mosek_guarded(MSK_makeenv(&env,NULL,NULL,NULL,NULL)); +#endif + ///* Directs the log stream to the 'printstr' function. */ + //// Little function mosek needs in order to know how to print to std out + //const auto & printstr = [](void *handle, char str[]) + //{ + // printf("%s",str); + //} + //mosek_guarded(MSK_linkfunctoenvstream(env,MSK_STREAM_LOG,NULL,printstr)); + // initialize mosek environment +#if MSK_VERSION_MAJOR <= 7 + mosek_guarded(MSK_initenv(env)); +#endif + // Create the optimization task + mosek_guarded(MSK_maketask(env,m,n,&task)); + verbose("Creating task with %ld linear constraints and %ld variables...\n",m,n); + //// Tell mosek how to print to std out + //mosek_guarded(MSK_linkfunctotaskstream(task,MSK_STREAM_LOG,NULL,printstr)); + // Give estimate of number of variables + mosek_guarded(MSK_putmaxnumvar(task,n)); + if(m>0) + { + // Give estimate of number of constraints + mosek_guarded(MSK_putmaxnumcon(task,m)); + // Give estimate of number of non zeros in A + mosek_guarded(MSK_putmaxnumanz(task,Av.size())); + } + // Give estimate of number of non zeros in Q + mosek_guarded(MSK_putmaxnumqnz(task,Qv.size())); + if(m>0) + { + // Append 'm' empty constraints, the constrainst will initially have no + // bounds +#if MSK_VERSION_MAJOR >= 7 + mosek_guarded(MSK_appendcons(task,m)); +#elif MSK_VERSION_MAJOR == 6 + mosek_guarded(MSK_append(task,MSK_ACC_CON,m)); +#endif + } + // Append 'n' variables +#if MSK_VERSION_MAJOR >= 7 + mosek_guarded(MSK_appendvars(task,n)); +#elif MSK_VERSION_MAJOR == 6 + mosek_guarded(MSK_append(task,MSK_ACC_VAR,n)); +#endif + // add a contant term to the objective + mosek_guarded(MSK_putcfix(task,cf)); + + // loop over variables + for(int j = 0;j 0) + { + // Set linear term c_j in the objective + mosek_guarded(MSK_putcj(task,j,c[j])); + } + + // Set constant bounds on variable j + if(lx[j] == ux[j]) + { +#if MSK_VERSION_MAJOR <=8 + mosek_guarded(MSK_putbound(task,MSK_ACC_VAR,j,MSK_BK_FX,lx[j],ux[j])); +#else + mosek_guarded(MSK_putvarbound(task,j,MSK_BK_FX,lx[j],ux[j])); +#endif + }else + { +#if MSK_VERSION_MAJOR <=8 + mosek_guarded(MSK_putbound(task,MSK_ACC_VAR,j,MSK_BK_RA,lx[j],ux[j])); +#else + mosek_guarded(MSK_putvarbound(task,j,MSK_BK_RA,lx[j],ux[j])); +#endif + } + + if(m>0) + { + // Input column j of A +#if MSK_VERSION_MAJOR >= 7 + mosek_guarded( MSK_putacol( task, j, Acp[j+1]-Acp[j], &Ari[Acp[j]], &Av[Acp[j]])); +#elif MSK_VERSION_MAJOR == 6 + mosek_guarded( MSK_putavec( task, MSK_ACC_VAR, j, Acp[j+1]-Acp[j], &Ari[Acp[j]], &Av[Acp[j]])); +#endif + } + } + + // loop over constraints + for(int i = 0;i::iterator pit = mosek_data.intparam.begin(); + pit != mosek_data.intparam.end(); + pit++) + { + mosek_guarded(MSK_putintparam(task,pit->first,pit->second)); + } + for( + std::map::iterator pit = mosek_data.douparam.begin(); + pit != mosek_data.douparam.end(); + pit++) + { + mosek_guarded(MSK_putdouparam(task,pit->first,pit->second)); + } + + // Now the optimizer has been prepared + MSKrescodee trmcode; + // run the optimizer + mosek_guarded(MSK_optimizetrm(task,&trmcode)); + + //// Print a summary containing information about the solution for debugging + //// purposes + //MSK_solutionsummary(task,MSK_STREAM_LOG); + + // Get status of solution + MSKsolstae solsta; +#if MSK_VERSION_MAJOR >= 7 + MSK_getsolsta (task,MSK_SOL_ITR,&solsta); +#elif MSK_VERSION_MAJOR == 6 + MSK_getsolutionstatus(task,MSK_SOL_ITR,NULL,&solsta); +#endif + + bool success = false; + switch(solsta) + { + case MSK_SOL_STA_OPTIMAL: +#if MSK_VERSION_MAJOR <= 8 + case MSK_SOL_STA_NEAR_OPTIMAL: +#endif + MSK_getsolutionslice(task,MSK_SOL_ITR,MSK_SOL_ITEM_XX,0,n,&x[0]); + //printf("Optimal primal solution\n"); + //for(size_t j=0; j & Q, + const Eigen::VectorXd & c, + const double cf, + const Eigen::SparseMatrix & A, + const Eigen::VectorXd & lc, + const Eigen::VectorXd & uc, + const Eigen::VectorXd & lx, + const Eigen::VectorXd & ux, + MosekData & mosek_data, + Eigen::VectorXd & x) +{ + using namespace Eigen; + using namespace std; + + typedef int Index; + typedef double Scalar; + // Q should be square + assert(Q.rows() == Q.cols()); + // Q should be symmetric +#ifdef EIGEN_HAS_A_BUG_AND_FAILS_TO_LET_ME_COMPUTE_Q_MINUS_Q_TRANSPOSE + assert( (Q-Q.transpose()).sum() < FLOAT_EPS); +#endif + // Only keep lower triangular part of Q + SparseMatrix QL; + //QL = Q.template triangularView(); + QL = Q.triangularView(); + VectorXi Qi,Qj; + VectorXd Qv; + find(QL,Qi,Qj,Qv); + vector vQi = matrix_to_list(Qi); + vector vQj = matrix_to_list(Qj); + vector vQv = matrix_to_list(Qv); + + // Convert linear term + vector vc = matrix_to_list(c); + + assert(lc.size() == A.rows()); + assert(uc.size() == A.rows()); + // Convert A to harwell boeing format + vector vAv; + vector vAr,vAc; + Index nr; + harwell_boeing(A,nr,vAv,vAr,vAc); + + assert(lx.size() == Q.rows()); + assert(ux.size() == Q.rows()); + vector vlc = matrix_to_list(lc); + vector vuc = matrix_to_list(uc); + vector vlx = matrix_to_list(lx); + vector vux = matrix_to_list(ux); + + vector vx; + bool ret = mosek_quadprog( + Q.rows(),vQi,vQj,vQv, + vc, + cf, + nr, + vAv, vAr, vAc, + vlc,vuc, + vlx,vux, + mosek_data, + vx); + list_to_matrix(vx,x); + return ret; +} +#ifdef IGL_STATIC_LIBRARY +// Explicit template declarations +#endif diff --git a/vendor/libigl/include/igl/mosek/mosek_quadprog.h b/vendor/libigl/include/igl/mosek/mosek_quadprog.h new file mode 100644 index 0000000000000000000000000000000000000000..38343318ac732ebdb8149fbb4ceda324158a7a56 --- /dev/null +++ b/vendor/libigl/include/igl/mosek/mosek_quadprog.h @@ -0,0 +1,145 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_MOSEK_MOSEK_QUADPROG_H +#define IGL_MOSEK_MOSEK_QUADPROG_H +#include "../igl_inline.h" +#include +#include +#include + + +#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET +#include +#include + +namespace igl +{ + namespace mosek + { + struct MosekData + { + // Integer parameters + std::map intparam; + // Double parameters + std::map douparam; + // Default values + IGL_INLINE MosekData(); + }; + // Solve a convex quadratic optimization problem with linear and constant + // bounds, that is: + // + // Minimize: ½ * xT * Q⁰ * x + cT * x + cf + // + // Subject to: lc ≤ Ax ≤ uc + // lx ≤ x ≤ ux + // + // where we are trying to find the optimal vector of values x. + // + // Note: Q⁰ must be symmetric and the ½ is a convention of MOSEK + // + // Note: Because of how MOSEK accepts different parts of the system, Q + // should be stored in IJV (aka Coordinate) format and should only include + // entries in the lower triangle. A should be stored in Column compressed + // (aka Harwell Boeing) format. As described: + // http://netlib.org/linalg/html_templates/node92.html + // or + // http://en.wikipedia.org/wiki/Sparse_matrix + // #Compressed_sparse_column_.28CSC_or_CCS.29 + // + // + // Templates: + // Index type for index variables + // Scalar type for floating point variables (gets cast to double?) + // Input: + // n number of variables, i.e. size of x + // Qi vector of qnnz row indices of non-zeros in LOWER TRIANGLE ONLY of + // Q⁰ + // Qj vector of qnnz column indices of non-zeros in LOWER TRIANGLE ONLY + // of Q⁰ + // Qv vector of qnnz values of non-zeros in LOWER TRIANGLE ONLY of Q⁰, + // such that: + // + // Q⁰(Qi[k],Qj[k]) = Qv[k] for k ∈ [0,Qnnz-1], where Qnnz is the + // + // number of non-zeros in Q⁰ + // c (optional) vector of n values of c, transpose of coefficient row + // vector of linear terms, EMPTY means c == 0 + // cf (ignored) value of constant term in objective, 0 means cf == 0, so + // optional only in the sense that it is mandatory + // m number of constraints, therefore also number of rows in linear + // constraint coefficient matrix A, and in linear constraint bound + // vectors lc and uc + // Av vector of non-zero values of A, in column compressed order + // Ari vector of row indices corresponding to non-zero values of A, + // Acp vector of indices into Ari and Av of the first entry for each + // column of A, size(Acp) = (# columns of A) + 1 = n + 1 + // lc vector of m linear constraint lower bounds + // uc vector of m linear constraint upper bounds + // lx vector of n constant lower bounds + // ux vector of n constant upper bounds + // Output: + // x vector of size n to hold output of optimization + // Return: + // true only if optimization was successful with no errors + // + // Note: All indices are 0-based + // + template + IGL_INLINE bool mosek_quadprog( + const Index n, + /* mosek won't allow this to be const*/ std::vector & Qi, + /* mosek won't allow this to be const*/ std::vector & Qj, + /* mosek won't allow this to be const*/ std::vector & Qv, + const std::vector & c, + const Scalar cf, + const Index m, + /* mosek won't allow this to be const*/ std::vector & Av, + /* mosek won't allow this to be const*/ std::vector & Ari, + const std::vector & Acp, + const std::vector & lc, + const std::vector & uc, + const std::vector & lx, + const std::vector & ux, + MosekData & mosek_data, + std::vector & x); + // Wrapper with Eigen elements + // + // Inputs: + // Q n by n square quadratic coefficients matrix **only lower triangle + // is used**. + // c n-long vector of linear coefficients + // cf constant coefficient + // A m by n square linear coefficienst matrix of inequality constraints + // lc m-long vector of lower bounds for linear inequality constraints + // uc m-long vector of upper bounds for linear inequality constraints + // lx n-long vector of lower bounds + // ux n-long vector of upper bounds + // mosek_data parameters struct + // Outputs: + // x n-long solution vector + // Returns true only if optimization finishes without error + // + IGL_INLINE bool mosek_quadprog( + const Eigen::SparseMatrix & Q, + const Eigen::VectorXd & c, + const double cf, + const Eigen::SparseMatrix & A, + const Eigen::VectorXd & lc, + const Eigen::VectorXd & uc, + const Eigen::VectorXd & lx, + const Eigen::VectorXd & ux, + MosekData & mosek_data, + Eigen::VectorXd & x); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "mosek_quadprog.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/mvc.cpp b/vendor/libigl/include/igl/mvc.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a6fed49d8cbf1a301f84188cfda50205a3c45bf0 --- /dev/null +++ b/vendor/libigl/include/igl/mvc.cpp @@ -0,0 +1,196 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "mvc.h" +#include +#include +#include + +// Broken Implementation +IGL_INLINE void igl::mvc(const Eigen::MatrixXd &V, const Eigen::MatrixXd &C, Eigen::MatrixXd &W) +{ + + // at least three control points + assert(C.rows()>2); + + // dimension of points + assert(C.cols() == 3 || C.cols() == 2); + assert(V.cols() == 3 || V.cols() == 2); + + // number of polygon points + int num = C.rows(); + + Eigen::MatrixXd V1,C1; + int i_prev, i_next; + + // check if either are 3D but really all z's are 0 + bool V_flat = (V.cols() == 3) && (std::sqrt( (V.col(3)).dot(V.col(3)) ) < 1e-10); + bool C_flat = (C.cols() == 3) && (std::sqrt( (C.col(3)).dot(C.col(3)) ) < 1e-10); + + // if both are essentially 2D then ignore z-coords + if((C.cols() == 2 || C_flat) && (V.cols() == 2 || V_flat)) + { + // ignore z coordinate + V1 = V.block(0,0,V.rows(),2); + C1 = C.block(0,0,C.rows(),2); + } + else + { + // give dummy z coordinate to either mesh or poly + if(V.rows() == 2) + { + V1 = Eigen::MatrixXd(V.rows(),3); + V1.block(0,0,V.rows(),2) = V; + } + else + V1 = V; + + if(C.rows() == 2) + { + C1 = Eigen::MatrixXd(C.rows(),3); + C1.block(0,0,C.rows(),2) = C; + } + else + C1 = C; + + // check that C is planar + // average normal around poly corners + + Eigen::Vector3d n = Eigen::Vector3d::Zero(); + // take centroid as point on plane + Eigen::Vector3d p = Eigen::Vector3d::Zero(); + for (int i = 0; i0)?(i-1):(num-1); + i_next = (i1e-10) + std::cerr<<"Distance from V to plane of C is large..."< solver = basis.colPivHouseholderQr(); + // Throw away coordinates in normal direction + V1 = solver.solve(V1.transpose()).transpose().block(0,0,V1.rows(),2); + C1 = solver.solve(C1.transpose()).transpose().block(0,0,C1.rows(),2); + + } + + // vectors from V to every C, where CmV(i,j,:) is the vector from domain + // vertex j to handle i + double EPS = 1e-10; + Eigen::MatrixXd WW = Eigen::MatrixXd(C1.rows(), V1.rows()); + Eigen::MatrixXd dist_C_V (C1.rows(), V1.rows()); + std::vector< std::pair > on_corner(0); + std::vector< std::pair > on_segment(0); + for (int i = 0; i0)?(i-1):(num-1); + i_next = (i +#include + +IGL_INLINE double igl::nchoosek(const int n, const int k) +{ + if(k>n/2) + { + return nchoosek(n,n-k); + }else if(k==1) + { + return n; + }else + { + double c = 1; + for(int i = 1;i<=k;i++) + { + c *= (((double)n-k+i)/((double)i)); + } + return std::round(c); + } +} + +template < typename DerivedV, typename DerivedU> +IGL_INLINE void igl::nchoosek( + const Eigen::MatrixBase & V, + const int k, + Eigen::PlainObjectBase & U) +{ + using namespace Eigen; + if(V.size() == 0) + { + U.resize(0,k); + return; + } + assert((V.cols() == 1 || V.rows() == 1) && "V must be a vector"); + U.resize(nchoosek(V.size(),k),k); + int running_i = 0; + int running_j = 0; + Matrix running(1,k); + int N = V.size(); + const std::function doCombs = + [&running,&N,&doCombs,&running_i,&running_j,&U,&V](int offset, int k) + { + if(k==0) + { + U.row(running_i) = running; + running_i++; + return; + } + for (int i = offset; i <= N - k; ++i) + { + running(running_j) = V(i); + running_j++; + doCombs(i+1,k-1); + running_j--; + } + }; + doCombs(0,k); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::nchoosek, Eigen::Matrix >(Eigen::MatrixBase > const&, int, Eigen::PlainObjectBase >&); +#if EIGEN_VERSION_AT_LEAST(3,3,0) +#else +template void igl::nchoosek, Eigen::Matrix >, Eigen::Matrix >(Eigen::MatrixBase, Eigen::Matrix > > const&, int, Eigen::PlainObjectBase >&); +#endif + +#endif diff --git a/vendor/libigl/include/igl/normal_derivative.h b/vendor/libigl/include/igl/normal_derivative.h new file mode 100644 index 0000000000000000000000000000000000000000..4718d321f93adc67e6f9ac75ba357ee712c4fd84 --- /dev/null +++ b/vendor/libigl/include/igl/normal_derivative.h @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_NORMAL_DERIVATIVE_H +#define IGL_NORMAL_DERIVATIVE_H +#include "igl_inline.h" + +#include +#include +namespace igl +{ + // NORMAL_DERIVATIVE Computes the directional derivative **normal** to + // **all** (half-)edges of a triangle mesh (not just boundary edges). These + // are integrated along the edge: they're the per-face constant gradient dot + // the rotated edge vector (unit rotated edge vector for direction then + // magnitude for integration). + // + // Inputs: + // V #V by dim list of mesh vertex positions + // F #F by 3|4 list of triangle|tetrahedron indices into V + // Outputs: + // DD #F*3|4 by #V sparse matrix representing operator to compute + // directional derivative with respect to each facet of each element. + // + template < + typename DerivedV, + typename DerivedEle, + typename Scalar> + IGL_INLINE void normal_derivative( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & Ele, + Eigen::SparseMatrix& DD); +} + +#ifndef IGL_STATIC_LIBRARY +# include "normal_derivative.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/normalize_quat.h b/vendor/libigl/include/igl/normalize_quat.h new file mode 100644 index 0000000000000000000000000000000000000000..e97759b17822aa54eb2b48a278f1d32e6d671b02 --- /dev/null +++ b/vendor/libigl/include/igl/normalize_quat.h @@ -0,0 +1,32 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_NORMALIZE_QUAT_H +#define IGL_NORMALIZE_QUAT_H +#include "igl_inline.h" + +namespace igl +{ + // Normalize a quaternion + // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), + // such that q = x*i + y*j + z*k + w + // Inputs: + // q input quaternion + // Outputs: + // out result of normalization, allowed to be same as q + // Returns true on success, false if len(q) < EPS + template + IGL_INLINE bool normalize_quat( + const Q_type *q, + Q_type *out); +}; + +#ifndef IGL_STATIC_LIBRARY +# include "normalize_quat.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/normalize_row_sums.cpp b/vendor/libigl/include/igl/normalize_row_sums.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1204e073df001bec6b30bf2b3ac58302ddafa239 --- /dev/null +++ b/vendor/libigl/include/igl/normalize_row_sums.cpp @@ -0,0 +1,29 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "normalize_row_sums.h" + +template +IGL_INLINE void igl::normalize_row_sums( + const Eigen::MatrixBase& A, + Eigen::MatrixBase & B) +{ +#ifndef NDEBUG + // loop over rows + for(int i = 0; i < A.rows();i++) + { + typename DerivedB::Scalar sum = A.row(i).sum(); + assert(sum != 0); + } +#endif + B = (A.array().colwise() / A.rowwise().sum().array()).eval(); +} +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::normalize_row_sums, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase >&); +template void igl::normalize_row_sums, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase >&); +#endif diff --git a/vendor/libigl/include/igl/opengl/MeshGL.cpp b/vendor/libigl/include/igl/opengl/MeshGL.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6122c5c0b04c27d8c5920536a712a6c524b6301c --- /dev/null +++ b/vendor/libigl/include/igl/opengl/MeshGL.cpp @@ -0,0 +1,484 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "MeshGL.h" +#include "bind_vertex_attrib_array.h" +#include "create_shader_program.h" +#include "destroy_shader_program.h" +#include "verasansmono_compressed.h" +#include + +IGL_INLINE igl::opengl::MeshGL::MeshGL(): + tex_filter(GL_LINEAR), + tex_wrap(GL_REPEAT) +{ +} + +IGL_INLINE void igl::opengl::MeshGL::init_buffers() +{ + // Mesh: Vertex Array Object & Buffer objects + glGenVertexArrays(1, &vao_mesh); + glBindVertexArray(vao_mesh); + glGenBuffers(1, &vbo_V); + glGenBuffers(1, &vbo_V_normals); + glGenBuffers(1, &vbo_V_ambient); + glGenBuffers(1, &vbo_V_diffuse); + glGenBuffers(1, &vbo_V_specular); + glGenBuffers(1, &vbo_V_uv); + glGenBuffers(1, &vbo_F); + glGenTextures(1, &vbo_tex); + glGenTextures(1, &font_atlas); + + // Line overlay + glGenVertexArrays(1, &vao_overlay_lines); + glBindVertexArray(vao_overlay_lines); + glGenBuffers(1, &vbo_lines_F); + glGenBuffers(1, &vbo_lines_V); + glGenBuffers(1, &vbo_lines_V_colors); + + // Point overlay + glGenVertexArrays(1, &vao_overlay_points); + glBindVertexArray(vao_overlay_points); + glGenBuffers(1, &vbo_points_F); + glGenBuffers(1, &vbo_points_V); + glGenBuffers(1, &vbo_points_V_colors); + + // Text Labels + vertex_labels.init_buffers(); + face_labels.init_buffers(); + custom_labels.init_buffers(); + + dirty = MeshGL::DIRTY_ALL; +} + +IGL_INLINE void igl::opengl::MeshGL::free_buffers() +{ + if (is_initialized) + { + glDeleteVertexArrays(1, &vao_mesh); + glDeleteVertexArrays(1, &vao_overlay_lines); + glDeleteVertexArrays(1, &vao_overlay_points); + + glDeleteBuffers(1, &vbo_V); + glDeleteBuffers(1, &vbo_V_normals); + glDeleteBuffers(1, &vbo_V_ambient); + glDeleteBuffers(1, &vbo_V_diffuse); + glDeleteBuffers(1, &vbo_V_specular); + glDeleteBuffers(1, &vbo_V_uv); + glDeleteBuffers(1, &vbo_F); + glDeleteBuffers(1, &vbo_lines_F); + glDeleteBuffers(1, &vbo_lines_V); + glDeleteBuffers(1, &vbo_lines_V_colors); + glDeleteBuffers(1, &vbo_points_F); + glDeleteBuffers(1, &vbo_points_V); + glDeleteBuffers(1, &vbo_points_V_colors); + + // Text Labels + vertex_labels.free_buffers(); + face_labels.free_buffers(); + custom_labels.free_buffers(); + + glDeleteTextures(1, &vbo_tex); + glDeleteTextures(1, &font_atlas); + } +} + +IGL_INLINE void igl::opengl::MeshGL::TextGL::init_buffers() +{ + glGenVertexArrays(1, &vao_labels); + glBindVertexArray(vao_labels); + glGenBuffers(1, &vbo_labels_pos); + glGenBuffers(1, &vbo_labels_characters); + glGenBuffers(1, &vbo_labels_offset); + glGenBuffers(1, &vbo_labels_indices); +} + +IGL_INLINE void igl::opengl::MeshGL::TextGL::free_buffers() +{ + glDeleteBuffers(1, &vbo_labels_pos); + glDeleteBuffers(1, &vbo_labels_characters); + glDeleteBuffers(1, &vbo_labels_offset); + glDeleteBuffers(1, &vbo_labels_indices); +} + +IGL_INLINE void igl::opengl::MeshGL::bind_mesh() +{ + glBindVertexArray(vao_mesh); + glUseProgram(shader_mesh); + bind_vertex_attrib_array(shader_mesh,"position", vbo_V, V_vbo, dirty & MeshGL::DIRTY_POSITION); + bind_vertex_attrib_array(shader_mesh,"normal", vbo_V_normals, V_normals_vbo, dirty & MeshGL::DIRTY_NORMAL); + bind_vertex_attrib_array(shader_mesh,"Ka", vbo_V_ambient, V_ambient_vbo, dirty & MeshGL::DIRTY_AMBIENT); + bind_vertex_attrib_array(shader_mesh,"Kd", vbo_V_diffuse, V_diffuse_vbo, dirty & MeshGL::DIRTY_DIFFUSE); + bind_vertex_attrib_array(shader_mesh,"Ks", vbo_V_specular, V_specular_vbo, dirty & MeshGL::DIRTY_SPECULAR); + bind_vertex_attrib_array(shader_mesh,"texcoord", vbo_V_uv, V_uv_vbo, dirty & MeshGL::DIRTY_UV); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo_F); + if (dirty & MeshGL::DIRTY_FACE) + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned)*F_vbo.size(), F_vbo.data(), GL_DYNAMIC_DRAW); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, vbo_tex); + if (dirty & MeshGL::DIRTY_TEXTURE) + { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, tex_wrap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, tex_wrap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, tex_filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, tex_filter); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_u, tex_v, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex.data()); + } + glUniform1i(glGetUniformLocation(shader_mesh,"tex"), 0); + dirty &= ~MeshGL::DIRTY_MESH; +} + +IGL_INLINE void igl::opengl::MeshGL::bind_overlay_lines() +{ + bool is_dirty = dirty & MeshGL::DIRTY_OVERLAY_LINES; + + glBindVertexArray(vao_overlay_lines); + glUseProgram(shader_overlay_lines); + bind_vertex_attrib_array(shader_overlay_lines,"position", vbo_lines_V, lines_V_vbo, is_dirty); + bind_vertex_attrib_array(shader_overlay_lines,"color", vbo_lines_V_colors, lines_V_colors_vbo, is_dirty); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo_lines_F); + if (is_dirty) + { + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned)*lines_F_vbo.size(), lines_F_vbo.data(), GL_DYNAMIC_DRAW); + } + + dirty &= ~MeshGL::DIRTY_OVERLAY_LINES; +} + +IGL_INLINE void igl::opengl::MeshGL::bind_overlay_points() +{ + bool is_dirty = dirty & MeshGL::DIRTY_OVERLAY_POINTS; + + glBindVertexArray(vao_overlay_points); + glUseProgram(shader_overlay_points); + bind_vertex_attrib_array(shader_overlay_points,"position", vbo_points_V, points_V_vbo, is_dirty); + bind_vertex_attrib_array(shader_overlay_points,"color", vbo_points_V_colors, points_V_colors_vbo, is_dirty); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo_points_F); + if (is_dirty) + { + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned)*points_F_vbo.size(), points_F_vbo.data(), GL_DYNAMIC_DRAW); + } + + dirty &= ~MeshGL::DIRTY_OVERLAY_POINTS; +} + +IGL_INLINE void igl::opengl::MeshGL::init_text_rendering() +{ + // Decompress the png of the font atlas + unsigned char verasansmono_font_atlas[256*256]; + decompress_verasansmono_atlas(verasansmono_font_atlas); + + // Bind atlas + glBindTexture(GL_TEXTURE_2D, font_atlas); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, 256, 256, 0, GL_RED, GL_UNSIGNED_BYTE, verasansmono_font_atlas); + + // TextGL initialization + vertex_labels.dirty_flag = MeshGL::DIRTY_VERTEX_LABELS; + face_labels.dirty_flag = MeshGL::DIRTY_FACE_LABELS; + custom_labels.dirty_flag = MeshGL::DIRTY_CUSTOM_LABELS; +} + +IGL_INLINE void igl::opengl::MeshGL::bind_labels(const TextGL& labels) +{ + bool is_dirty = dirty & labels.dirty_flag; + glBindTexture(GL_TEXTURE_2D, font_atlas); + glBindVertexArray(labels.vao_labels); + glUseProgram(shader_text); + bind_vertex_attrib_array(shader_text, "position" , labels.vbo_labels_pos , labels.label_pos_vbo , is_dirty); + bind_vertex_attrib_array(shader_text, "character", labels.vbo_labels_characters, labels.label_char_vbo , is_dirty); + bind_vertex_attrib_array(shader_text, "offset" , labels.vbo_labels_offset , labels.label_offset_vbo, is_dirty); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, labels.vbo_labels_indices); + if (is_dirty) + { + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned)*labels.label_indices_vbo.size(), labels.label_indices_vbo.data(), GL_DYNAMIC_DRAW); + } + dirty &= ~labels.dirty_flag; +} + +IGL_INLINE void igl::opengl::MeshGL::draw_mesh(bool solid) +{ + glPolygonMode(GL_FRONT_AND_BACK, solid ? GL_FILL : GL_LINE); + + /* Avoid Z-buffer fighting between filled triangles & wireframe lines */ + if (solid) + { + glEnable(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(1.0, 1.0); + } + glDrawElements(GL_TRIANGLES, 3*F_vbo.rows(), GL_UNSIGNED_INT, 0); + + glDisable(GL_POLYGON_OFFSET_FILL); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +} + +IGL_INLINE void igl::opengl::MeshGL::draw_overlay_lines() +{ + glDrawElements(GL_LINES, lines_F_vbo.rows(), GL_UNSIGNED_INT, 0); +} + +IGL_INLINE void igl::opengl::MeshGL::draw_overlay_points() +{ + glDrawElements(GL_POINTS, points_F_vbo.rows(), GL_UNSIGNED_INT, 0); +} + +IGL_INLINE void igl::opengl::MeshGL::draw_labels(const TextGL& labels) +{ + glDrawElements(GL_POINTS, labels.label_indices_vbo.rows(), GL_UNSIGNED_INT, 0); +} + +IGL_INLINE void igl::opengl::MeshGL::init() +{ + if(is_initialized) + { + return; + } + is_initialized = true; + std::string mesh_vertex_shader_string = +R"(#version 150 + uniform mat4 view; + uniform mat4 proj; + uniform mat4 normal_matrix; + in vec3 position; + in vec3 normal; + out vec3 position_eye; + out vec3 normal_eye; + in vec4 Ka; + in vec4 Kd; + in vec4 Ks; + in vec2 texcoord; + out vec2 texcoordi; + out vec4 Kai; + out vec4 Kdi; + out vec4 Ksi; + + void main() + { + position_eye = vec3 (view * vec4 (position, 1.0)); + normal_eye = vec3 (normal_matrix * vec4 (normal, 0.0)); + normal_eye = normalize(normal_eye); + gl_Position = proj * vec4 (position_eye, 1.0); //proj * view * vec4(position, 1.0);" + Kai = Ka; + Kdi = Kd; + Ksi = Ks; + texcoordi = texcoord; + } +)"; + + std::string mesh_fragment_shader_string = +R"(#version 150 + uniform mat4 view; + uniform mat4 proj; + uniform vec4 fixed_color; + in vec3 position_eye; + in vec3 normal_eye; + uniform vec3 light_position_eye; + vec3 Ls = vec3 (1, 1, 1); + vec3 Ld = vec3 (1, 1, 1); + vec3 La = vec3 (1, 1, 1); + in vec4 Ksi; + in vec4 Kdi; + in vec4 Kai; + in vec2 texcoordi; + uniform sampler2D tex; + uniform float specular_exponent; + uniform float lighting_factor; + uniform float texture_factor; + uniform float matcap_factor; + uniform float double_sided; + out vec4 outColor; + void main() + { + if(matcap_factor == 1.0f) + { + vec2 uv = normalize(normal_eye).xy * 0.5 + 0.5; + outColor = texture(tex, uv); + }else + { + vec3 Ia = La * vec3(Kai); // ambient intensity + + vec3 vector_to_light_eye = light_position_eye - position_eye; + vec3 direction_to_light_eye = normalize (vector_to_light_eye); + float dot_prod = dot (direction_to_light_eye, normalize(normal_eye)); + float clamped_dot_prod = abs(max (dot_prod, -double_sided)); + vec3 Id = Ld * vec3(Kdi) * clamped_dot_prod; // Diffuse intensity + + vec3 reflection_eye = reflect (-direction_to_light_eye, normalize(normal_eye)); + vec3 surface_to_viewer_eye = normalize (-position_eye); + float dot_prod_specular = dot (reflection_eye, surface_to_viewer_eye); + dot_prod_specular = float(abs(dot_prod)==dot_prod) * abs(max (dot_prod_specular, -double_sided)); + float specular_factor = pow (dot_prod_specular, specular_exponent); + vec3 Is = Ls * vec3(Ksi) * specular_factor; // specular intensity + vec4 color = vec4(lighting_factor * (Is + Id) + Ia + (1.0-lighting_factor) * vec3(Kdi),(Kai.a+Ksi.a+Kdi.a)/3); + outColor = mix(vec4(1,1,1,1), texture(tex, texcoordi), texture_factor) * color; + if (fixed_color != vec4(0.0)) outColor = fixed_color; + } + } +)"; + + std::string overlay_vertex_shader_string = +R"(#version 150 + uniform mat4 view; + uniform mat4 proj; + in vec3 position; + in vec3 color; + out vec3 color_frag; + + void main() + { + gl_Position = proj * view * vec4 (position, 1.0); + color_frag = color; + } +)"; + + std::string overlay_fragment_shader_string = +R"(#version 150 + in vec3 color_frag; + out vec4 outColor; + void main() + { + outColor = vec4(color_frag, 1.0); + } +)"; + + std::string overlay_point_fragment_shader_string = +R"(#version 150 + in vec3 color_frag; + out vec4 outColor; + void main() + { + if (length(gl_PointCoord - vec2(0.5)) > 0.5) + discard; + outColor = vec4(color_frag, 1.0); + } +)"; + + std::string text_vert_shader = +R"(#version 330 + in vec3 position; + in float character; + in float offset; + uniform mat4 view; + uniform mat4 proj; + out int vCharacter; + out float vOffset; + void main() + { + vCharacter = int(character); + vOffset = offset; + gl_Position = proj * view * vec4(position, 1.0); + } +)"; + + std::string text_geom_shader = +R"(#version 150 core + layout(points) in; + layout(triangle_strip, max_vertices = 4) out; + out vec2 gTexCoord; + uniform mat4 view; + uniform mat4 proj; + uniform vec2 CellSize; + uniform vec2 CellOffset; + uniform vec2 RenderSize; + uniform vec2 RenderOrigin; + uniform float TextShiftFactor; + in int vCharacter[1]; + in float vOffset[1]; + void main() + { + // Code taken from https://prideout.net/strings-inside-vertex-buffers + // Determine the final quad's position and size: + vec4 P = gl_in[0].gl_Position + vec4( vOffset[0]*TextShiftFactor, 0.0, 0.0, 0.0 ); // 0.04 + vec4 U = vec4(1, 0, 0, 0) * RenderSize.x; // 1.0 + vec4 V = vec4(0, 1, 0, 0) * RenderSize.y; // 1.0 + + // Determine the texture coordinates: + int letter = vCharacter[0]; // used to be the character + letter = clamp(letter - 32, 0, 96); + int row = letter / 16 + 1; + int col = letter % 16; + float S0 = CellOffset.x + CellSize.x * col; + float T0 = CellOffset.y + 1 - CellSize.y * row; + float S1 = S0 + CellSize.x - CellOffset.x; + float T1 = T0 + CellSize.y; + + // Output the quad's vertices: + gTexCoord = vec2(S0, T1); gl_Position = P - U - V; EmitVertex(); + gTexCoord = vec2(S1, T1); gl_Position = P + U - V; EmitVertex(); + gTexCoord = vec2(S0, T0); gl_Position = P - U + V; EmitVertex(); + gTexCoord = vec2(S1, T0); gl_Position = P + U + V; EmitVertex(); + EndPrimitive(); + } +)"; + + std::string text_frag_shader = +R"(#version 330 + out vec4 outColor; + in vec2 gTexCoord; + uniform sampler2D font_atlas; + uniform vec3 TextColor; + void main() + { + float A = texture(font_atlas, gTexCoord).r; + outColor = vec4(TextColor, A); + } +)"; + + init_buffers(); + init_text_rendering(); + create_shader_program( + mesh_vertex_shader_string, + mesh_fragment_shader_string, + {}, + shader_mesh); + create_shader_program( + overlay_vertex_shader_string, + overlay_fragment_shader_string, + {}, + shader_overlay_lines); + create_shader_program( + overlay_vertex_shader_string, + overlay_point_fragment_shader_string, + {}, + shader_overlay_points); + create_shader_program( + text_geom_shader, + text_vert_shader, + text_frag_shader, + {}, + shader_text); +} + +IGL_INLINE void igl::opengl::MeshGL::free() +{ + const auto free = [](GLuint & id) + { + if(id) + { + destroy_shader_program(id); + id = 0; + } + }; + + if (is_initialized) + { + free(shader_mesh); + free(shader_overlay_lines); + free(shader_overlay_points); + free(shader_text); + free_buffers(); + } +} diff --git a/vendor/libigl/include/igl/opengl/MeshGL.h b/vendor/libigl/include/igl/opengl/MeshGL.h new file mode 100644 index 0000000000000000000000000000000000000000..269b76c236e50b21231ae4ac583e5746e6f1374b --- /dev/null +++ b/vendor/libigl/include/igl/opengl/MeshGL.h @@ -0,0 +1,168 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_MESHGL_H +#define IGL_OPENGL_MESHGL_H + +// Coverts mesh data inside a igl::ViewerData class in an OpenGL +// compatible format The class includes a shader and the opengl calls to plot +// the data + +#include +#include + +namespace igl +{ +namespace opengl +{ + +class MeshGL +{ +public: + typedef unsigned int GLuint; + typedef unsigned int GLint; + + enum DirtyFlags + { + DIRTY_NONE = 0x0000, + DIRTY_POSITION = 0x0001, + DIRTY_UV = 0x0002, + DIRTY_NORMAL = 0x0004, + DIRTY_AMBIENT = 0x0008, + DIRTY_DIFFUSE = 0x0010, + DIRTY_SPECULAR = 0x0020, + DIRTY_TEXTURE = 0x0040, + DIRTY_FACE = 0x0080, + DIRTY_MESH = 0x00FF, + DIRTY_OVERLAY_LINES = 0x0100, + DIRTY_OVERLAY_POINTS = 0x0200, + DIRTY_VERTEX_LABELS = 0x0400, + DIRTY_FACE_LABELS = 0x0800, + DIRTY_CUSTOM_LABELS = 0x1000, + DIRTY_ALL = 0xFFFF + }; + + bool is_initialized = false; + GLuint vao_mesh; + GLuint vao_overlay_lines; + GLuint vao_overlay_points; + GLuint shader_mesh; + GLuint shader_overlay_lines; + GLuint shader_overlay_points; + GLuint shader_text; + + GLuint vbo_V; // Vertices of the current mesh (#V x 3) + GLuint vbo_V_uv; // UV coordinates for the current mesh (#V x 2) + GLuint vbo_V_normals; // Vertices of the current mesh (#V x 3) + GLuint vbo_V_ambient; // Ambient material (#V x 3) + GLuint vbo_V_diffuse; // Diffuse material (#V x 3) + GLuint vbo_V_specular; // Specular material (#V x 3) + + GLuint vbo_F; // Faces of the mesh (#F x 3) + GLuint vbo_tex; // Texture + + GLuint vbo_lines_F; // Indices of the line overlay + GLuint vbo_lines_V; // Vertices of the line overlay + GLuint vbo_lines_V_colors; // Color values of the line overlay + GLuint vbo_points_F; // Indices of the point overlay + GLuint vbo_points_V; // Vertices of the point overlay + GLuint vbo_points_V_colors; // Color values of the point overlay + + // Temporary copy of the content of each VBO + typedef Eigen::Matrix RowMatrixXf; + RowMatrixXf V_vbo; + RowMatrixXf V_normals_vbo; + RowMatrixXf V_ambient_vbo; + RowMatrixXf V_diffuse_vbo; + RowMatrixXf V_specular_vbo; + RowMatrixXf V_uv_vbo; + RowMatrixXf lines_V_vbo; + RowMatrixXf lines_V_colors_vbo; + RowMatrixXf points_V_vbo; + RowMatrixXf points_V_colors_vbo; + + // Text Rendering + struct TextGL + { + uint32_t dirty_flag; + GLuint vao_labels; + GLuint vbo_labels_pos; + GLuint vbo_labels_characters; + GLuint vbo_labels_offset; + GLuint vbo_labels_indices; + RowMatrixXf label_pos_vbo; + RowMatrixXf label_char_vbo; + RowMatrixXf label_offset_vbo; + Eigen::Matrix label_indices_vbo; + void init_buffers(); + void free_buffers(); + }; + TextGL vertex_labels; + TextGL face_labels; + TextGL custom_labels; + GLuint font_atlas; + + int tex_u; + int tex_v; + GLint tex_filter; + GLint tex_wrap; + Eigen::Matrix tex; + + Eigen::Matrix F_vbo; + Eigen::Matrix lines_F_vbo; + Eigen::Matrix points_F_vbo; + + // Marks dirty buffers that need to be uploaded to OpenGL + uint32_t dirty; + + IGL_INLINE MeshGL(); + + // Initialize shaders and buffers + IGL_INLINE void init(); + + // Release all resources + IGL_INLINE void free(); + + // Create a new set of OpenGL buffer objects + IGL_INLINE void init_buffers(); + + // Bind the underlying OpenGL buffer objects for subsequent mesh draw calls + IGL_INLINE void bind_mesh(); + + /// Draw the currently buffered mesh (either solid or wireframe) + IGL_INLINE void draw_mesh(bool solid); + + // Bind the underlying OpenGL buffer objects for subsequent line overlay draw calls + IGL_INLINE void bind_overlay_lines(); + + /// Draw the currently buffered line overlay + IGL_INLINE void draw_overlay_lines(); + + // Bind the underlying OpenGL buffer objects for subsequent point overlay draw calls + IGL_INLINE void bind_overlay_points(); + + /// Draw the currently buffered point overlay + IGL_INLINE void draw_overlay_points(); + + // Text Binding and Draw functions + IGL_INLINE void init_text_rendering(); + IGL_INLINE void bind_labels(const TextGL& labels); + IGL_INLINE void draw_labels(const TextGL& labels); + + // Release the OpenGL buffer objects + IGL_INLINE void free_buffers(); + +}; + +} +} + +#ifndef IGL_STATIC_LIBRARY +# include "MeshGL.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/ViewerCore.cpp b/vendor/libigl/include/igl/opengl/ViewerCore.cpp new file mode 100644 index 0000000000000000000000000000000000000000..06d698132cdbb278bff1bb8b580321dd353e9643 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/ViewerCore.cpp @@ -0,0 +1,458 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "ViewerCore.h" +#include "ViewerData.h" +#include "gl.h" +#include "../quat_to_mat.h" +#include "../snap_to_fixed_up.h" +#include "../look_at.h" +#include "../frustum.h" +#include "../ortho.h" +#include "../massmatrix.h" +#include "../barycenter.h" +#include "../PI.h" +#include +#include + +IGL_INLINE void igl::opengl::ViewerCore::align_camera_center( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F) +{ + if(V.rows() == 0) + return; + + get_scale_and_shift_to_fit_mesh(V,F,camera_base_zoom,camera_base_translation); + // Rather than crash on empty mesh... + if(V.size() > 0) + { + object_scale = (V.colwise().maxCoeff() - V.colwise().minCoeff()).norm(); + } +} + +IGL_INLINE void igl::opengl::ViewerCore::get_scale_and_shift_to_fit_mesh( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + float& zoom, + Eigen::Vector3f& shift) +{ + if (V.rows() == 0) + return; + + Eigen::MatrixXd BC; + if (F.rows() <= 1) + { + BC = V; + } else + { + igl::barycenter(V,F,BC); + } + return get_scale_and_shift_to_fit_mesh(BC,zoom,shift); +} + +IGL_INLINE void igl::opengl::ViewerCore::align_camera_center( + const Eigen::MatrixXd& V) +{ + if(V.rows() == 0) + return; + + get_scale_and_shift_to_fit_mesh(V,camera_base_zoom,camera_base_translation); + // Rather than crash on empty mesh... + if(V.size() > 0) + { + object_scale = (V.colwise().maxCoeff() - V.colwise().minCoeff()).norm(); + } +} + +IGL_INLINE void igl::opengl::ViewerCore::get_scale_and_shift_to_fit_mesh( + const Eigen::MatrixXd& V, + float& zoom, + Eigen::Vector3f& shift) +{ + if (V.rows() == 0) + return; + + auto min_point = V.colwise().minCoeff(); + auto max_point = V.colwise().maxCoeff(); + auto centroid = (0.5*(min_point + max_point)).eval(); + shift.setConstant(0); + shift.head(centroid.size()) = -centroid.cast(); + zoom = 2.0 / (max_point-min_point).array().abs().maxCoeff(); +} + + +IGL_INLINE void igl::opengl::ViewerCore::clear_framebuffers() +{ + // The glScissor call ensures we only clear this core's buffers, + // (in case the user wants different background colors in each viewport.) + glScissor(viewport(0), viewport(1), viewport(2), viewport(3)); + glEnable(GL_SCISSOR_TEST); + glClearColor(background_color[0], + background_color[1], + background_color[2], + background_color[3]); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glDisable(GL_SCISSOR_TEST); +} + +IGL_INLINE void igl::opengl::ViewerCore::draw( + ViewerData& data, + bool update_matrices) +{ + using namespace std; + using namespace Eigen; + + if (depth_test) + glEnable(GL_DEPTH_TEST); + else + glDisable(GL_DEPTH_TEST); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + /* Bind and potentially refresh mesh/line/point data */ + if (data.dirty) + { + data.updateGL(data, data.invert_normals, data.meshgl); + data.dirty = MeshGL::DIRTY_NONE; + } + data.meshgl.bind_mesh(); + + // Initialize uniform + glViewport(viewport(0), viewport(1), viewport(2), viewport(3)); + + if(update_matrices) + { + view = Eigen::Matrix4f::Identity(); + proj = Eigen::Matrix4f::Identity(); + norm = Eigen::Matrix4f::Identity(); + + float width = viewport(2); + float height = viewport(3); + + // Set view + look_at( camera_eye, camera_center, camera_up, view); + view = view + * (trackball_angle * Eigen::Scaling(camera_zoom * camera_base_zoom) + * Eigen::Translation3f(camera_translation + camera_base_translation)).matrix(); + + norm = view.inverse().transpose(); + + // Set projection + if (orthographic) + { + float length = (camera_eye - camera_center).norm(); + float h = tan(camera_view_angle/360.0 * igl::PI) * (length); + ortho(-h*width/height, h*width/height, -h, h, camera_dnear, camera_dfar,proj); + } + else + { + float fH = tan(camera_view_angle / 360.0 * igl::PI) * camera_dnear; + float fW = fH * (double)width/(double)height; + frustum(-fW, fW, -fH, fH, camera_dnear, camera_dfar,proj); + } + } + + // Send transformations to the GPU + GLint viewi = glGetUniformLocation(data.meshgl.shader_mesh,"view"); + GLint proji = glGetUniformLocation(data.meshgl.shader_mesh,"proj"); + GLint normi = glGetUniformLocation(data.meshgl.shader_mesh,"normal_matrix"); + glUniformMatrix4fv(viewi, 1, GL_FALSE, view.data()); + glUniformMatrix4fv(proji, 1, GL_FALSE, proj.data()); + glUniformMatrix4fv(normi, 1, GL_FALSE, norm.data()); + + // Light parameters + GLint specular_exponenti = glGetUniformLocation(data.meshgl.shader_mesh,"specular_exponent"); + GLint light_position_eyei = glGetUniformLocation(data.meshgl.shader_mesh,"light_position_eye"); + GLint lighting_factori = glGetUniformLocation(data.meshgl.shader_mesh,"lighting_factor"); + GLint fixed_colori = glGetUniformLocation(data.meshgl.shader_mesh,"fixed_color"); + GLint texture_factori = glGetUniformLocation(data.meshgl.shader_mesh,"texture_factor"); + GLint matcap_factori = glGetUniformLocation(data.meshgl.shader_mesh,"matcap_factor"); + GLint double_sidedi = glGetUniformLocation(data.meshgl.shader_mesh,"double_sided"); + + glUniform1f(specular_exponenti, data.shininess); + glUniform3fv(light_position_eyei, 1, light_position.data()); + glUniform1f(lighting_factori, lighting_factor); // enables lighting + glUniform4f(fixed_colori, 0.0, 0.0, 0.0, 0.0); + + if (data.V.rows()>0) + { + // Render fill + if (is_set(data.show_faces)) + { + // Texture + glUniform1f(texture_factori, is_set(data.show_texture) ? 1.0f : 0.0f); + glUniform1f(matcap_factori, is_set(data.use_matcap) ? 1.0f : 0.0f); + glUniform1f(double_sidedi, data.double_sided ? 1.0f : 0.0f); + data.meshgl.draw_mesh(true); + glUniform1f(matcap_factori, 0.0f); + glUniform1f(texture_factori, 0.0f); + } + + // Render wireframe + if (is_set(data.show_lines)) + { + glLineWidth(data.line_width); + glUniform4f(fixed_colori, + data.line_color[0], + data.line_color[1], + data.line_color[2], + data.line_color[3]); + data.meshgl.draw_mesh(false); + glUniform4f(fixed_colori, 0.0f, 0.0f, 0.0f, 0.0f); + } + } + + if (is_set(data.show_overlay)) + { + if (is_set(data.show_overlay_depth)) + glEnable(GL_DEPTH_TEST); + else + glDisable(GL_DEPTH_TEST); + + if (data.lines.rows() > 0) + { + data.meshgl.bind_overlay_lines(); + viewi = glGetUniformLocation(data.meshgl.shader_overlay_lines,"view"); + proji = glGetUniformLocation(data.meshgl.shader_overlay_lines,"proj"); + + glUniformMatrix4fv(viewi, 1, GL_FALSE, view.data()); + glUniformMatrix4fv(proji, 1, GL_FALSE, proj.data()); + // This must be enabled, otherwise glLineWidth has no effect + glEnable(GL_LINE_SMOOTH); + glLineWidth(data.line_width); + + data.meshgl.draw_overlay_lines(); + } + + if (data.points.rows() > 0) + { + data.meshgl.bind_overlay_points(); + viewi = glGetUniformLocation(data.meshgl.shader_overlay_points,"view"); + proji = glGetUniformLocation(data.meshgl.shader_overlay_points,"proj"); + + glUniformMatrix4fv(viewi, 1, GL_FALSE, view.data()); + glUniformMatrix4fv(proji, 1, GL_FALSE, proj.data()); + glPointSize(data.point_size); + data.meshgl.draw_overlay_points(); + } + glEnable(GL_DEPTH_TEST); + } + + if(is_set(data.show_vertex_labels)&&data.vertex_labels_positions.rows()>0) + draw_labels(data, data.meshgl.vertex_labels); + if(is_set(data.show_face_labels)&&data.face_labels_positions.rows()>0) + draw_labels(data, data.meshgl.face_labels); + if(is_set(data.show_custom_labels)&&data.labels_positions.rows()>0) + draw_labels(data, data.meshgl.custom_labels); +} + +IGL_INLINE void igl::opengl::ViewerCore::draw_buffer(ViewerData& data, + bool update_matrices, + Eigen::Matrix& R, + Eigen::Matrix& G, + Eigen::Matrix& B, + Eigen::Matrix& A) +{ + assert(R.rows() == G.rows() && G.rows() == B.rows() && B.rows() == A.rows()); + assert(R.cols() == G.cols() && G.cols() == B.cols() && B.cols() == A.cols()); + + unsigned width = R.rows(); + unsigned height = R.cols(); + + // https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing + unsigned int framebuffer; + glGenFramebuffers(1, &framebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); + // create a multisampled color attachment texture + unsigned int textureColorBufferMultiSampled; + glGenTextures(1, &textureColorBufferMultiSampled); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textureColorBufferMultiSampled); + glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGBA, width, height, GL_TRUE); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, textureColorBufferMultiSampled, 0); + // create a (also multisampled) renderbuffer object for depth and stencil attachments + unsigned int rbo; + glGenRenderbuffers(1, &rbo); + glBindRenderbuffer(GL_RENDERBUFFER, rbo); + glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_DEPTH24_STENCIL8, width, height); + glBindRenderbuffer(GL_RENDERBUFFER, 0); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo); + assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + + // configure second post-processing framebuffer + unsigned int intermediateFBO; + glGenFramebuffers(1, &intermediateFBO); + glBindFramebuffer(GL_FRAMEBUFFER, intermediateFBO); + // create a color attachment texture + unsigned int screenTexture; + glGenTextures(1, &screenTexture); + glBindTexture(GL_TEXTURE_2D, screenTexture); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, screenTexture, 0); // we only need a color buffer + assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); + + // Clear the buffer + glClearColor(background_color(0), background_color(1), background_color(2), 0.f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + // Save old viewport + Eigen::Vector4f viewport_ori = viewport; + viewport << 0,0,width,height; + // Draw + draw(data,update_matrices); + // Restore viewport + viewport = viewport_ori; + + glBindFramebuffer(GL_READ_FRAMEBUFFER, framebuffer); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, intermediateFBO); + glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_NEAREST); + + glBindFramebuffer(GL_FRAMEBUFFER, intermediateFBO); + // Copy back in the given Eigen matrices + GLubyte* pixels = (GLubyte*)calloc(width*height*4,sizeof(GLubyte)); + glReadPixels(0, 0,width, height,GL_RGBA, GL_UNSIGNED_BYTE, pixels); + + // Clean up + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + glDeleteTextures(1, &screenTexture); + glDeleteTextures(1, &textureColorBufferMultiSampled); + glDeleteFramebuffers(1, &framebuffer); + glDeleteFramebuffers(1, &intermediateFBO); + glDeleteRenderbuffers(1, &rbo); + + int count = 0; + for (unsigned j=0; j +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_VIEWERCORE_H +#define IGL_OPENGL_VIEWERCORE_H + +#include + +#include +#include +#include + +namespace igl +{ +namespace opengl +{ + +// Forward declaration +class ViewerData; + +// Basic class of the 3D mesh viewer +// TODO: write documentation +class ViewerCore +{ +public: + IGL_INLINE ViewerCore(); + + // Initialization + IGL_INLINE void init(); + + // Shutdown + IGL_INLINE void shut(); + + // Serialization code + IGL_INLINE void InitSerialization(); + + // ------------------- Camera control functions + + // Adjust the view to see the entire model + IGL_INLINE void align_camera_center( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F); + + // Determines how much to zoom and shift such that the mesh fills the unit + // box (centered at the origin) + IGL_INLINE void get_scale_and_shift_to_fit_mesh( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + float & zoom, + Eigen::Vector3f& shift); + + // Adjust the view to see the entire model + IGL_INLINE void align_camera_center( + const Eigen::MatrixXd& V); + + // Determines how much to zoom and shift such that the mesh fills the unit + // box (centered at the origin) + IGL_INLINE void get_scale_and_shift_to_fit_mesh( + const Eigen::MatrixXd& V, + float & zoom, + Eigen::Vector3f& shift); + + // ------------------- Drawing functions + + // Clear the frame buffers + IGL_INLINE void clear_framebuffers(); + + // Draw everything + // + // data cannot be const because it is being set to "clean" + IGL_INLINE void draw(ViewerData& data, bool update_matrices = true); + IGL_INLINE void draw_buffer( + ViewerData& data, + bool update_matrices, + Eigen::Matrix& R, + Eigen::Matrix& G, + Eigen::Matrix& B, + Eigen::Matrix& A); + IGL_INLINE void draw_labels( + ViewerData& data, + const igl::opengl::MeshGL::TextGL& labels + ); + + // Trackball angle (quaternion) + enum RotationType + { + ROTATION_TYPE_TRACKBALL = 0, + ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP = 1, + ROTATION_TYPE_NO_ROTATION = 2, + NUM_ROTATION_TYPES = 3 + }; + IGL_INLINE void set_rotation_type(const RotationType & value); + + // ------------------- Option helpers + + // Set a ViewerData visualization option for this viewport + IGL_INLINE void set(unsigned int &property_mask, bool value = true) const; + + // Unset a ViewerData visualization option for this viewport + IGL_INLINE void unset(unsigned int &property_mask) const; + + // Toggle a ViewerData visualization option for this viewport + IGL_INLINE void toggle(unsigned int &property_mask) const; + + // Check whether a ViewerData visualization option is set for this viewport + IGL_INLINE bool is_set(unsigned int property_mask) const; + + // ------------------- Properties + + // Unique identifier + unsigned int id = 1u; + + // Colors + Eigen::Vector4f background_color; + + // Lighting + Eigen::Vector3f light_position; + float lighting_factor; + + RotationType rotation_type; + Eigen::Quaternionf trackball_angle; + + // Camera parameters + float camera_base_zoom; + float camera_zoom; + bool orthographic; + Eigen::Vector3f camera_base_translation; + Eigen::Vector3f camera_translation; + Eigen::Vector3f camera_eye; + Eigen::Vector3f camera_up; + Eigen::Vector3f camera_center; + float camera_view_angle; + float camera_dnear; + float camera_dfar; + + bool depth_test; + + // Animation + bool is_animating; + double animation_max_fps; + + // Caches the two-norm between the min/max point of the bounding box + float object_scale; + + // Viewport size + Eigen::Vector4f viewport; + + // Save the OpenGL transformation matrices used for the previous rendering pass + Eigen::Matrix4f view; + Eigen::Matrix4f proj; + Eigen::Matrix4f norm; + public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW +}; + +} +} + +#include +namespace igl { + namespace serialization { + + inline void serialization(bool s, igl::opengl::ViewerCore& obj, std::vector& buffer) + { + + SERIALIZE_MEMBER(background_color); + + SERIALIZE_MEMBER(light_position); + SERIALIZE_MEMBER(lighting_factor); + + SERIALIZE_MEMBER(trackball_angle); + SERIALIZE_MEMBER(rotation_type); + + SERIALIZE_MEMBER(camera_base_zoom); + SERIALIZE_MEMBER(camera_zoom); + SERIALIZE_MEMBER(orthographic); + SERIALIZE_MEMBER(camera_base_translation); + SERIALIZE_MEMBER(camera_translation); + SERIALIZE_MEMBER(camera_view_angle); + SERIALIZE_MEMBER(camera_dnear); + SERIALIZE_MEMBER(camera_dfar); + SERIALIZE_MEMBER(camera_eye); + SERIALIZE_MEMBER(camera_center); + SERIALIZE_MEMBER(camera_up); + + SERIALIZE_MEMBER(depth_test); + SERIALIZE_MEMBER(is_animating); + SERIALIZE_MEMBER(animation_max_fps); + + SERIALIZE_MEMBER(object_scale); + + SERIALIZE_MEMBER(viewport); + SERIALIZE_MEMBER(view); + SERIALIZE_MEMBER(proj); + SERIALIZE_MEMBER(norm); + } + + template<> + inline void serialize(const igl::opengl::ViewerCore& obj, std::vector& buffer) + { + serialization(true, const_cast(obj), buffer); + } + + template<> + inline void deserialize(igl::opengl::ViewerCore& obj, const std::vector& buffer) + { + serialization(false, obj, const_cast&>(buffer)); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "ViewerCore.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/ViewerData.cpp b/vendor/libigl/include/igl/opengl/ViewerData.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fa92758b6a521496a88a31cf83eb2733d2b639c4 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/ViewerData.cpp @@ -0,0 +1,913 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "ViewerData.h" +#include "ViewerCore.h" + +#include "../per_face_normals.h" +#include "../material_colors.h" +#include "../per_vertex_normals.h" + +// Really? Just for GL_NEAREST? +#include "gl.h" + +#include + + +IGL_INLINE igl::opengl::ViewerData::ViewerData() +: dirty(MeshGL::DIRTY_ALL), + show_faces (~unsigned(0)), + show_lines (~unsigned(0)), + face_based (false), + double_sided (false), + invert_normals (false), + show_overlay (~unsigned(0)), + show_overlay_depth(~unsigned(0)), + show_vertex_labels(0), + show_face_labels (0), + show_custom_labels(0), + show_texture (false), + use_matcap (false), + point_size(30), + line_width(0.5f), + label_size(1), + line_color(0,0,0,1), + label_color(0,0,0.04,1), + shininess(35.0f), + id(-1), + is_visible (~unsigned(0)) +{ + clear(); +}; + +IGL_INLINE void igl::opengl::ViewerData::set_face_based(bool newvalue) +{ + if (face_based != newvalue) + { + face_based = newvalue; + dirty = MeshGL::DIRTY_ALL; + } +} + +// Helpers that draws the most common meshes +IGL_INLINE void igl::opengl::ViewerData::set_mesh( + const Eigen::MatrixXd& _V, const Eigen::MatrixXi& _F) +{ + using namespace std; + + Eigen::MatrixXd V_temp; + + // If V only has two columns, pad with a column of zeros + if (_V.cols() == 2) + { + V_temp = Eigen::MatrixXd::Zero(_V.rows(),3); + V_temp.block(0,0,_V.rows(),2) = _V; + } + else + V_temp = _V; + + if (V.rows() == 0 && F.rows() == 0) + { + V = V_temp; + F = _F; + + compute_normals(); + uniform_colors( + Eigen::Vector3d(GOLD_AMBIENT[0], GOLD_AMBIENT[1], GOLD_AMBIENT[2]), + Eigen::Vector3d(GOLD_DIFFUSE[0], GOLD_DIFFUSE[1], GOLD_DIFFUSE[2]), + Eigen::Vector3d(GOLD_SPECULAR[0], GOLD_SPECULAR[1], GOLD_SPECULAR[2])); + + // Generates a checkerboard texture + grid_texture(); + } + else + { + if (_V.rows() == V.rows() && _F.rows() == F.rows()) + { + V = V_temp; + F = _F; + } + else + cerr << "ERROR (set_mesh): The new mesh has a different number of vertices/faces. Please clear the mesh before plotting."<0 && C.cols() == 1) + { + assert(false && "deprecated: call set_data directly instead"); + return set_data(C); + } + // Ambient color should be darker color + const auto ambient = [](const MatrixXd & C)->MatrixXd + { + MatrixXd T = 0.1*C; + T.col(3) = C.col(3); + return T; + }; + // Specular color should be a less saturated and darker color: dampened + // highlights + const auto specular = [](const MatrixXd & C)->MatrixXd + { + const double grey = 0.3; + MatrixXd T = grey+0.1*(C.array()-grey); + T.col(3) = C.col(3); + return T; + }; + if (C.rows() == 1) + { + for (unsigned i=0;i& R, + const Eigen::Matrix& G, + const Eigen::Matrix& B) +{ + texture_R = R; + texture_G = G; + texture_B = B; + texture_A = Eigen::Matrix::Constant(R.rows(),R.cols(),255); + dirty |= MeshGL::DIRTY_TEXTURE; +} + +IGL_INLINE void igl::opengl::ViewerData::set_texture( + const Eigen::Matrix& R, + const Eigen::Matrix& G, + const Eigen::Matrix& B, + const Eigen::Matrix& A) +{ + texture_R = R; + texture_G = G; + texture_B = B; + texture_A = A; + dirty |= MeshGL::DIRTY_TEXTURE; +} + +IGL_INLINE void igl::opengl::ViewerData::set_data( + const Eigen::VectorXd & D, + double caxis_min, + double caxis_max, + igl::ColorMapType cmap, + int num_steps) +{ + if(!show_texture) + { + Eigen::MatrixXd CM; + igl::colormap(cmap,Eigen::VectorXd::LinSpaced(num_steps,0,1).eval(),0,1,CM); + set_colormap(CM); + } + set_uv(((D.array()-caxis_min)/(caxis_max-caxis_min)).replicate(1,2)); +} + +IGL_INLINE void igl::opengl::ViewerData::set_data(const Eigen::VectorXd & D, igl::ColorMapType cmap, int num_steps) +{ + const double caxis_min = D.minCoeff(); + const double caxis_max = D.maxCoeff(); + return set_data(D,caxis_min,caxis_max,cmap,num_steps); +} + +IGL_INLINE void igl::opengl::ViewerData::set_colormap(const Eigen::MatrixXd & CM) +{ + assert(CM.cols() == 3 && "colormap CM should have 3 columns"); + // Convert to R,G,B textures + const Eigen::Matrix R = + (CM.col(0)*255.0).cast(); + const Eigen::Matrix G = + (CM.col(1)*255.0).cast(); + const Eigen::Matrix B = + (CM.col(2)*255.0).cast(); + set_colors(Eigen::RowVector3d(1,1,1)); + set_texture(R,G,B); + show_texture = ~unsigned(0); + meshgl.tex_filter = GL_NEAREST; + meshgl.tex_wrap = GL_CLAMP_TO_EDGE; +} + +IGL_INLINE void igl::opengl::ViewerData::set_points( + const Eigen::MatrixXd& P, + const Eigen::MatrixXd& C) +{ + // clear existing points + points.resize(0,0); + add_points(P,C); +} + +IGL_INLINE void igl::opengl::ViewerData::add_points(const Eigen::MatrixXd& P, const Eigen::MatrixXd& C) +{ + Eigen::MatrixXd P_temp; + + // If P only has two columns, pad with a column of zeros + if (P.cols() == 2) + { + P_temp = Eigen::MatrixXd::Zero(P.rows(),3); + P_temp.block(0,0,P.rows(),2) = P; + } + else + P_temp = P; + + int lastid = points.rows(); + points.conservativeResize(points.rows() + P_temp.rows(),6); + for (unsigned i=0; i(); + set_edges(PV,E, C.rows() == 1?C:C.replicate<2,1>()); +} + +IGL_INLINE void igl::opengl::ViewerData::add_edges(const Eigen::MatrixXd& P1, const Eigen::MatrixXd& P2, const Eigen::MatrixXd& C) +{ + Eigen::MatrixXd P1_temp,P2_temp; + + // If P1 only has two columns, pad with a column of zeros + if (P1.cols() == 2) + { + P1_temp = Eigen::MatrixXd::Zero(P1.rows(),3); + P1_temp.block(0,0,P1.rows(),2) = P1; + P2_temp = Eigen::MatrixXd::Zero(P2.rows(),3); + P2_temp.block(0,0,P2.rows(),2) = P2; + } + else + { + P1_temp = P1; + P2_temp = P2; + } + + int lastid = lines.rows(); + lines.conservativeResize(lines.rows() + P1_temp.rows(),9); + for (unsigned i=0; i& str) +{ + assert(P.rows() == str.size() && "position # and label # do not match!"); + assert(P.cols() == 3 && "dimension of label positions incorrect!"); + labels_positions = P; + labels_strings = str; + + dirty |= MeshGL::DIRTY_CUSTOM_LABELS; +} + +IGL_INLINE void igl::opengl::ViewerData::clear_labels() +{ + labels_positions.resize(0,3); + labels_strings.clear(); +} + +IGL_INLINE void igl::opengl::ViewerData::clear() +{ + V = Eigen::MatrixXd (0,3); + F = Eigen::MatrixXi (0,3); + + F_material_ambient = Eigen::MatrixXd (0,4); + F_material_diffuse = Eigen::MatrixXd (0,4); + F_material_specular = Eigen::MatrixXd (0,4); + + V_material_ambient = Eigen::MatrixXd (0,4); + V_material_diffuse = Eigen::MatrixXd (0,4); + V_material_specular = Eigen::MatrixXd (0,4); + + F_normals = Eigen::MatrixXd (0,3); + V_normals = Eigen::MatrixXd (0,3); + + V_uv = Eigen::MatrixXd (0,2); + F_uv = Eigen::MatrixXi (0,3); + + lines = Eigen::MatrixXd (0,9); + points = Eigen::MatrixXd (0,6); + + vertex_labels_positions = Eigen::MatrixXd (0,3); + face_labels_positions = Eigen::MatrixXd (0,3); + labels_positions = Eigen::MatrixXd (0,3); + vertex_labels_strings.clear(); + face_labels_strings.clear(); + labels_strings.clear(); + + face_based = false; + double_sided = false; + invert_normals = false; + show_texture = false; + use_matcap = false; +} + +IGL_INLINE void igl::opengl::ViewerData::compute_normals() +{ + if(V.cols() == 2) + { + F_normals = Eigen::RowVector3d(0,0,1).replicate(F.rows(),1); + V_normals = Eigen::RowVector3d(0,0,1).replicate(V.rows(),1); + }else + { + assert(V.cols() == 3); + igl::per_face_normals(V, F, F_normals); + igl::per_vertex_normals(V, F, F_normals, V_normals); + } + dirty |= MeshGL::DIRTY_NORMAL; +} + +IGL_INLINE void igl::opengl::ViewerData::uniform_colors( + const Eigen::Vector3d& ambient, + const Eigen::Vector3d& diffuse, + const Eigen::Vector3d& specular) +{ + Eigen::Vector4d ambient4; + Eigen::Vector4d diffuse4; + Eigen::Vector4d specular4; + + ambient4 << ambient, 1; + diffuse4 << diffuse, 1; + specular4 << specular, 1; + + uniform_colors(ambient4,diffuse4,specular4); +} + +IGL_INLINE void igl::opengl::ViewerData::uniform_colors( + const Eigen::Vector4d& ambient, + const Eigen::Vector4d& diffuse, + const Eigen::Vector4d& specular) +{ + V_material_ambient.resize(V.rows(),4); + V_material_diffuse.resize(V.rows(),4); + V_material_specular.resize(V.rows(),4); + + for (unsigned i=0; i=size2 && j>=size2)) + texture_R(i,j) = 255; + } + } + + texture_G = texture_R; + texture_B = texture_R; + texture_A = Eigen::Matrix::Constant(texture_R.rows(),texture_R.cols(),255); + dirty |= MeshGL::DIRTY_TEXTURE; +} + +// Populate VBOs of a particular label stype (Vert, Face, Custom) +IGL_INLINE void igl::opengl::ViewerData::update_labels( + igl::opengl::MeshGL& meshgl, + igl::opengl::MeshGL::TextGL& GL_labels, + const Eigen::MatrixXd& positions, + const std::vector& strings +){ + if (positions.rows()>0) + { + int numCharsToRender = 0; + for(size_t p=0; p(); + GL_labels.label_char_vbo(idx) = (float)(label.at(c)); + GL_labels.label_offset_vbo(idx) = c; + GL_labels.label_indices_vbo(idx) = idx; + idx++; + } + } + } +} + +IGL_INLINE void igl::opengl::ViewerData::updateGL( + const igl::opengl::ViewerData& data, + const bool invert_normals, + igl::opengl::MeshGL& meshgl + ) +{ + if (!meshgl.is_initialized) + { + meshgl.init(); + } + + bool per_corner_uv = (data.F_uv.rows() == data.F.rows()); + bool per_corner_normals = (data.F_normals.rows() == 3 * data.F.rows()); + + meshgl.dirty |= data.dirty; + + // Input: + // X #F by dim quantity + // Output: + // X_vbo #F*3 by dim scattering per corner + const auto per_face = [&data]( + const Eigen::MatrixXd & X, + MeshGL::RowMatrixXf & X_vbo) + { + assert(X.cols() == 4); + X_vbo.resize(data.F.rows()*3,4); + for (unsigned i=0; i(); + }; + + // Input: + // X #V by dim quantity + // Output: + // X_vbo #F*3 by dim scattering per corner + const auto per_corner = [&data]( + const Eigen::MatrixXd & X, + MeshGL::RowMatrixXf & X_vbo) + { + X_vbo.resize(data.F.rows()*3,X.cols()); + for (unsigned i=0; i(); + }; + + if (!data.face_based) + { + if (!(per_corner_uv || per_corner_normals)) + { + // Vertex positions + if (meshgl.dirty & MeshGL::DIRTY_POSITION) + meshgl.V_vbo = data.V.cast(); + + // Vertex normals + if (meshgl.dirty & MeshGL::DIRTY_NORMAL) + { + meshgl.V_normals_vbo = data.V_normals.cast(); + if (invert_normals) + meshgl.V_normals_vbo = -meshgl.V_normals_vbo; + } + + // Per-vertex material settings + if (meshgl.dirty & MeshGL::DIRTY_AMBIENT) + meshgl.V_ambient_vbo = data.V_material_ambient.cast(); + if (meshgl.dirty & MeshGL::DIRTY_DIFFUSE) + meshgl.V_diffuse_vbo = data.V_material_diffuse.cast(); + if (meshgl.dirty & MeshGL::DIRTY_SPECULAR) + meshgl.V_specular_vbo = data.V_material_specular.cast(); + + // Face indices + if (meshgl.dirty & MeshGL::DIRTY_FACE) + meshgl.F_vbo = data.F.cast(); + + // Texture coordinates + if (meshgl.dirty & MeshGL::DIRTY_UV) + { + meshgl.V_uv_vbo = data.V_uv.cast(); + } + } + else + { + + // Per vertex properties with per corner UVs + if (meshgl.dirty & MeshGL::DIRTY_POSITION) + { + per_corner(data.V,meshgl.V_vbo); + } + + if (meshgl.dirty & MeshGL::DIRTY_AMBIENT) + { + meshgl.V_ambient_vbo.resize(data.F.rows()*3,4); + per_corner(data.V_material_ambient,meshgl.V_ambient_vbo); + } + if (meshgl.dirty & MeshGL::DIRTY_DIFFUSE) + { + meshgl.V_diffuse_vbo.resize(data.F.rows()*3,4); + per_corner(data.V_material_diffuse,meshgl.V_diffuse_vbo); + } + if (meshgl.dirty & MeshGL::DIRTY_SPECULAR) + { + meshgl.V_specular_vbo.resize(data.F.rows()*3,4); + per_corner(data.V_material_specular,meshgl.V_specular_vbo); + } + + if (meshgl.dirty & MeshGL::DIRTY_NORMAL) + { + meshgl.V_normals_vbo.resize(data.F.rows()*3,3); + per_corner(data.V_normals,meshgl.V_normals_vbo); + + if (invert_normals) + meshgl.V_normals_vbo = -meshgl.V_normals_vbo; + } + + if (meshgl.dirty & MeshGL::DIRTY_FACE) + { + meshgl.F_vbo.resize(data.F.rows(),3); + for (unsigned i=0; i0) + { + meshgl.V_uv_vbo.resize(data.F.rows()*3,2); + for (unsigned i=0; i(); + } + } + } else + { + if (meshgl.dirty & MeshGL::DIRTY_POSITION) + { + per_corner(data.V,meshgl.V_vbo); + } + if (meshgl.dirty & MeshGL::DIRTY_AMBIENT) + { + per_face(data.F_material_ambient,meshgl.V_ambient_vbo); + } + if (meshgl.dirty & MeshGL::DIRTY_DIFFUSE) + { + per_face(data.F_material_diffuse,meshgl.V_diffuse_vbo); + } + if (meshgl.dirty & MeshGL::DIRTY_SPECULAR) + { + per_face(data.F_material_specular,meshgl.V_specular_vbo); + } + + if (meshgl.dirty & MeshGL::DIRTY_NORMAL) + { + meshgl.V_normals_vbo.resize(data.F.rows()*3,3); + for (unsigned i=0; i() : + data.F_normals.row(i).cast(); + + if (invert_normals) + meshgl.V_normals_vbo = -meshgl.V_normals_vbo; + } + + if (meshgl.dirty & MeshGL::DIRTY_FACE) + { + meshgl.F_vbo.resize(data.F.rows(),3); + for (unsigned i=0; i0) + { + meshgl.V_uv_vbo.resize(data.F.rows()*3,2); + for (unsigned i=0; i(); + } + } + + if (meshgl.dirty & MeshGL::DIRTY_TEXTURE) + { + meshgl.tex_u = data.texture_R.rows(); + meshgl.tex_v = data.texture_R.cols(); + meshgl.tex.resize(data.texture_R.size()*4); + for (unsigned i=0;i(i, 0).cast(); + meshgl.lines_V_vbo.row(2*i+1) = data.lines.block<1, 3>(i, 3).cast(); + meshgl.lines_V_colors_vbo.row(2*i+0) = data.lines.block<1, 3>(i, 6).cast(); + meshgl.lines_V_colors_vbo.row(2*i+1) = data.lines.block<1, 3>(i, 6).cast(); + meshgl.lines_F_vbo(2*i+0) = 2*i+0; + meshgl.lines_F_vbo(2*i+1) = 2*i+1; + } + } + + if (meshgl.dirty & MeshGL::DIRTY_OVERLAY_POINTS) + { + meshgl.points_V_vbo.resize(data.points.rows(),3); + meshgl.points_V_colors_vbo.resize(data.points.rows(),3); + meshgl.points_F_vbo.resize(data.points.rows(),1); + for (unsigned i=0; i(i, 0).cast(); + meshgl.points_V_colors_vbo.row(i) = data.points.block<1, 3>(i, 3).cast(); + meshgl.points_F_vbo(i) = i; + } + } + + if (meshgl.dirty & MeshGL::DIRTY_FACE_LABELS) + { + if(face_labels_positions.rows()==0) + { + face_labels_positions.conservativeResize(F.rows(), 3); + Eigen::MatrixXd faceNormals = F_normals.normalized(); + for (int f=0; f +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_VIEWERDATA_H +#define IGL_VIEWERDATA_H + +#include "MeshGL.h" +#include +#include +#include +#include +#include +#include +#include + +// Alec: This is a mesh class containing a variety of data types (normals, +// overlays, material colors, etc.) +// +// WARNING: Eigen data members (such as Eigen::Vector4f) should explicitly +// disable alignment (e.g. use `Eigen::Matrix`), +// in order to avoid alignment issues further down the line (esp. if the +// structure are stored in a std::vector). +// +// See this thread for a more detailed discussion: +// https://github.com/libigl/libigl/pull/1029 +// +namespace igl +{ + +// TODO: write documentation +namespace opengl +{ + +// Forward declaration +class ViewerCore; + +class ViewerData +{ +public: + ViewerData(); + + // Empty all fields + IGL_INLINE void clear(); + + // Change the visualization mode, invalidating the cache if necessary + IGL_INLINE void set_face_based(bool newvalue); + + // Helpers that can draw the most common meshes + IGL_INLINE void set_mesh(const Eigen::MatrixXd& V, const Eigen::MatrixXi& F); + IGL_INLINE void set_vertices(const Eigen::MatrixXd& V); + IGL_INLINE void set_normals(const Eigen::MatrixXd& N); + + IGL_INLINE void set_visible(bool value, unsigned int core_id = 1); + + // Set the color of the mesh + // + // Inputs: + // C #V|#F|1 by 3 list of colors + IGL_INLINE void set_colors(const Eigen::MatrixXd &C); + + // Set per-vertex UV coordinates + // + // Inputs: + // UV #V by 2 list of UV coordinates (indexed by F) + IGL_INLINE void set_uv(const Eigen::MatrixXd& UV); + + // Set per-corner UV coordinates + // + // Inputs: + // UV_V #UV by 2 list of UV coordinates + // UV_F #F by 3 list of UV indices into UV_V + IGL_INLINE void set_uv(const Eigen::MatrixXd& UV_V, const Eigen::MatrixXi& UV_F); + + // Set the texture associated with the mesh. + // + // Inputs: + // R width by height image matrix of red channel + // G width by height image matrix of green channel + // B width by height image matrix of blue channel + // + IGL_INLINE void set_texture( + const Eigen::Matrix& R, + const Eigen::Matrix& G, + const Eigen::Matrix& B); + + // Set the texture associated with the mesh. + // + // Inputs: + // R width by height image matrix of red channel + // G width by height image matrix of green channel + // B width by height image matrix of blue channel + // A width by height image matrix of alpha channel + // + IGL_INLINE void set_texture( + const Eigen::Matrix& R, + const Eigen::Matrix& G, + const Eigen::Matrix& B, + const Eigen::Matrix& A); + + // Set pseudo-colorable scalar data associated with the mesh. + // + // Inputs: + // caxis_min caxis minimum bound + // caxis_max caxis maximum bound + // D #V by 1 list of scalar values + // cmap colormap type + // num_steps number of intervals to discretize the colormap + // + // To-do: support #F by 1 per-face data + IGL_INLINE void set_data( + const Eigen::VectorXd & D, + double caxis_min, + double caxis_max, + igl::ColorMapType cmap = igl::COLOR_MAP_TYPE_VIRIDIS, + int num_steps = 21); + + // Use min(D) and max(D) to set caxis. + IGL_INLINE void set_data(const Eigen::VectorXd & D, + igl::ColorMapType cmap = igl::COLOR_MAP_TYPE_VIRIDIS, + int num_steps = 21); + + // Not to be confused with set_colors, this creates a _texture_ that will be + // referenced to pseudocolor according to the scalar field passed to set_data. + // + // Inputs: + // CM #CM by 3 list of colors + IGL_INLINE void set_colormap(const Eigen::MatrixXd & CM); + + // Sets points given a list of point vertices. In constrast to `add_points` + // this will (purposefully) clober existing points. + // + // Inputs: + // P #P by 3 list of vertex positions + // C #P|1 by 3 color(s) + IGL_INLINE void set_points( + const Eigen::MatrixXd& P, + const Eigen::MatrixXd& C); + IGL_INLINE void add_points(const Eigen::MatrixXd& P, const Eigen::MatrixXd& C); + + // Clear the point data + IGL_INLINE void clear_points(); + + // Sets edges given a list of edge vertices and edge indices. In constrast + // to `add_edges` this will (purposefully) clober existing edges. + // + // Inputs: + // P #P by 3 list of vertex positions + // E #E by 2 list of edge indices into P + // C #E|1 by 3 color(s) + + IGL_INLINE void set_edges (const Eigen::MatrixXd& P, const Eigen::MatrixXi& E, const Eigen::MatrixXd& C); + // Alec: This is very confusing. Why does add_edges have a different API from + // set_edges? + IGL_INLINE void add_edges (const Eigen::MatrixXd& P1, const Eigen::MatrixXd& P2, const Eigen::MatrixXd& C); + // Sets edges given a list of points and eminating vectors + IGL_INLINE void set_edges_from_vector_field( + const Eigen::MatrixXd& P, + const Eigen::MatrixXd& V, + const Eigen::MatrixXd& C); + + // Clear the edge data + IGL_INLINE void clear_edges(); + + // Sets / Adds text labels at the given positions in 3D. + // Note: This requires the ImGui viewer plugin to display text labels. + IGL_INLINE void add_label (const Eigen::VectorXd& P, const std::string& str); + IGL_INLINE void set_labels (const Eigen::MatrixXd& P, const std::vector& str); + + // Clear the label data + IGL_INLINE void clear_labels (); + + // Computes the normals of the mesh + IGL_INLINE void compute_normals(); + + // Assigns uniform colors to all faces/vertices + IGL_INLINE void uniform_colors( + const Eigen::Vector3d& diffuse, + const Eigen::Vector3d& ambient, + const Eigen::Vector3d& specular); + + // Assigns uniform colors to all faces/vertices + IGL_INLINE void uniform_colors( + const Eigen::Vector4d& ambient, + const Eigen::Vector4d& diffuse, + const Eigen::Vector4d& specular); + + // Generate a normal image matcap + IGL_INLINE void normal_matcap(); + + // Generates a default grid texture (without uvs) + IGL_INLINE void grid_texture(); + + // Copy visualization options from one viewport to another + IGL_INLINE void copy_options(const ViewerCore &from, const ViewerCore &to); + + Eigen::MatrixXd V; // Vertices of the current mesh (#V x 3) + Eigen::MatrixXi F; // Faces of the mesh (#F x 3) + + // Per face attributes + Eigen::MatrixXd F_normals; // One normal per face + + Eigen::MatrixXd F_material_ambient; // Per face ambient color + Eigen::MatrixXd F_material_diffuse; // Per face diffuse color + Eigen::MatrixXd F_material_specular; // Per face specular color + + // Per vertex attributes + Eigen::MatrixXd V_normals; // One normal per vertex + + Eigen::MatrixXd V_material_ambient; // Per vertex ambient color + Eigen::MatrixXd V_material_diffuse; // Per vertex diffuse color + Eigen::MatrixXd V_material_specular; // Per vertex specular color + + // UV parametrization + Eigen::MatrixXd V_uv; // UV vertices + Eigen::MatrixXi F_uv; // optional faces for UVs + + // Texture + Eigen::Matrix texture_R; + Eigen::Matrix texture_G; + Eigen::Matrix texture_B; + Eigen::Matrix texture_A; + + // Overlays + + // Lines plotted over the scene + // (Every row contains 9 doubles in the following format S_x, S_y, S_z, T_x, T_y, T_z, C_r, C_g, C_b), + // with S and T the coordinates of the two vertices of the line in global coordinates, and C the color in floating point rgb format + Eigen::MatrixXd lines; + + // Points plotted over the scene + // (Every row contains 6 doubles in the following format P_x, P_y, P_z, C_r, C_g, C_b), + // with P the position in global coordinates of the center of the point, and C the color in floating point rgb format + Eigen::MatrixXd points; + + // Text labels plotted over the scene + // Textp contains, in the i-th row, the position in global coordinates where the i-th label should be anchored + // Texts contains in the i-th position the text of the i-th label + Eigen::MatrixXd vertex_labels_positions; + Eigen::MatrixXd face_labels_positions; + Eigen::MatrixXd labels_positions; + std::vector vertex_labels_strings; + std::vector face_labels_strings; + std::vector labels_strings; + + // Marks dirty buffers that need to be uploaded to OpenGL + uint32_t dirty; + + // Enable per-face or per-vertex properties + bool face_based; + + // Enable double-sided lighting on faces + bool double_sided; + + // Invert mesh normals + bool invert_normals; + + // Visualization options + // Each option is a binary mask specifying on which viewport each option is set. + // When using a single viewport, standard boolean can still be used for simplicity. + unsigned int is_visible; + unsigned int show_overlay; + unsigned int show_overlay_depth; + unsigned int show_texture; + unsigned int use_matcap; + unsigned int show_faces; + unsigned int show_lines; + unsigned int show_vertex_labels; + unsigned int show_face_labels; + unsigned int show_custom_labels; + + // Point size / line width + float point_size; + // line_width is NOT SUPPORTED on Mac OS and Windows + float line_width; + float label_size; + Eigen::Matrix line_color; + Eigen::Matrix label_color; + + // Shape material + float shininess; + + // Unique identifier + int id; + + // OpenGL representation of the mesh + igl::opengl::MeshGL meshgl; + + // Update contents from a 'Data' instance + IGL_INLINE void update_labels( + igl::opengl::MeshGL& meshgl, + igl::opengl::MeshGL::TextGL& GL_labels, + const Eigen::MatrixXd& positions, + const std::vector& strings + ); + IGL_INLINE void updateGL( + const igl::opengl::ViewerData& data, + const bool invert_normals, + igl::opengl::MeshGL& meshgl); + }; + +} // namespace opengl +} // namespace igl + +//////////////////////////////////////////////////////////////////////////////// + +#include +namespace igl +{ + namespace serialization + { + inline void serialization(bool s, igl::opengl::ViewerData& obj, std::vector& buffer) + { + SERIALIZE_MEMBER(V); + SERIALIZE_MEMBER(F); + SERIALIZE_MEMBER(F_normals); + SERIALIZE_MEMBER(F_material_ambient); + SERIALIZE_MEMBER(F_material_diffuse); + SERIALIZE_MEMBER(F_material_specular); + SERIALIZE_MEMBER(V_normals); + SERIALIZE_MEMBER(V_material_ambient); + SERIALIZE_MEMBER(V_material_diffuse); + SERIALIZE_MEMBER(V_material_specular); + SERIALIZE_MEMBER(V_uv); + SERIALIZE_MEMBER(F_uv); + SERIALIZE_MEMBER(texture_R); + SERIALIZE_MEMBER(texture_G); + SERIALIZE_MEMBER(texture_B); + SERIALIZE_MEMBER(texture_A); + SERIALIZE_MEMBER(lines); + SERIALIZE_MEMBER(points); + SERIALIZE_MEMBER(labels_positions); + SERIALIZE_MEMBER(labels_strings); + SERIALIZE_MEMBER(dirty); + SERIALIZE_MEMBER(face_based); + SERIALIZE_MEMBER(show_faces); + SERIALIZE_MEMBER(show_lines); + SERIALIZE_MEMBER(invert_normals); + SERIALIZE_MEMBER(show_overlay); + SERIALIZE_MEMBER(show_overlay_depth); + SERIALIZE_MEMBER(show_vertex_labels); + SERIALIZE_MEMBER(show_face_labels); + SERIALIZE_MEMBER(show_custom_labels); + SERIALIZE_MEMBER(show_texture); + SERIALIZE_MEMBER(double_sided); + SERIALIZE_MEMBER(point_size); + SERIALIZE_MEMBER(line_width); + SERIALIZE_MEMBER(line_color); + SERIALIZE_MEMBER(shininess); + SERIALIZE_MEMBER(id); + } + template<> + inline void serialize(const igl::opengl::ViewerData& obj, std::vector& buffer) + { + serialization(true, const_cast(obj), buffer); + } + template<> + inline void deserialize(igl::opengl::ViewerData& obj, const std::vector& buffer) + { + serialization(false, obj, const_cast&>(buffer)); + obj.dirty = igl::opengl::MeshGL::DIRTY_ALL; + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "ViewerData.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/bind_vertex_attrib_array.cpp b/vendor/libigl/include/igl/opengl/bind_vertex_attrib_array.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4aa807c18da70e220877d2184b9012488b2a075a --- /dev/null +++ b/vendor/libigl/include/igl/opengl/bind_vertex_attrib_array.cpp @@ -0,0 +1,24 @@ +#include "bind_vertex_attrib_array.h" + +IGL_INLINE GLint igl::opengl::bind_vertex_attrib_array( + const GLuint program_shader, + const std::string &name, + GLuint bufferID, + const Eigen::Matrix &M, + bool refresh) +{ + GLint id = glGetAttribLocation(program_shader, name.c_str()); + if (id < 0) + return id; + if (M.size() == 0) + { + glDisableVertexAttribArray(id); + return id; + } + glBindBuffer(GL_ARRAY_BUFFER, bufferID); + if (refresh) + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*M.size(), M.data(), GL_DYNAMIC_DRAW); + glVertexAttribPointer(id, M.cols(), GL_FLOAT, GL_FALSE, 0, 0); + glEnableVertexAttribArray(id); + return id; +} diff --git a/vendor/libigl/include/igl/opengl/bind_vertex_attrib_array.h b/vendor/libigl/include/igl/opengl/bind_vertex_attrib_array.h new file mode 100644 index 0000000000000000000000000000000000000000..4e94431369b3cc5b5c54d4a49eb21b96b9852edd --- /dev/null +++ b/vendor/libigl/include/igl/opengl/bind_vertex_attrib_array.h @@ -0,0 +1,32 @@ +#ifndef IGL_OPENGL_BIND_VERTEX_ATTRIB_ARRAY_H +#define IGL_OPENGL_BIND_VERTEX_ATTRIB_ARRAY_H +#include "gl.h" +#include "../igl_inline.h" +#include +#include +namespace igl +{ + namespace opengl + { + // Bind a per-vertex array attribute and refresh its contents from an Eigen + // matrix + // + // Inputs: + // program_shader id of shader program + // name name of attribute in vertex shader + // bufferID id of buffer to bind to + // M #V by dim matrix of per-vertex data + // refresh whether to actually call glBufferData or just bind the buffer + // Returns id of named attribute in shader + IGL_INLINE GLint bind_vertex_attrib_array( + const GLuint program_shader, + const std::string &name, + GLuint bufferID, + const Eigen::Matrix &M, + bool refresh); + } +} +#ifndef IGL_STATIC_LIBRARY +#include "bind_vertex_attrib_array.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/opengl/create_index_vbo.cpp b/vendor/libigl/include/igl/opengl/create_index_vbo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..76f6248c0a71acdce9e45f34969ad67d9ef5d634 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/create_index_vbo.cpp @@ -0,0 +1,46 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "create_index_vbo.h" + +// http://www.songho.ca/opengl/gl_vbo.html#create +IGL_INLINE void igl::opengl::create_index_vbo( + const Eigen::MatrixXi & F, + GLuint & F_vbo_id) +{ + // Generate Buffers + glGenBuffers(1,&F_vbo_id); + // Bind Buffers + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,F_vbo_id); + // Copy data to buffers + // We expect a matrix with each vertex position on a row, we then want to + // pass this data to OpenGL reading across rows (row-major) + if(F.Options & Eigen::RowMajor) + { + glBufferData( + GL_ELEMENT_ARRAY_BUFFER, + sizeof(int)*F.size(), + F.data(), + GL_STATIC_DRAW); + }else + { + // Create temporary copy of transpose + Eigen::MatrixXi FT = F.transpose(); + // If its column major then we need to temporarily store a transpose + glBufferData( + GL_ELEMENT_ARRAY_BUFFER, + sizeof(int)*F.size(), + FT.data(), + GL_STATIC_DRAW); + } + // bind with 0, so, switch back to normal pointer operation + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/opengl/create_index_vbo.h b/vendor/libigl/include/igl/opengl/create_index_vbo.h new file mode 100644 index 0000000000000000000000000000000000000000..e48f3a489032ce7add22b18fa257efc84f64862c --- /dev/null +++ b/vendor/libigl/include/igl/opengl/create_index_vbo.h @@ -0,0 +1,35 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_CREATE_INDEX_VBO_H +#define IGL_OPENGL_CREATE_INDEX_VBO_H +#include "../igl_inline.h" +#include "gl.h" +#include + +// Create a VBO (Vertex Buffer Object) for a list of indices: +// GL_ELEMENT_ARRAY_BUFFER_ARB for the triangle indices (F) +namespace igl +{ + namespace opengl + { + // Inputs: + // F #F by 3 eigen Matrix of face (triangle) indices + // Outputs: + // F_vbo_id buffer id for face indices + // + IGL_INLINE void create_index_vbo( + const Eigen::MatrixXi & F, + GLuint & F_vbo_id); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "create_index_vbo.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/create_mesh_vbo.cpp b/vendor/libigl/include/igl/opengl/create_mesh_vbo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3876e1dfaa1ba4d1f8c68c08d8b90d4cc46242e4 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/create_mesh_vbo.cpp @@ -0,0 +1,43 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "create_mesh_vbo.h" + +#include "create_vector_vbo.h" +#include "create_index_vbo.h" + +// http://www.songho.ca/opengl/gl_vbo.html#create +IGL_INLINE void igl::opengl::create_mesh_vbo( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + GLuint & V_vbo_id, + GLuint & F_vbo_id) +{ + // Create VBO for vertex position vectors + create_vector_vbo(V,V_vbo_id); + // Create VBO for face index lists + create_index_vbo(F,F_vbo_id); +} + +// http://www.songho.ca/opengl/gl_vbo.html#create +IGL_INLINE void igl::opengl::create_mesh_vbo( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXd & N, + GLuint & V_vbo_id, + GLuint & F_vbo_id, + GLuint & N_vbo_id) +{ + // Create VBOs for faces and vertices + create_mesh_vbo(V,F,V_vbo_id,F_vbo_id); + // Create VBO for normal vectors + create_vector_vbo(N,N_vbo_id); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/opengl/create_mesh_vbo.h b/vendor/libigl/include/igl/opengl/create_mesh_vbo.h new file mode 100644 index 0000000000000000000000000000000000000000..ecb303b0906eb270f341dbefd4e38f0e3fa2b774 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/create_mesh_vbo.h @@ -0,0 +1,61 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_CREATE_MESH_VBO_H +#define IGL_OPENGL_CREATE_MESH_VBO_H +#include "../igl_inline.h" +#include "gl.h" +#include + +// Create a VBO (Vertex Buffer Object) for a mesh. Actually two VBOs: one +// GL_ARRAY_BUFFER for the vertex positions (V) and one +// GL_ELEMENT_ARRAY_BUFFER for the triangle indices (F) +namespace igl +{ + namespace opengl + { + + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (triangle) indices + // Outputs: + // V_vbo_id buffer id for vertex positions + // F_vbo_id buffer id for face indices + // + // NOTE: when using glDrawElements VBOs for V and F using MatrixXd and + // MatrixXi will have types GL_DOUBLE and GL_UNSIGNED_INT respectively + // + IGL_INLINE void create_mesh_vbo( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + GLuint & V_vbo_id, + GLuint & F_vbo_id); + + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (triangle) indices + // N #V by 3 eigen Matrix of mesh vertex 3D normals + // Outputs: + // V_vbo_id buffer id for vertex positions + // F_vbo_id buffer id for face indices + // N_vbo_id buffer id for vertex positions + IGL_INLINE void create_mesh_vbo( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const Eigen::MatrixXd & N, + GLuint & V_vbo_id, + GLuint & F_vbo_id, + GLuint & N_vbo_id); + } + +} + +#ifndef IGL_STATIC_LIBRARY +# include "create_mesh_vbo.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/create_shader_program.cpp b/vendor/libigl/include/igl/opengl/create_shader_program.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6c4b31a2f7a11780caeacb79fc739b0a688f651e --- /dev/null +++ b/vendor/libigl/include/igl/opengl/create_shader_program.cpp @@ -0,0 +1,141 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "create_shader_program.h" + +#include "load_shader.h" +#include "print_program_info_log.h" +#include +#include + +IGL_INLINE bool igl::opengl::create_shader_program( + const std::string & geom_source, + const std::string & vert_source, + const std::string & frag_source, + const std::map & attrib, + GLuint & id) +{ + using namespace std; + if(vert_source == "" && frag_source == "") + { + cerr<< + "create_shader_program() could not create shader program," + " both .vert and .frag source given were empty"<::const_iterator ait = attrib.begin(); + ait != attrib.end(); + ait++) + { + glBindAttribLocation( + id, + (*ait).second, + (*ait).first.c_str()); + } + // Link program + glLinkProgram(id); + const auto & detach = [&id](const GLuint shader) + { + if(shader) + { + glDetachShader(id,shader); + glDeleteShader(shader); + } + }; + detach(g); + detach(f); + detach(v); + + // print log if any + igl::opengl::print_program_info_log(id); + + return true; +} + +IGL_INLINE bool igl::opengl::create_shader_program( + const std::string & vert_source, + const std::string & frag_source, + const std::map & attrib, + GLuint & prog_id) +{ + return create_shader_program("",vert_source,frag_source,attrib,prog_id); +} + + +IGL_INLINE GLuint igl::opengl::create_shader_program( + const std::string & geom_source, + const std::string & vert_source, + const std::string & frag_source, + const std::map & attrib) +{ + GLuint prog_id = 0; + create_shader_program(geom_source,vert_source,frag_source,attrib,prog_id); + return prog_id; +} + +IGL_INLINE GLuint igl::opengl::create_shader_program( + const std::string & vert_source, + const std::string & frag_source, + const std::map & attrib) +{ + GLuint prog_id = 0; + create_shader_program(vert_source,frag_source,attrib,prog_id); + return prog_id; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif + diff --git a/vendor/libigl/include/igl/opengl/create_shader_program.h b/vendor/libigl/include/igl/opengl/create_shader_program.h new file mode 100644 index 0000000000000000000000000000000000000000..5dfdc701dc7751f6592ea16120fffc199f387657 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/create_shader_program.h @@ -0,0 +1,64 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_CREATE_SHADER_PROGRAM_H +#define IGL_OPENGL_CREATE_SHADER_PROGRAM_H +#include "../igl_inline.h" +#include "gl.h" +#include +#include + +namespace igl +{ + namespace opengl + { + // Create a shader program with a vertex and fragments shader loading from + // source strings and vertex attributes assigned from a map before linking the + // shaders to the program, making it ready to use with glUseProgram(id) + // Inputs: + // geom_source string containing source code of geometry shader (can be + // "" to mean use default pass-through) + // vert_source string containing source code of vertex shader + // frag_source string containing source code of fragment shader + // attrib map containing table of vertex attribute strings add their + // correspondingly ids (generated previously using glBindAttribLocation) + // Outputs: + // id index id of created shader, set to 0 on error + // Returns true on success, false on error + // + // Note: Caller is responsible for making sure that current value of id is not + // leaking a shader (since it will be overwritten) + // + // See also: destroy_shader_program + IGL_INLINE bool create_shader_program( + const std::string &geom_source, + const std::string &vert_source, + const std::string &frag_source, + const std::map &attrib, + GLuint & id); + IGL_INLINE bool create_shader_program( + const std::string &vert_source, + const std::string &frag_source, + const std::map &attrib, + GLuint & id); + IGL_INLINE GLuint create_shader_program( + const std::string & geom_source, + const std::string & vert_source, + const std::string & frag_source, + const std::map &attrib); + IGL_INLINE GLuint create_shader_program( + const std::string & vert_source, + const std::string & frag_source, + const std::map &attrib); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "create_shader_program.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/create_vector_vbo.cpp b/vendor/libigl/include/igl/opengl/create_vector_vbo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8690359b7430150b4b4079806f19fdd2f8a679c0 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/create_vector_vbo.cpp @@ -0,0 +1,57 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "create_vector_vbo.h" + +#include + +// http://www.songho.ca/opengl/gl_vbo.html#create +template +IGL_INLINE void igl::opengl::create_vector_vbo( + const Eigen::Matrix & V, + GLuint & V_vbo_id) +{ + //// Expects that input is list of 3D vectors along rows + //assert(V.cols() == 3); + + // Generate Buffers + glGenBuffers(1,&V_vbo_id); + // Bind Buffers + glBindBuffer(GL_ARRAY_BUFFER,V_vbo_id); + // Copy data to buffers + // We expect a matrix with each vertex position on a row, we then want to + // pass this data to OpenGL reading across rows (row-major) + if(V.Options & Eigen::RowMajor) + { + glBufferData( + GL_ARRAY_BUFFER, + sizeof(T)*V.size(), + V.data(), + GL_STATIC_DRAW); + }else + { + // Create temporary copy of transpose + Eigen::Matrix VT = V.transpose(); + // If its column major then we need to temporarily store a transpose + glBufferData( + GL_ARRAY_BUFFER, + sizeof(T)*V.size(), + VT.data(), + GL_STATIC_DRAW); + } + // bind with 0, so, switch back to normal pointer operation + glBindBuffer(GL_ARRAY_BUFFER, 0); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::opengl::create_vector_vbo(Eigen::Matrix const&, unsigned int&); +// generated by autoexplicit.sh +template void igl::opengl::create_vector_vbo(Eigen::Matrix const&, unsigned int&); +#endif + diff --git a/vendor/libigl/include/igl/opengl/create_vector_vbo.h b/vendor/libigl/include/igl/opengl/create_vector_vbo.h new file mode 100644 index 0000000000000000000000000000000000000000..757c1a1999874d56263e97d9f79768b0a1878717 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/create_vector_vbo.h @@ -0,0 +1,38 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_CREATE_VECTOR_VBO_H +#define IGL_OPENGL_CREATE_VECTOR_VBO_H +#include "../igl_inline.h" +#include "gl.h" +#include + +// Create a VBO (Vertex Buffer Object) for a list of vectors: +// GL_ARRAY_BUFFER for the vectors (V) +namespace igl +{ + namespace opengl + { + // Templates: + // T should be a eigen matrix primitive type like int or double + // Inputs: + // V m by n eigen Matrix of type T values + // Outputs: + // V_vbo_id buffer id for vectors + // + template + IGL_INLINE void create_vector_vbo( + const Eigen::Matrix & V, + GLuint & V_vbo_id); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "create_vector_vbo.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/destroy_shader_program.cpp b/vendor/libigl/include/igl/opengl/destroy_shader_program.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ceace7c22c6fe218f4c956747cba86d4da890de --- /dev/null +++ b/vendor/libigl/include/igl/opengl/destroy_shader_program.cpp @@ -0,0 +1,50 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "destroy_shader_program.h" +#include "report_gl_error.h" +#include + +IGL_INLINE bool igl::opengl::destroy_shader_program(const GLuint id) +{ + // Don't try to destroy id == 0 (no shader program) + if(id == 0) + { + fprintf(stderr,"Error: destroy_shader_program() id = %d" + " but must should be positive\n",id); + return false; + } + // Get each attached shader one by one and detach and delete it + GLsizei count; + // shader id + GLuint s; + do + { + // Try to get at most *1* attached shader + glGetAttachedShaders(id,1,&count,&s); + GLenum err = igl::opengl::report_gl_error(); + if (GL_NO_ERROR != err) + { + return false; + } + // Check that we actually got *1* + if(count == 1) + { + // Detach and delete this shader + glDetachShader(id,s); + glDeleteShader(s); + } + }while(count > 0); + // Now that all of the shaders are gone we can just delete the program + glDeleteProgram(id); + return true; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif + diff --git a/vendor/libigl/include/igl/opengl/destroy_shader_program.h b/vendor/libigl/include/igl/opengl/destroy_shader_program.h new file mode 100644 index 0000000000000000000000000000000000000000..5d53d8c3e4527a74e37e9596d1744c3e38d96841 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/destroy_shader_program.h @@ -0,0 +1,35 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_DESTROY_SHADER_PROGRAM_H +#define IGL_OPENGL_DESTROY_SHADER_PROGRAM_H +#include "../igl_inline.h" +#include "gl.h" + +namespace igl +{ + namespace opengl + { + // Properly destroy a shader program. Detach and delete each of its shaders + // and delete it + // Inputs: + // id index id of created shader, set to 0 on error + // Returns true on success, false on error + // + // Note: caller is responsible for making sure he doesn't foolishly continue + // to use id as if it still contains a program + // + // See also: create_shader_program + IGL_INLINE bool destroy_shader_program(const GLuint id); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "destroy_shader_program.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/gl.h b/vendor/libigl/include/igl/opengl/gl.h new file mode 100644 index 0000000000000000000000000000000000000000..fc037c198b66cfc21d2a1240cc157987a638ca61 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/gl.h @@ -0,0 +1,25 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013, 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GL_H +#define IGL_OPENGL_GL_H + +#ifdef IGL_OPENGL2_GL_H +# error "igl/opengl2/gl.h already included" +#endif + +// Always use this: +// #include "gl.h" +// Instead of: +// #include +// or +// #include +// + +#include + +#endif diff --git a/vendor/libigl/include/igl/opengl/gl_type_size.cpp b/vendor/libigl/include/igl/opengl/gl_type_size.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0fd02bf057b6eb915c1dc5e62702588863dfc0bd --- /dev/null +++ b/vendor/libigl/include/igl/opengl/gl_type_size.cpp @@ -0,0 +1,30 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "gl_type_size.h" +#include + +IGL_INLINE int igl::opengl::gl_type_size(const GLenum type) +{ + switch(type) + { + case GL_DOUBLE: + return 8; + break; + case GL_FLOAT: + return 4; + break; + case GL_INT: + return 4; + break; + default: + // should handle all other GL_[types] + assert(false && "Implementation incomplete."); + break; + } + return -1; +} diff --git a/vendor/libigl/include/igl/opengl/gl_type_size.h b/vendor/libigl/include/igl/opengl/gl_type_size.h new file mode 100644 index 0000000000000000000000000000000000000000..a741195491112a96143efe46cd6d41c8cd632616 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/gl_type_size.h @@ -0,0 +1,28 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GL_TYPE_SIZE_H +#define IGL_OPENGL_GL_TYPE_SIZE_H +#include "../igl_inline.h" +#include "gl.h" + +namespace igl +{ + namespace opengl + { + // Return the number of bytes for a given OpenGL type // Inputs: + // type enum value of opengl type + // Returns size in bytes of type + IGL_INLINE int gl_type_size(const GLenum type); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "gl_type_size.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/glfw/Viewer.cpp b/vendor/libigl/include/igl/opengl/glfw/Viewer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..04e22366b32b61dd7e438b08fde94127164a6a06 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/Viewer.cpp @@ -0,0 +1,1138 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "Viewer.h" + +#include +#include + +#include + +#include "../gl.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Internal global variables used for glfw event handling +static igl::opengl::glfw::Viewer * __viewer; +static double highdpi = 1; +static double scroll_x = 0; +static double scroll_y = 0; + +static void glfw_mouse_press(GLFWwindow* window, int button, int action, int modifier) +{ + + igl::opengl::glfw::Viewer::MouseButton mb; + + if (button == GLFW_MOUSE_BUTTON_1) + mb = igl::opengl::glfw::Viewer::MouseButton::Left; + else if (button == GLFW_MOUSE_BUTTON_2) + mb = igl::opengl::glfw::Viewer::MouseButton::Right; + else //if (button == GLFW_MOUSE_BUTTON_3) + mb = igl::opengl::glfw::Viewer::MouseButton::Middle; + + if (action == GLFW_PRESS) + __viewer->mouse_down(mb,modifier); + else + __viewer->mouse_up(mb,modifier); +} + +static void glfw_error_callback(int error, const char* description) +{ + fputs(description, stderr); +} + +static void glfw_char_mods_callback(GLFWwindow* window, unsigned int codepoint, int modifier) +{ + __viewer->key_pressed(codepoint, modifier); +} + +static void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int modifier) +{ + if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) + glfwSetWindowShouldClose(window, GL_TRUE); + + if (action == GLFW_PRESS) + __viewer->key_down(key, modifier); + else if(action == GLFW_RELEASE) + __viewer->key_up(key, modifier); +} + +static void glfw_window_size(GLFWwindow* window, int width, int height) +{ + int w = width*highdpi; + int h = height*highdpi; + + __viewer->post_resize(w, h); + +} + +static void glfw_mouse_move(GLFWwindow* window, double x, double y) +{ + __viewer->mouse_move(x*highdpi, y*highdpi); +} + +static void glfw_mouse_scroll(GLFWwindow* window, double x, double y) +{ + using namespace std; + scroll_x += x; + scroll_y += y; + + __viewer->mouse_scroll(y); +} + +static void glfw_drop_callback(GLFWwindow *window,int count,const char **filenames) +{ +} + +namespace igl +{ +namespace opengl +{ +namespace glfw +{ + + IGL_INLINE int Viewer::launch(bool resizable /*= true*/, bool fullscreen /*= false*/, + const std::string &name, int windowWidth /*= 0*/, int windowHeight /*= 0*/) + { + // TODO return values are being ignored... + launch_init(resizable,fullscreen,name,windowWidth,windowHeight); + launch_rendering(true); + launch_shut(); + return EXIT_SUCCESS; + } + + IGL_INLINE int Viewer::launch_init(bool resizable, bool fullscreen, + const std::string &name, int windowWidth, int windowHeight) + { + glfwSetErrorCallback(glfw_error_callback); + if (!glfwInit()) + { + return EXIT_FAILURE; + } + glfwWindowHint(GLFW_SAMPLES, 8); + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); + #ifdef __APPLE__ + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); + #endif + if(fullscreen) + { + GLFWmonitor *monitor = glfwGetPrimaryMonitor(); + const GLFWvidmode *mode = glfwGetVideoMode(monitor); + window = glfwCreateWindow(mode->width,mode->height,name.c_str(),monitor,nullptr); + windowWidth = mode->width; + windowHeight = mode->height; + } + else + { + // Set default windows width + if (windowWidth <= 0 && core_list.size() == 1 && core().viewport[2] > 0) + windowWidth = core().viewport[2]; + else if (windowWidth <= 0) + windowWidth = 1280; + // Set default windows height + if (windowHeight <= 0 && core_list.size() == 1 && core().viewport[3] > 0) + windowHeight = core().viewport[3]; + else if (windowHeight <= 0) + windowHeight = 800; + window = glfwCreateWindow(windowWidth,windowHeight,name.c_str(),nullptr,nullptr); + } + if (!window) + { + glfwTerminate(); + return EXIT_FAILURE; + } + glfwMakeContextCurrent(window); + // Load OpenGL and its extensions + if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress)) + { + printf("Failed to load OpenGL and its extensions\n"); + return(-1); + } + #if defined(DEBUG) || defined(_DEBUG) + printf("OpenGL Version %d.%d loaded\n", GLVersion.major, GLVersion.minor); + int major, minor, rev; + major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR); + minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR); + rev = glfwGetWindowAttrib(window, GLFW_CONTEXT_REVISION); + printf("OpenGL version received: %d.%d.%d\n", major, minor, rev); + printf("Supported OpenGL is %s\n", (const char*)glGetString(GL_VERSION)); + printf("Supported GLSL is %s\n", (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION)); + #endif + glfwSetInputMode(window,GLFW_CURSOR,GLFW_CURSOR_NORMAL); + // Initialize FormScreen + __viewer = this; + // Register callbacks + glfwSetKeyCallback(window, glfw_key_callback); + glfwSetCursorPosCallback(window,glfw_mouse_move); + glfwSetWindowSizeCallback(window,glfw_window_size); + glfwSetMouseButtonCallback(window,glfw_mouse_press); + glfwSetScrollCallback(window,glfw_mouse_scroll); + glfwSetCharModsCallback(window,glfw_char_mods_callback); + glfwSetDropCallback(window,glfw_drop_callback); + // Handle retina displays (windows and mac) + int width, height; + glfwGetFramebufferSize(window, &width, &height); + int width_window, height_window; + glfwGetWindowSize(window, &width_window, &height_window); + highdpi = windowWidth/width_window; + glfw_window_size(window,width_window,height_window); + // Initialize IGL viewer + init(); + for(auto &core : this->core_list) + { + for(auto &data : this->data_list) + { + if(data.is_visible & core.id) + { + this->core(core.id).align_camera_center(data.V, data.F); + } + } + } + return EXIT_SUCCESS; + } + + IGL_INLINE bool Viewer::launch_rendering(bool loop) + { + // glfwMakeContextCurrent(window); + // Rendering loop + const int num_extra_frames = 5; + int frame_counter = 0; + while (!glfwWindowShouldClose(window)) + { + double tic = get_seconds(); + draw(); + glfwSwapBuffers(window); + if(core().is_animating || frame_counter++ < num_extra_frames) + { + glfwPollEvents(); + // In microseconds + double duration = 1000000.*(get_seconds()-tic); + const double min_duration = 1000000./core().animation_max_fps; + if(durationinit(this); + } + } + + IGL_INLINE void Viewer::shutdown_plugins() + { + for (unsigned int i = 0; ishutdown(); + } + } + + IGL_INLINE Viewer::Viewer(): + data_list(1), + selected_data_index(0), + next_data_id(1), + selected_core_index(0), + next_core_id(2) + { + window = nullptr; + data_list.front().id = 0; + + core_list.emplace_back(ViewerCore()); + core_list.front().id = 1; + + // Temporary variables initialization + down = false; + hack_never_moved = true; + scroll_position = 0.0f; + + // Per face + data().set_face_based(false); + + // C-style callbacks + callback_init = nullptr; + callback_pre_draw = nullptr; + callback_post_draw = nullptr; + callback_mouse_down = nullptr; + callback_mouse_up = nullptr; + callback_mouse_move = nullptr; + callback_mouse_scroll = nullptr; + callback_key_down = nullptr; + callback_key_up = nullptr; + + callback_init_data = nullptr; + callback_pre_draw_data = nullptr; + callback_post_draw_data = nullptr; + callback_mouse_down_data = nullptr; + callback_mouse_up_data = nullptr; + callback_mouse_move_data = nullptr; + callback_mouse_scroll_data = nullptr; + callback_key_down_data = nullptr; + callback_key_up_data = nullptr; + +#ifndef IGL_VIEWER_VIEWER_QUIET + const std::string usage(R"(igl::opengl::glfw::Viewer usage: + [drag] Rotate scene + A,a Toggle animation (tight draw loop) + D,d Toggle double sided lighting + F,f Toggle face based + I,i Toggle invert normals + L,l Toggle wireframe + O,o Toggle orthographic/perspective projection + T,t Toggle filled faces + Z Snap to canonical view + [,] Toggle between rotation control types (trackball, two-axis + valuator with fixed up, 2D mode with no rotation)) + <,> Toggle between models + ; Toggle vertex labels + : Toggle face labels)" +); + std::cout<load(mesh_file_name_string)) + { + return true; + } + } + + // Create new data slot and set to selected + if(!(data().F.rows() == 0 && data().V.rows() == 0)) + { + append_mesh(); + } + data().clear(); + + size_t last_dot = mesh_file_name_string.rfind('.'); + if (last_dot == std::string::npos) + { + std::cerr<<"Error: No file extension found in "<< + mesh_file_name_string<post_load()) + return true; + + return true; + } + + IGL_INLINE bool Viewer::save_mesh_to_file( + const std::string & mesh_file_name_string) + { + // first try to load it with a plugin + for (unsigned int i = 0; isave(mesh_file_name_string)) + return true; + + size_t last_dot = mesh_file_name_string.rfind('.'); + if (last_dot == std::string::npos) + { + // No file type determined + std::cerr<<"Error: No file extension found in "<< + mesh_file_name_string<key_pressed(unicode_key, modifiers)) + { + return true; + } + } + + if (callback_key_pressed) + if (callback_key_pressed(*this,unicode_key,modifiers)) + return true; + + switch(unicode_key) + { + case 'A': + case 'a': + { + core().is_animating = !core().is_animating; + return true; + } + case 'D': + case 'd': + { + data().double_sided = !data().double_sided; + return true; + } + case 'F': + case 'f': + { + data().set_face_based(!data().face_based); + return true; + } + case 'I': + case 'i': + { + data().dirty |= MeshGL::DIRTY_NORMAL; + data().invert_normals = !data().invert_normals; + return true; + } + case 'L': + case 'l': + { + core().toggle(data().show_lines); + return true; + } + case 'O': + case 'o': + { + core().orthographic = !core().orthographic; + return true; + } + case 'T': + case 't': + { + core().toggle(data().show_faces); + return true; + } + case 'Z': + { + snap_to_canonical_quaternion(); + return true; + } + case '[': + case ']': + { + if(core().rotation_type == ViewerCore::ROTATION_TYPE_TRACKBALL) + core().set_rotation_type(ViewerCore::ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP); + else + core().set_rotation_type(ViewerCore::ROTATION_TYPE_TRACKBALL); + + return true; + } + case '<': + case '>': + { + selected_data_index = + (selected_data_index + data_list.size() + (unicode_key=='>'?1:-1))%data_list.size(); + return true; + } + case '{': + case '}': + { + selected_core_index = + (selected_core_index + core_list.size() + (unicode_key=='}'?1:-1))%core_list.size(); + return true; + } + case ';': + data().show_vertex_labels = !data().show_vertex_labels; + return true; + case ':': + data().show_face_labels = !data().show_face_labels; + return true; + default: break;//do nothing + } + return false; + } + + IGL_INLINE bool Viewer::key_down(int key,int modifiers) + { + for (unsigned int i = 0; ikey_down(key, modifiers)) + return true; + + if (callback_key_down) + if (callback_key_down(*this,key,modifiers)) + return true; + + return false; + } + + IGL_INLINE bool Viewer::key_up(int key,int modifiers) + { + for (unsigned int i = 0; ikey_up(key, modifiers)) + return true; + + if (callback_key_up) + if (callback_key_up(*this,key,modifiers)) + return true; + + return false; + } + + IGL_INLINE void Viewer::select_hovered_core() + { + int width_window, height_window; + glfwGetFramebufferSize(window, &width_window, &height_window); + for (int i = 0; i < core_list.size(); i++) + { + Eigen::Vector4f viewport = core_list[i].viewport; + + if ((current_mouse_x > viewport[0]) && + (current_mouse_x < viewport[0] + viewport[2]) && + ((height_window - current_mouse_y) > viewport[1]) && + ((height_window - current_mouse_y) < viewport[1] + viewport[3])) + { + selected_core_index = i; + break; + } + } + } + + IGL_INLINE bool Viewer::mouse_down(MouseButton button,int modifier) + { + // Remember mouse location at down even if used by callback/plugin + down_mouse_x = current_mouse_x; + down_mouse_y = current_mouse_y; + + for (unsigned int i = 0; imouse_down(static_cast(button),modifier)) + return true; + + if (callback_mouse_down) + if (callback_mouse_down(*this,static_cast(button),modifier)) + return true; + + down = true; + + // Select the core containing the click location. + select_hovered_core(); + + down_translation = core().camera_translation; + + + // Initialization code for the trackball + Eigen::RowVector3d center = Eigen::RowVector3d(0,0,0); + if(data().V.rows() > 0) + { + // be careful that V may be 2D + center.head(data().V.cols()) = data().V.colwise().sum()/data().V.rows(); + } + + Eigen::Vector3f coord = + igl::project( + Eigen::Vector3f(center(0),center(1),center(2)), + core().view, + core().proj, + core().viewport); + down_mouse_z = coord[2]; + down_rotation = core().trackball_angle; + + mouse_mode = MouseMode::Rotation; + + switch (button) + { + case MouseButton::Left: + if (core().rotation_type == ViewerCore::ROTATION_TYPE_NO_ROTATION) { + mouse_mode = MouseMode::Translation; + } else { + mouse_mode = MouseMode::Rotation; + } + break; + + case MouseButton::Right: + mouse_mode = MouseMode::Translation; + break; + + default: + mouse_mode = MouseMode::None; + break; + } + + return true; + } + + IGL_INLINE bool Viewer::mouse_up(MouseButton button,int modifier) + { + down = false; + + for (unsigned int i = 0; imouse_up(static_cast(button),modifier)) + return true; + + if (callback_mouse_up) + if (callback_mouse_up(*this,static_cast(button),modifier)) + return true; + + mouse_mode = MouseMode::None; + + return true; + } + + IGL_INLINE bool Viewer::mouse_move(int mouse_x,int mouse_y) + { + if(hack_never_moved) + { + down_mouse_x = mouse_x; + down_mouse_y = mouse_y; + hack_never_moved = false; + } + current_mouse_x = mouse_x; + current_mouse_y = mouse_y; + + for (unsigned int i = 0; imouse_move(mouse_x, mouse_y)) + return true; + + if (callback_mouse_move) + if (callback_mouse_move(*this, mouse_x, mouse_y)) + return true; + + + if (down) + { + // We need the window height to transform the mouse click coordinates into viewport-mouse-click coordinates + // for igl::trackball and igl::two_axis_valuator_fixed_up + int width_window, height_window; + glfwGetFramebufferSize(window, &width_window, &height_window); + switch (mouse_mode) + { + case MouseMode::Rotation: + { + switch(core().rotation_type) + { + default: + assert(false && "Unknown rotation type"); + case ViewerCore::ROTATION_TYPE_NO_ROTATION: + break; + case ViewerCore::ROTATION_TYPE_TRACKBALL: + igl::trackball( + core().viewport(2), + core().viewport(3), + 2.0f, + down_rotation, + down_mouse_x - core().viewport(0), + down_mouse_y - (height_window - core().viewport(1) - core().viewport(3)), + mouse_x - core().viewport(0), + mouse_y - (height_window - core().viewport(1) - core().viewport(3)), + core().trackball_angle); + break; + case ViewerCore::ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP: + igl::two_axis_valuator_fixed_up( + core().viewport(2),core().viewport(3), + 2.0, + down_rotation, + down_mouse_x - core().viewport(0), + down_mouse_y - (height_window - core().viewport(1) - core().viewport(3)), + mouse_x - core().viewport(0), + mouse_y - (height_window - core().viewport(1) - core().viewport(3)), + core().trackball_angle); + break; + } + //Eigen::Vector4f snapq = core().trackball_angle; + + break; + } + + case MouseMode::Translation: + { + //translation + Eigen::Vector3f pos1 = igl::unproject(Eigen::Vector3f(mouse_x, core().viewport[3] - mouse_y, down_mouse_z), core().view, core().proj, core().viewport); + Eigen::Vector3f pos0 = igl::unproject(Eigen::Vector3f(down_mouse_x, core().viewport[3] - down_mouse_y, down_mouse_z), core().view, core().proj, core().viewport); + + Eigen::Vector3f diff = pos1 - pos0; + core().camera_translation = down_translation + Eigen::Vector3f(diff[0],diff[1],diff[2]); + + break; + } + case MouseMode::Zoom: + { + float delta = 0.001f * (mouse_x - down_mouse_x + mouse_y - down_mouse_y); + core().camera_zoom *= 1 + delta; + down_mouse_x = mouse_x; + down_mouse_y = mouse_y; + break; + } + + default: + break; + } + } + return true; + } + + IGL_INLINE bool Viewer::mouse_scroll(float delta_y) + { + // Direct the scrolling operation to the appropriate viewport + // (unless the core selection is locked by an ongoing mouse interaction). + if (!down) + select_hovered_core(); + scroll_position += delta_y; + + for (unsigned int i = 0; imouse_scroll(delta_y)) + return true; + + if (callback_mouse_scroll) + if (callback_mouse_scroll(*this,delta_y)) + return true; + + // Only zoom if there's actually a change + if(delta_y != 0) + { + float mult = (1.0+((delta_y>0)?1.:-1.)*0.05); + const float min_zoom = 0.1f; + core().camera_zoom = (core().camera_zoom * mult > min_zoom ? core().camera_zoom * mult : min_zoom); + } + return true; + } + + IGL_INLINE bool Viewer::load_scene() + { + std::string fname = igl::file_dialog_open(); + if(fname.length() == 0) + return false; + return load_scene(fname); + } + + IGL_INLINE bool Viewer::load_scene(std::string fname) + { + igl::deserialize(core(),"Core",fname.c_str()); + igl::deserialize(data(),"Data",fname.c_str()); + return true; + } + + IGL_INLINE bool Viewer::save_scene() + { + std::string fname = igl::file_dialog_save(); + if (fname.length() == 0) + return false; + return save_scene(fname); + } + + IGL_INLINE bool Viewer::save_scene(std::string fname) + { + igl::serialize(core(),"Core",fname.c_str(),true); + igl::serialize(data(),"Data",fname.c_str()); + + return true; + } + + IGL_INLINE void Viewer::draw() + { + using namespace std; + using namespace Eigen; + + int width, height; + glfwGetFramebufferSize(window, &width, &height); + + int width_window, height_window; + glfwGetWindowSize(window, &width_window, &height_window); + + auto highdpi_tmp = (width_window == 0 || width == 0) ? highdpi : (width/width_window); + + if(fabs(highdpi_tmp-highdpi)>1e-8) + { + post_resize(width, height); + highdpi=highdpi_tmp; + } + + for (auto& core : core_list) + { + core.clear_framebuffers(); + } + + for (unsigned int i = 0; ipre_draw()) + { + return; + } + } + if (callback_pre_draw) + { + if (callback_pre_draw(*this)) + { + return; + } + } + + for (auto& core : core_list) + { + for (auto& mesh : data_list) + { + if (mesh.is_visible & core.id) + { + core.draw(mesh); + } + } + } + for (unsigned int i = 0; ipost_draw()) + { + break; + } + } + if (callback_post_draw) + { + if (callback_post_draw(*this)) + { + return; + } + } + } + + IGL_INLINE void Viewer::resize(int w,int h) + { + if (window) { + glfwSetWindowSize(window, w/highdpi, h/highdpi); + } + post_resize(w, h); + } + + IGL_INLINE void Viewer::post_resize(int w,int h) + { + if (core_list.size() == 1) + { + core().viewport = Eigen::Vector4f(0,0,w,h); + } + else + { + // It is up to the user to define the behavior of the post_resize() function + // when there are multiple viewports (through the `callback_post_resize` callback) + } + for (unsigned int i = 0; ipost_resize(w, h); + } + if (callback_post_resize) + { + callback_post_resize(*this, w, h); + } + } + + IGL_INLINE void Viewer::snap_to_canonical_quaternion() + { + Eigen::Quaternionf snapq = this->core().trackball_angle; + igl::snap_to_canonical_view_quat(snapq,1.0f,this->core().trackball_angle); + } + + IGL_INLINE void Viewer::open_dialog_load_mesh() + { + std::string fname = igl::file_dialog_open(); + + if (fname.length() == 0) + return; + + this->load_mesh_from_file(fname.c_str()); + } + + IGL_INLINE void Viewer::open_dialog_save_mesh() + { + std::string fname = igl::file_dialog_save(); + + if(fname.length() == 0) + return; + + this->save_mesh_to_file(fname.c_str()); + } + + IGL_INLINE ViewerData& Viewer::data(int mesh_id /*= -1*/) + { + assert(!data_list.empty() && "data_list should never be empty"); + int index; + if (mesh_id == -1) + index = selected_data_index; + else + index = mesh_index(mesh_id); + + assert((index >= 0 && index < data_list.size()) && + "selected_data_index or mesh_id should be in bounds"); + return data_list[index]; + } + + IGL_INLINE const ViewerData& Viewer::data(int mesh_id /*= -1*/) const + { + assert(!data_list.empty() && "data_list should never be empty"); + int index; + if (mesh_id == -1) + index = selected_data_index; + else + index = mesh_index(mesh_id); + + assert((index >= 0 && index < data_list.size()) && + "selected_data_index or mesh_id should be in bounds"); + return data_list[index]; + } + + IGL_INLINE int Viewer::append_mesh(bool visible /*= true*/) + { + assert(data_list.size() >= 1); + + data_list.emplace_back(); + selected_data_index = data_list.size()-1; + data_list.back().id = next_data_id++; + if (visible) + for (int i = 0; i < core_list.size(); i++) + data_list.back().set_visible(true, core_list[i].id); + else + data_list.back().is_visible = 0; + return data_list.back().id; + } + + IGL_INLINE bool Viewer::erase_mesh(const size_t index) + { + assert((index >= 0 && index < data_list.size()) && "index should be in bounds"); + assert(data_list.size() >= 1); + if(data_list.size() == 1) + { + // Cannot remove last mesh + return false; + } + data_list[index].meshgl.free(); + data_list.erase(data_list.begin() + index); + if(selected_data_index >= index && selected_data_index > 0) + { + selected_data_index--; + } + + return true; + } + + IGL_INLINE size_t Viewer::mesh_index(const int id) const { + for (size_t i = 0; i < data_list.size(); ++i) + { + if (data_list[i].id == id) + return i; + } + return 0; + } + + IGL_INLINE ViewerCore& Viewer::core(unsigned core_id /*= 0*/) + { + assert(!core_list.empty() && "core_list should never be empty"); + int core_index; + if (core_id == 0) + core_index = selected_core_index; + else + core_index = this->core_index(core_id); + assert((core_index >= 0 && core_index < core_list.size()) && "selected_core_index should be in bounds"); + return core_list[core_index]; + } + + IGL_INLINE const ViewerCore& Viewer::core(unsigned core_id /*= 0*/) const + { + assert(!core_list.empty() && "core_list should never be empty"); + int core_index; + if (core_id == 0) + core_index = selected_core_index; + else + core_index = this->core_index(core_id); + assert((core_index >= 0 && core_index < core_list.size()) && "selected_core_index should be in bounds"); + return core_list[core_index]; + } + + IGL_INLINE bool Viewer::erase_core(const size_t index) + { + assert((index >= 0 && index < core_list.size()) && "index should be in bounds"); + assert(data_list.size() >= 1); + if (core_list.size() == 1) + { + // Cannot remove last viewport + return false; + } + core_list[index].shut(); // does nothing + core_list.erase(core_list.begin() + index); + if (selected_core_index >= index && selected_core_index > 0) + { + selected_core_index--; + } + return true; + } + + IGL_INLINE size_t Viewer::core_index(const int id) const { + for (size_t i = 0; i < core_list.size(); ++i) + { + if (core_list[i].id == id) + return i; + } + return 0; + } + + IGL_INLINE int Viewer::append_core(Eigen::Vector4f viewport, bool append_empty /*= false*/) + { + core_list.push_back(core()); // copies the previous active core and only changes the viewport + core_list.back().viewport = viewport; + core_list.back().id = next_core_id; + next_core_id <<= 1; + if (!append_empty) + { + for (auto &data : data_list) + { + data.set_visible(true, core_list.back().id); + data.copy_options(core(), core_list.back()); + } + } + selected_core_index = core_list.size()-1; + return core_list.back().id; + } + +} // end namespace +} // end namespace +} diff --git a/vendor/libigl/include/igl/opengl/glfw/Viewer.h b/vendor/libigl/include/igl/opengl/glfw/Viewer.h new file mode 100644 index 0000000000000000000000000000000000000000..046684c5b8e476e24bf0dc6544ea6a53ca042eca --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/Viewer.h @@ -0,0 +1,237 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GLFW_VIEWER_H +#define IGL_OPENGL_GLFW_VIEWER_H + +#ifndef IGL_OPENGL_4 +#define IGL_OPENGL_4 +#endif + +#include "../../igl_inline.h" +#include "../MeshGL.h" +#include "../ViewerCore.h" +#include "../ViewerData.h" +#include "ViewerPlugin.h" + +#include +#include + +#include +#include +#include + +#define IGL_MOD_SHIFT 0x0001 +#define IGL_MOD_CONTROL 0x0002 +#define IGL_MOD_ALT 0x0004 +#define IGL_MOD_SUPER 0x0008 + +struct GLFWwindow; + +namespace igl +{ +namespace opengl +{ +namespace glfw +{ + // GLFW-based mesh viewer + class Viewer + { + public: + // UI Enumerations + enum class MouseButton {Left, Middle, Right}; + enum class MouseMode { None, Rotation, Zoom, Pan, Translation} mouse_mode; + IGL_INLINE int launch(bool resizable = true, bool fullscreen = false, const std::string &name = "libigl viewer", int width = 0, int height = 0); + IGL_INLINE int launch_init(bool resizable = true, bool fullscreen = false, const std::string &name = "libigl viewer", int width = 0, int height = 0); + IGL_INLINE bool launch_rendering(bool loop = true); + IGL_INLINE void launch_shut(); + IGL_INLINE void init(); + IGL_INLINE void init_plugins(); + IGL_INLINE void shutdown_plugins(); + Viewer(); + ~Viewer(); + // Mesh IO + IGL_INLINE bool load_mesh_from_file(const std::string & mesh_file_name); + IGL_INLINE bool save_mesh_to_file(const std::string & mesh_file_name); + // Callbacks + IGL_INLINE bool key_pressed(unsigned int unicode_key,int modifier); + IGL_INLINE bool key_down(int key,int modifier); + IGL_INLINE bool key_up(int key,int modifier); + IGL_INLINE bool mouse_down(MouseButton button,int modifier); + IGL_INLINE bool mouse_up(MouseButton button,int modifier); + IGL_INLINE bool mouse_move(int mouse_x,int mouse_y); + IGL_INLINE bool mouse_scroll(float delta_y); + // Scene IO + IGL_INLINE bool load_scene(); + IGL_INLINE bool load_scene(std::string fname); + IGL_INLINE bool save_scene(); + IGL_INLINE bool save_scene(std::string fname); + // Draw everything + IGL_INLINE void draw(); + // OpenGL context resize + IGL_INLINE void resize(int w,int h); // explicitly set window size + IGL_INLINE void post_resize(int w,int h); // external resize due to user interaction + // Helper functions + IGL_INLINE void snap_to_canonical_quaternion(); + IGL_INLINE void open_dialog_load_mesh(); + IGL_INLINE void open_dialog_save_mesh(); + + //////////////////////// + // Multi-mesh methods // + //////////////////////// + + // Return the current mesh, or the mesh corresponding to a given unique identifier + // + // Inputs: + // mesh_id unique identifier associated to the desired mesh (current mesh if -1) + IGL_INLINE ViewerData& data(int mesh_id = -1); + IGL_INLINE const ViewerData& data(int mesh_id = -1) const; + + // Append a new "slot" for a mesh (i.e., create empty entries at the end of + // the data_list and opengl_state_list. + // + // Inputs: + // visible If true, the new mesh is set to be visible on all existing viewports + // Returns the id of the last appended mesh + // + // Side Effects: + // selected_data_index is set this newly created, last entry (i.e., + // #meshes-1) + IGL_INLINE int append_mesh(bool visible = true); + + // Erase a mesh (i.e., its corresponding data and state entires in data_list + // and opengl_state_list) + // + // Inputs: + // index index of mesh to erase + // Returns whether erasure was successful <=> cannot erase last mesh + // + // Side Effects: + // If selected_data_index is greater than or equal to index then it is + // decremented + // Example: + // // Erase all mesh slots except first and clear remaining mesh + // viewer.selected_data_index = viewer.data_list.size()-1; + // while(viewer.erase_mesh(viewer.selected_data_index)){}; + // viewer.data().clear(); + // + IGL_INLINE bool erase_mesh(const size_t index); + + // Retrieve mesh index from its unique identifier + // Returns 0 if not found + IGL_INLINE size_t mesh_index(const int id) const; + + //////////////////////////// + // Multi-viewport methods // + //////////////////////////// + + // Return the current viewport, or the viewport corresponding to a given unique identifier + // + // Inputs: + // core_id unique identifier corresponding to the desired viewport (current viewport if 0) + IGL_INLINE ViewerCore& core(unsigned core_id = 0); + IGL_INLINE const ViewerCore& core(unsigned core_id = 0) const; + + // Append a new "slot" for a viewport (i.e., copy properties of the current viewport, only + // changing the viewport size/position) + // + // Inputs: + // viewport Vector specifying the viewport origin and size in screen coordinates. + // append_empty If true, existing meshes are hidden on the new viewport. + // + // Returns the unique id of the newly inserted viewport. There can be a maximum of 31 + // viewports created in the same viewport. Erasing a viewport does not change the id of + // other existing viewports + IGL_INLINE int append_core(Eigen::Vector4f viewport, bool append_empty = false); + + // Erase a viewport + // + // Inputs: + // index index of the viewport to erase + IGL_INLINE bool erase_core(const size_t index); + + // Retrieve viewport index from its unique identifier + // Returns 0 if not found + IGL_INLINE size_t core_index(const int id) const; + + // Change selected_core_index to the viewport containing the mouse + // (current_mouse_x, current_mouse_y) + IGL_INLINE void select_hovered_core(); + +public: + ////////////////////// + // Member variables // + ////////////////////// + + // Alec: I call this data_list instead of just data to avoid confusion with + // old "data" variable. + // Stores all the data that should be visualized + std::vector data_list; + + size_t selected_data_index; + int next_data_id; + GLFWwindow* window; + + // Stores all the viewing options + std::vector core_list; + size_t selected_core_index; + int next_core_id; + + // List of registered plugins + std::vector plugins; + // Temporary data stored when the mouse button is pressed + Eigen::Quaternionf down_rotation; + int current_mouse_x; + int current_mouse_y; + int down_mouse_x; + int down_mouse_y; + float down_mouse_z; + Eigen::Vector3f down_translation; + bool down; + bool hack_never_moved; + // Keep track of the global position of the scrollwheel + float scroll_position; + // C++-style functions + // + // Returns **true** if action should be cancelled. + std::function callback_init; + std::function callback_pre_draw; + std::function callback_post_draw; + std::function callback_mouse_down; + std::function callback_mouse_up; + std::function callback_mouse_move; + std::function callback_mouse_scroll; + std::function callback_key_pressed; + std::function callback_post_resize; + // THESE SHOULD BE DEPRECATED: + std::function callback_key_down; + std::function callback_key_up; + // Pointers to per-callback data + void* callback_init_data; + void* callback_pre_draw_data; + void* callback_post_draw_data; + void* callback_mouse_down_data; + void* callback_mouse_up_data; + void* callback_mouse_move_data; + void* callback_mouse_scroll_data; + void* callback_key_pressed_data; + void* callback_key_down_data; + void* callback_key_up_data; + + public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + }; + +} // end namespace +} // end namespace +} // end namespace + +#ifndef IGL_STATIC_LIBRARY +# include "Viewer.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/glfw/ViewerPlugin.h b/vendor/libigl/include/igl/opengl/glfw/ViewerPlugin.h new file mode 100644 index 0000000000000000000000000000000000000000..f85e160601dbfcc0d9f67dab387d5734776f7908 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/ViewerPlugin.h @@ -0,0 +1,102 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GLFW_VIEWERPLUGIN_H +#define IGL_OPENGL_GLFW_VIEWERPLUGIN_H + +// TODO: +// * create plugins/skeleton.h +// * pass time in draw function +// * remove Preview3D from comments +// * clean comments +#include +#include +#include + +namespace igl +{ + namespace opengl + { + namespace glfw + { + + // Abstract class for plugins + // All plugins MUST have this class as their parent and may implement any/all + // the callbacks marked `virtual` here. + // + // Return value of callbacks: returning true to any of the callbacks tells + // Viewer that the event has been handled and that it should not be passed to + // other plugins or to other internal functions of Viewer + + // Forward declaration of the viewer + class Viewer; + + class ViewerPlugin + { + public: + IGL_INLINE ViewerPlugin() {plugin_name = "dummy";} + virtual ~ViewerPlugin(){} + // This function is called when the viewer is initialized (no mesh will be loaded at this stage) + IGL_INLINE virtual void init(Viewer *_viewer) { viewer = _viewer; } + // This function is called before shutdown + IGL_INLINE virtual void shutdown() { } + // This function is called before a mesh is loaded + IGL_INLINE virtual bool load(std::string filename) { return false; } + // This function is called before a mesh is saved + IGL_INLINE virtual bool save(std::string filename) { return false; } + // This function is called when the scene is serialized + IGL_INLINE virtual bool serialize(std::vector& buffer) const + { return false; } + // This function is called when the scene is deserialized + IGL_INLINE virtual bool deserialize(const std::vector& buffer) + { return false; } + // Runs immediately after a new mesh has been loaded. + IGL_INLINE virtual bool post_load() { return false; } + // This function is called before the draw procedure of Viewer + IGL_INLINE virtual bool pre_draw() { return false; } + // This function is called after the draw procedure of Viewer + IGL_INLINE virtual bool post_draw() { return false; } + // This function is called after the window has been resized + IGL_INLINE virtual void post_resize(int w, int h) { } + IGL_INLINE virtual bool mouse_down(int button, int modifier) + { return false; } + IGL_INLINE virtual bool mouse_up(int button, int modifier) + { return false; } + IGL_INLINE virtual bool mouse_move(int mouse_x, int mouse_y) + { return false; } + IGL_INLINE virtual bool mouse_scroll(float delta_y) + { return false; } + IGL_INLINE virtual bool key_pressed(unsigned int key, int modifiers) + { return false; } + IGL_INLINE virtual bool key_down(int key, int modifiers) + { return false; } + IGL_INLINE virtual bool key_up(int key, int modifiers) + { return false; } + std::string plugin_name; + protected: + // Pointer to the main Viewer class + Viewer *viewer; + }; + + namespace serialization + { + inline void serialize(const ViewerPlugin& obj,std::vector& buffer) + { + obj.serialize(buffer); + } + + inline void deserialize(ViewerPlugin& obj,const std::vector& buffer) + { + obj.deserialize(buffer); + } + } + + } + } +} + +#endif diff --git a/vendor/libigl/include/igl/opengl/glfw/background_window.cpp b/vendor/libigl/include/igl/opengl/glfw/background_window.cpp new file mode 100644 index 0000000000000000000000000000000000000000..964202cc2952b6d3cb7ab9f3deafa5eb04d15afa --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/background_window.cpp @@ -0,0 +1,30 @@ +#include "background_window.h" + +#include + +IGL_INLINE bool igl::opengl::glfw::background_window(GLFWwindow* & window) +{ + if(!glfwInit()) return false; + glfwSetErrorCallback([](int id,const char* m){std::cerr< + +namespace igl +{ + namespace opengl + { + namespace glfw + { + // Create a background window with a valid core profile opengl context + // set to current. + // + // After you're finished with this window you may call + // `glfwDestroyWindow(window)` + // + // After you're finished with glfw you should call `glfwTerminate()` + // + // Outputs: + // window pointer to glfw window + // Returns true iff success + IGL_INLINE bool background_window(GLFWwindow* & window); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "background_window.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiHelpers.h b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiHelpers.h new file mode 100644 index 0000000000000000000000000000000000000000..f35f097ee5ea89b471dfa215c197f69a6ac710ac --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiHelpers.h @@ -0,0 +1,115 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Jérémie Dumas +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GLFW_IMGUI_IMGUIHELPERS_H +#define IGL_OPENGL_GLFW_IMGUI_IMGUIHELPERS_H + +//////////////////////////////////////////////////////////////////////////////// +#include "ImGuiTraits.h" +#include +#include +#include +#include +#include +#include +//////////////////////////////////////////////////////////////////////////////// + +// Extend ImGui by populating its namespace directly +// +// Code snippets taken from there: +// https://eliasdaler.github.io/using-imgui-with-sfml-pt2/ +namespace ImGui +{ + +static auto vector_getter = [](void* vec, int idx, const char** out_text) +{ + auto& vector = *static_cast*>(vec); + if (idx < 0 || idx >= static_cast(vector.size())) { return false; } + *out_text = vector.at(idx).c_str(); + return true; +}; + +inline bool Combo(const char* label, int* idx, std::vector& values) +{ + if (values.empty()) { return false; } + return Combo(label, idx, vector_getter, + static_cast(&values), values.size()); +} + +inline bool Combo(const char* label, int* idx, std::function getter, int items_count) +{ + auto func = [](void* data, int i, const char** out_text) { + auto &getter = *reinterpret_cast *>(data); + const char *s = getter(i); + if (s) { *out_text = s; return true; } + else { return false; } + }; + return Combo(label, idx, func, reinterpret_cast(&getter), items_count); +} + +inline bool ListBox(const char* label, int* idx, std::vector& values) +{ + if (values.empty()) { return false; } + return ListBox(label, idx, vector_getter, + static_cast(&values), values.size()); +} + +inline bool InputText(const char* label, std::string &str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL) +{ + char buf[1024]; + std::fill_n(buf, 1024, 0); + std::copy_n(str.begin(), std::min(1024, (int) str.size()), buf); + if (ImGui::InputText(label, buf, 1024, flags, callback, user_data)) + { + str = std::string(buf); + return true; + } + return false; +} + +// template +// inline bool DragScalar(const char *label, T* value, void* v, float v_speed, const void* v_min = NULL, const void* v_max = NULL, const char* format = NULL, float power = 1.0f) +// { +// const char *fmt = format; +// if (format == nullptr) { +// fmt = ImGuiDataTypeTraits::format; +// } +// return DragScalar(label, ImGuiDataTypeTraits::value, value, &min, &max, fmt); +// } + +// template +// inline bool InputScalar(const char *label, T* value, T min = 0, T max = 0, const char* format = nulltptr) +// { +// const char *fmt = format; +// if (format == nullptr) { +// fmt = ImGuiDataTypeTraits::format; +// } +// return InputScalar(label, ImGuiDataTypeTraits::value, value, &min, &max, fmt); +// } + +template +inline bool SliderScalar(const char *label, T* value, T min = 0, T max = 0, const char* format = "") +{ + const char *fmt = format; + if (format == nullptr) { + fmt = ImGuiDataTypeTraits::format; + } + return SliderScalar(label, ImGuiDataTypeTraits::value, value, &min, &max, fmt); +} + +template +inline bool Checkbox(const char* label, Getter get, Setter set) +{ + bool value = get(); + bool ret = ImGui::Checkbox(label, &value); + set(value); + return ret; +} + +} // namespace ImGui + +#endif // IGL_OPENGL_GLFW_IMGUI_IMGUIHELPERS_H diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4c088345ba71c9c56e141e72ac87f1d1b4e8999c --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp @@ -0,0 +1,188 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2022 Alec Jacobson +// Copyright (C) 2018 Jérémie Dumas +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +//////////////////////////////////////////////////////////////////////////////// +#include "ImGuiMenu.h" +#include "ImGuiHelpers.h" +#include +#include + +namespace igl +{ +namespace opengl +{ +namespace glfw +{ +namespace imgui +{ + + // Is this needed? +IGL_INLINE void ImGuiMenu::init( Viewer *_viewer, ImGuiPlugin *_plugin) + { viewer = _viewer; plugin = _plugin; } + +IGL_INLINE void ImGuiMenu::shutdown() { } + +IGL_INLINE void ImGuiMenu::draw() +{ + // Viewer settings + if (callback_draw_viewer_window) { callback_draw_viewer_window(); } + else { draw_viewer_window(); } + + // Other windows + if (callback_draw_custom_window) { callback_draw_custom_window(); } + else { draw_custom_window(); } +} + +IGL_INLINE void ImGuiMenu::draw_viewer_window() +{ + float menu_width = 180.f * menu_scaling(); + ImGui::SetNextWindowPos(ImVec2(0.0f, 0.0f), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(0.0f, 0.0f), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSizeConstraints(ImVec2(menu_width, -1.0f), ImVec2(menu_width, -1.0f)); + bool _viewer_menu_visible = true; + ImGui::Begin( + "Viewer", &_viewer_menu_visible, + ImGuiWindowFlags_NoSavedSettings + | ImGuiWindowFlags_AlwaysAutoResize + ); + ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.4f); + if (callback_draw_viewer_menu) { callback_draw_viewer_menu(); } + else { draw_viewer_menu(); } + ImGui::PopItemWidth(); + ImGui::End(); +} + +IGL_INLINE void ImGuiMenu::draw_viewer_menu() +{ + // Workspace + if (ImGui::CollapsingHeader("Workspace", ImGuiTreeNodeFlags_DefaultOpen)) + { + float w = ImGui::GetContentRegionAvail().x; + float p = ImGui::GetStyle().FramePadding.x; + if (ImGui::Button("Load##Workspace", ImVec2((w-p)/2.f, 0))) + { + viewer->load_scene(); + } + ImGui::SameLine(0, p); + if (ImGui::Button("Save##Workspace", ImVec2((w-p)/2.f, 0))) + { + viewer->save_scene(); + } + } + + // Mesh + if (ImGui::CollapsingHeader("Mesh", ImGuiTreeNodeFlags_DefaultOpen)) + { + float w = ImGui::GetContentRegionAvail().x; + float p = ImGui::GetStyle().FramePadding.x; + if (ImGui::Button("Load##Mesh", ImVec2((w-p)/2.f, 0))) + { + viewer->open_dialog_load_mesh(); + } + ImGui::SameLine(0, p); + if (ImGui::Button("Save##Mesh", ImVec2((w-p)/2.f, 0))) + { + viewer->open_dialog_save_mesh(); + } + } + + // Viewing options + if (ImGui::CollapsingHeader("Viewing Options", ImGuiTreeNodeFlags_DefaultOpen)) + { + if (ImGui::Button("Center object", ImVec2(-1, 0))) + { + viewer->core().align_camera_center(viewer->data().V, viewer->data().F); + } + if (ImGui::Button("Snap canonical view", ImVec2(-1, 0))) + { + viewer->snap_to_canonical_quaternion(); + } + + // Zoom + ImGui::PushItemWidth(80 * menu_scaling()); + ImGui::DragFloat("Zoom", &(viewer->core().camera_zoom), 0.05f, 0.1f, 20.0f); + + // Select rotation type + int rotation_type = static_cast(viewer->core().rotation_type); + static Eigen::Quaternionf trackball_angle = Eigen::Quaternionf::Identity(); + static bool orthographic = true; + if (ImGui::Combo("Camera Type", &rotation_type, "Trackball\0Two Axes\0002D Mode\0\0")) + { + using RT = igl::opengl::ViewerCore::RotationType; + auto new_type = static_cast(rotation_type); + if (new_type != viewer->core().rotation_type) + { + if (new_type == RT::ROTATION_TYPE_NO_ROTATION) + { + trackball_angle = viewer->core().trackball_angle; + orthographic = viewer->core().orthographic; + viewer->core().trackball_angle = Eigen::Quaternionf::Identity(); + viewer->core().orthographic = true; + } + else if (viewer->core().rotation_type == RT::ROTATION_TYPE_NO_ROTATION) + { + viewer->core().trackball_angle = trackball_angle; + viewer->core().orthographic = orthographic; + } + viewer->core().set_rotation_type(new_type); + } + } + + // Orthographic view + ImGui::Checkbox("Orthographic view", &(viewer->core().orthographic)); + ImGui::PopItemWidth(); + } + + // Helper for setting viewport specific mesh options + auto make_checkbox = [&](const char *label, unsigned int &option) + { + return ImGui::Checkbox(label, + [&]() { return viewer->core().is_set(option); }, + [&](bool value) { return viewer->core().set(option, value); } + ); + }; + + // Draw options + if (ImGui::CollapsingHeader("Draw Options", ImGuiTreeNodeFlags_DefaultOpen)) + { + if (ImGui::Checkbox("Face-based", &(viewer->data().face_based))) + { + viewer->data().dirty = MeshGL::DIRTY_ALL; + } + make_checkbox("Show texture", viewer->data().show_texture); + if (ImGui::Checkbox("Invert normals", &(viewer->data().invert_normals))) + { + viewer->data().dirty |= igl::opengl::MeshGL::DIRTY_NORMAL; + } + make_checkbox("Show overlay", viewer->data().show_overlay); + make_checkbox("Show overlay depth", viewer->data().show_overlay_depth); + ImGui::ColorEdit4("Background", viewer->core().background_color.data(), + ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_PickerHueWheel); + ImGui::ColorEdit4("Line color", viewer->data().line_color.data(), + ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_PickerHueWheel); + ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.3f); + ImGui::DragFloat("Shininess", &(viewer->data().shininess), 0.05f, 0.0f, 100.0f); + ImGui::PopItemWidth(); + } + + // Overlays + if (ImGui::CollapsingHeader("Overlays", ImGuiTreeNodeFlags_DefaultOpen)) + { + make_checkbox("Wireframe", viewer->data().show_lines); + make_checkbox("Fill", viewer->data().show_faces); + make_checkbox("Show vertex labels", viewer->data().show_vertex_labels); + make_checkbox("Show faces labels", viewer->data().show_face_labels); + make_checkbox("Show extra labels", viewer->data().show_custom_labels); + } +} + + +} // end namespace +} // end namespace +} // end namespace +} // end namespace diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiMenu.h b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiMenu.h new file mode 100644 index 0000000000000000000000000000000000000000..390c563519db5d4730faed21944eee1f7c8a0ca7 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiMenu.h @@ -0,0 +1,55 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2022 Alec Jacobson +// Copyright (C) 2018 Jérémie Dumas +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GLFW_IMGUI_IMGUIMENU_H +#define IGL_OPENGL_GLFW_IMGUI_IMGUIMENU_H + +#include "ImGuiPlugin.h" +#include "ImGuiWidget.h" +#include "../../../igl_inline.h" +#include + +namespace igl +{ + namespace opengl + { + namespace glfw + { + namespace imgui + { + + class ImGuiMenu : public ImGuiWidget + { + public: + IGL_INLINE virtual void init(Viewer *_viewer, ImGuiPlugin *_plugin) override; + IGL_INLINE virtual void shutdown() override; + IGL_INLINE virtual void draw() override; + // Can be overwritten by `callback_draw_viewer_window` + IGL_INLINE virtual void draw_viewer_window(); + // Can be overwritten by `callback_draw_viewer_menu` + IGL_INLINE virtual void draw_viewer_menu(); + // Can be overwritten by `callback_draw_custom_window` + IGL_INLINE virtual void draw_custom_window() { } + // Customizable callbacks + std::function callback_draw_viewer_window; + std::function callback_draw_viewer_menu; + std::function callback_draw_custom_window; + float menu_scaling() + { return plugin->hidpi_scaling() / plugin->pixel_ratio(); } + }; + + } + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "ImGuiMenu.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiPlugin.cpp b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiPlugin.cpp new file mode 100644 index 0000000000000000000000000000000000000000..25ad27cad35a72956188a8195e92c3153bb0cda2 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiPlugin.cpp @@ -0,0 +1,211 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2022 Alec Jacobson +// Copyright (C) 2018 Jérémie Dumas +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +//////////////////////////////////////////////////////////////////////////////// +#include "ImGuiPlugin.h" +#include "ImGuiHelpers.h" +#include +#include +#include +#include +#include +#include +#include + +namespace igl +{ +namespace opengl +{ +namespace glfw +{ +namespace imgui +{ + +IGL_INLINE void ImGuiPlugin::init(igl::opengl::glfw::Viewer *_viewer) +{ + ViewerPlugin::init(_viewer); + // Setup ImGui binding + if (_viewer) + { + IMGUI_CHECKVERSION(); + if (!context_) + { + // Single global context by default, but can be overridden by the user + static ImGuiContext * __global_context = ImGui::CreateContext(); + context_ = __global_context; + } + const char* glsl_version = "#version 150"; + ImGui_ImplGlfw_InitForOpenGL(viewer->window, false); + ImGui_ImplOpenGL3_Init(glsl_version); + ImGui::GetIO().IniFilename = nullptr; + ImGui::StyleColorsDark(); + ImGuiStyle& style = ImGui::GetStyle(); + style.FrameRounding = 5.0f; + reload_font(); + } + init_widgets(); +} + +IGL_INLINE void ImGuiPlugin::init_widgets() +{ + // Init all widgets + for(auto & widget : widgets) { widget->init(viewer, this); } +} +IGL_INLINE void ImGuiPlugin::reload_font(int font_size) +{ + hidpi_scaling_ = hidpi_scaling(); + pixel_ratio_ = pixel_ratio(); + ImGuiIO& io = ImGui::GetIO(); + io.Fonts->Clear(); + io.Fonts->AddFontFromMemoryCompressedTTF(droid_sans_compressed_data, + droid_sans_compressed_size, font_size * hidpi_scaling_); + io.FontGlobalScale = 1.0 / pixel_ratio_; +} + +IGL_INLINE void ImGuiPlugin::shutdown() +{ + // Cleanup + ImGui_ImplOpenGL3_Shutdown(); + ImGui_ImplGlfw_Shutdown(); + // User is responsible for destroying context if a custom context is given + // ImGui::DestroyContext(*context_); +} + +IGL_INLINE bool ImGuiPlugin::pre_draw() +{ + glfwPollEvents(); + + // Check whether window dpi has changed + float scaling = hidpi_scaling(); + if (std::abs(scaling - hidpi_scaling_) > 1e-5) + { + reload_font(); + ImGui_ImplOpenGL3_DestroyDeviceObjects(); + } + + ImGui_ImplOpenGL3_NewFrame(); + ImGui_ImplGlfw_NewFrame(); + ImGui::NewFrame(); + return false; +} + +IGL_INLINE bool ImGuiPlugin::post_draw() +{ + for(auto & widget : widgets){ widget->draw(); } + ImGui::Render(); + ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); + return false; +} + +IGL_INLINE void ImGuiPlugin::post_resize(int width, int height) +{ + if (context_) + { + ImGui::GetIO().DisplaySize.x = float(width); + ImGui::GetIO().DisplaySize.y = float(height); + } +} + +// Mouse IO +IGL_INLINE bool ImGuiPlugin::mouse_down(int button, int modifier) +{ + ImGui_ImplGlfw_MouseButtonCallback(viewer->window, button, GLFW_PRESS, modifier); + if(ImGui::GetIO().WantCaptureMouse){ return true; } + for( auto & widget : widgets) + { + if(widget->mouse_down(button, modifier)) { return true; } + } + return false; +} + +IGL_INLINE bool ImGuiPlugin::mouse_up(int button, int modifier) +{ + //return ImGui::GetIO().WantCaptureMouse; + // !! Should not steal mouse up + for( auto & widget : widgets) + { + widget->mouse_up(button, modifier); + } + return false; +} + +IGL_INLINE bool ImGuiPlugin::mouse_move(int mouse_x, int mouse_y) +{ + if(ImGui::GetIO().WantCaptureMouse){ return true; } + for( auto & widget : widgets) + { + if(widget->mouse_move(mouse_x, mouse_y)) { return true; } + } + return false; +} + +IGL_INLINE bool ImGuiPlugin::mouse_scroll(float delta_y) +{ + ImGui_ImplGlfw_ScrollCallback(viewer->window, 0.f, delta_y); + return ImGui::GetIO().WantCaptureMouse; +} + +// Keyboard IO +IGL_INLINE bool ImGuiPlugin::key_pressed(unsigned int key, int modifiers) +{ + ImGui_ImplGlfw_CharCallback(nullptr, key); + if(ImGui::GetIO().WantCaptureKeyboard) { return true; } + for(auto & widget : widgets) + { + if(widget->key_pressed(key,modifiers)) {return true; } + } + return false; +} + +IGL_INLINE bool ImGuiPlugin::key_down(int key, int modifiers) +{ + ImGui_ImplGlfw_KeyCallback(viewer->window, key, 0, GLFW_PRESS, modifiers); + if(ImGui::GetIO().WantCaptureKeyboard) { return true; } + for(auto & widget : widgets) + { + if(widget->key_down(key,modifiers)) {return true; } + } + return false; +} + +IGL_INLINE bool ImGuiPlugin::key_up(int key, int modifiers) +{ + ImGui_ImplGlfw_KeyCallback(viewer->window, key, 0, GLFW_RELEASE, modifiers); + if(ImGui::GetIO().WantCaptureKeyboard) { return true; } + for(auto & widget : widgets) + { + if(widget->key_up(key,modifiers)) { return true; } + } + return false; +} + +IGL_INLINE float ImGuiPlugin::pixel_ratio() +{ + // Computes pixel ratio for hidpi devices + int buf_size[2]; + int win_size[2]; + GLFWwindow* window = glfwGetCurrentContext(); + glfwGetFramebufferSize(window, &buf_size[0], &buf_size[1]); + glfwGetWindowSize(window, &win_size[0], &win_size[1]); + return (float) buf_size[0] / (float) win_size[0]; +} + +IGL_INLINE float ImGuiPlugin::hidpi_scaling() +{ + // Computes scaling factor for hidpi devices + float xscale, yscale; + GLFWwindow* window = glfwGetCurrentContext(); + glfwGetWindowContentScale(window, &xscale, &yscale); + return 0.5 * (xscale + yscale); +} + +} // end namespace +} // end namespace +} // end namespace +} // end namespace + diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiPlugin.h b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiPlugin.h new file mode 100644 index 0000000000000000000000000000000000000000..7d36aa082e6e3d50c177db6a9bc3637cfd88d9e9 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiPlugin.h @@ -0,0 +1,77 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2022 Alec Jacobson +// Copyright (C) 2018 Jérémie Dumas +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GLFW_IMGUI_IMGUIPLUGIN_H +#define IGL_OPENGL_GLFW_IMGUI_IMGUIPLUGIN_H + +#include "../Viewer.h" +#include "../ViewerPlugin.h" +#include "../../../igl_inline.h" +#include "ImGuiWidget.h" + +// Forward declarations +struct ImGuiContext; + +namespace igl +{ + namespace opengl + { + namespace glfw + { + namespace imgui + { + // Forward declaration of child widget abstract type + class ImGuiWidget; + class ImGuiPlugin : public igl::opengl::glfw::ViewerPlugin + { + protected: + // Hidpi scaling to be used for text rendering. + float hidpi_scaling_; + // Ratio between the framebuffer size and the window size. + // May be different from the hipdi scaling! + float pixel_ratio_; + // ImGui Context + ImGuiContext * context_ = nullptr; + public: + // List of registered widgets + std::vector widgets; + public: + IGL_INLINE virtual void init(igl::opengl::glfw::Viewer *_viewer) override; + IGL_INLINE void init_widgets(); + IGL_INLINE virtual void reload_font(int font_size = 13); + IGL_INLINE virtual void shutdown() override; + IGL_INLINE virtual bool pre_draw() override; + IGL_INLINE virtual bool post_draw() override; + IGL_INLINE virtual void post_resize(int width, int height) override; + IGL_INLINE virtual bool mouse_down(int button, int modifier) override; + IGL_INLINE virtual bool mouse_up(int button, int modifier) override; + IGL_INLINE virtual bool mouse_move(int mouse_x, int mouse_y) override; + IGL_INLINE virtual bool mouse_scroll(float delta_y) override; + // Keyboard IO + IGL_INLINE virtual bool key_pressed(unsigned int key, int modifiers) override; + IGL_INLINE virtual bool key_down(int key, int modifiers) override; + IGL_INLINE virtual bool key_up(int key, int modifiers) override; + IGL_INLINE void draw_text( + const Eigen::Vector3d pos, + const Eigen::Vector3d normal, + const std::string &text, + const Eigen::Vector4f color = Eigen::Vector4f(0,0,0.04,1)); // old default color + IGL_INLINE float pixel_ratio(); + IGL_INLINE float hidpi_scaling(); + }; + } + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "ImGuiPlugin.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiTraits.h b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiTraits.h new file mode 100644 index 0000000000000000000000000000000000000000..e6911c5e5b171309a03ccd2dd1b310340ac1d4a3 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiTraits.h @@ -0,0 +1,69 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Jérémie Dumas +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GLFW_IMGUI_IMGUITRAITS_H +#define IGL_OPENGL_GLFW_IMGUI_IMGUITRAITS_H + +#include + +// Extend ImGui by populating its namespace directly +namespace ImGui +{ + +// Infer ImGuiDataType enum based on actual type +template +class ImGuiDataTypeTraits +{ + static const ImGuiDataType value; // link error + static const char * format; +}; + +template<> +class ImGuiDataTypeTraits +{ + static constexpr ImGuiDataType value = ImGuiDataType_S32; + static constexpr const char *format = "%d"; +}; + +template<> +class ImGuiDataTypeTraits +{ + static constexpr ImGuiDataType value = ImGuiDataType_U32; + static constexpr const char *format = "%u"; +}; + +template<> +class ImGuiDataTypeTraits +{ + static constexpr ImGuiDataType value = ImGuiDataType_S64; + static constexpr const char *format = "%lld"; +}; + +template<> +class ImGuiDataTypeTraits +{ + static constexpr ImGuiDataType value = ImGuiDataType_U64; + static constexpr const char *format = "%llu"; +}; + +template<> +class ImGuiDataTypeTraits +{ + static constexpr ImGuiDataType value = ImGuiDataType_Float; + static constexpr const char *format = "%.3f"; +}; + +template<> +class ImGuiDataTypeTraits +{ + static constexpr ImGuiDataType value = ImGuiDataType_Double; + static constexpr const char *format = "%.6f"; +}; + +} // namespace ImGui + +#endif // IGL_OPENGL_GLFW_IMGUI_IMGUIHELPERS_H diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiWidget.h b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiWidget.h new file mode 100644 index 0000000000000000000000000000000000000000..6b7f5372a9be224e39b8f40ad378e9f192e48e38 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuiWidget.h @@ -0,0 +1,65 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2022 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_GLFW_IMGUI_IMGUIWIDGET_H +#define IGL_OPENGL_GLFW_IMGUI_IMGUIWIDGET_H + +#include "ImGuiPlugin.h" +#include "ImGuiWidget.h" +#include "../../../igl_inline.h" +#include + +namespace igl +{ + namespace opengl + { + namespace glfw + { + class Viewer; + namespace imgui + { + // Forward declaration of the parent plugin + class ImGuiPlugin; + // Abstract class for imgui "widgets". A widget is something that uses + // imgui, but doesn't own the entire imgui IO stack: the single + // ImGuiPlugin owns that and widgets are registered with it. + class ImGuiWidget + { + public: + IGL_INLINE ImGuiWidget(){ name = "dummy"; } + virtual ~ImGuiWidget(){} + IGL_INLINE virtual void init(Viewer *_viewer, ImGuiPlugin *_plugin) + { viewer = _viewer; plugin = _plugin; } + IGL_INLINE virtual void shutdown() {} + IGL_INLINE virtual void draw() {} + IGL_INLINE virtual bool mouse_down(int button, int modifier) + { return false;} + IGL_INLINE virtual bool mouse_up(int button, int modifier) + { return false;} + IGL_INLINE virtual bool mouse_move(int mouse_x, int mouse_y) + { return false;} + IGL_INLINE virtual bool key_pressed(unsigned int key, int modifiers) + { return false;} + IGL_INLINE virtual bool key_down(int key, int modifiers) + { return false;} + IGL_INLINE virtual bool key_up(int key, int modifiers) + { return false;} + std::string name; + protected: + // Pointer to ImGuiPlugin's parent viewer + Viewer *viewer; + // Pointer to parent ImGuiPlugin class + ImGuiPlugin *plugin; + }; + + } + } + } +} + +#endif + diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuizmoWidget.cpp b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuizmoWidget.cpp new file mode 100644 index 0000000000000000000000000000000000000000..61f15b153dfe5c034187eadd1b8b031936fbd591 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuizmoWidget.cpp @@ -0,0 +1,43 @@ +#include "ImGuizmoWidget.h" +#include +#include +#include +#include +#include + +namespace igl{ namespace opengl{ namespace glfw{ namespace imgui{ + +IGL_INLINE void ImGuizmoWidget::init(Viewer *_viewer, ImGuiPlugin *_plugin) +{ + ImGuiWidget::init(_viewer,_plugin); +} + +IGL_INLINE void ImGuizmoWidget::draw() +{ + if(!visible){ return; } + ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0); + ImGuizmo::BeginFrame(); + ImGui::PopStyleVar(); + // Don't draw the Viewer's default menu: draw just the ImGuizmo + Eigen::Matrix4f view = (viewer->core().view / viewer->core().camera_zoom); + Eigen::Matrix4f proj = viewer->core().proj; + if(viewer->core().orthographic){ view(2,3) -= 1000;/* Hack depth */ } + // ImGuizmo doesn't like a lot of scaling in view, shift it to T + const float z = viewer->core().camera_base_zoom; + const Eigen::Matrix4f S = + (Eigen::Matrix4f()<< z,0,0,0, 0,z,0,0, 0,0,z,0, 0,0,0,1).finished(); + view = (view * S.inverse()).eval(); + const Eigen::Matrix4f T0 = T; + T = (S * T).eval(); + ImGuiIO& io = ImGui::GetIO(); + ImGuizmo::SetRect(0, 0, io.DisplaySize.x, io.DisplaySize.y); + ImGuizmo::Manipulate( + view.data(),proj.data(),operation,ImGuizmo::LOCAL,T.data(),NULL,NULL); + // invert scaling that was shifted onto T + T = (S.inverse() * T).eval(); + const float diff = (T-T0).array().abs().maxCoeff(); + // Only call if actually changed; otherwise, triggers on all mouse events + if( diff > 1e-7) { callback(T); } +} + +}}}} diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuizmoWidget.h b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuizmoWidget.h new file mode 100644 index 0000000000000000000000000000000000000000..853c1332c545c0664f771a1e95f47a0c4f5cf356 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/ImGuizmoWidget.h @@ -0,0 +1,35 @@ +#ifndef IGL_OPENGL_GFLW_IMGUI_IMGUIZMOPLUGIN_H +#define IGL_OPENGL_GFLW_IMGUI_IMGUIZMOPLUGIN_H +#include "../../../igl_inline.h" +#include "ImGuiMenu.h" +#include +#include +#include +#include + +namespace igl{ namespace opengl{ namespace glfw{ namespace imgui{ + +class ImGuizmoWidget : public ImGuiWidget +{ +public: + // callback(T) called when the stored transform T changes + std::function callback; + // Whether to display + bool visible = true; + // whether rotating, translating or scaling + ImGuizmo::OPERATION operation; + // stored transformation + Eigen::Matrix4f T; + // Initilize with rotate operation on an identity transform (at origin) + ImGuizmoWidget():operation(ImGuizmo::ROTATE),T(Eigen::Matrix4f::Identity()){}; + IGL_INLINE virtual void init(Viewer *_viewer, ImGuiPlugin *_plugin) override; + IGL_INLINE virtual void draw() override; +}; + +}}}} + +#ifndef IGL_STATIC_LIBRARY +# include "ImGuizmoWidget.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/SelectionWidget.cpp b/vendor/libigl/include/igl/opengl/glfw/imgui/SelectionWidget.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b44b9162ae316025c45b894b97d52387625f7da1 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/SelectionWidget.cpp @@ -0,0 +1,214 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2022 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "SelectionWidget.h" + +#include +#include +#include +#include +#include +#include "../../../PI.h" + +namespace igl{ namespace opengl{ namespace glfw{ namespace imgui{ + +IGL_INLINE void SelectionWidget::init(Viewer *_viewer, ImGuiPlugin *_plugin) +{ + ImGuiWidget::init(_viewer,_plugin); + std::cout<window, &fwidth, &fheight); + int iwidth, iheight; + glfwGetWindowSize(viewer->window, &iwidth, &iheight); + highdpi = float(iwidth)/float(fwidth); + // highdpi + width = (float)iwidth; + height = (float)iheight; + } + + ImGui::SetNextWindowPos( ImVec2(0,0) ); + ImGui::SetNextWindowSize(ImVec2(width,height), ImGuiCond_Always); + + ImGui::Begin("testing", nullptr, + ImGuiWindowFlags_NoBackground + | ImGuiWindowFlags_NoTitleBar + | ImGuiWindowFlags_NoResize + | ImGuiWindowFlags_NoMove + | ImGuiWindowFlags_NoScrollbar + | ImGuiWindowFlags_NoSavedSettings + | ImGuiWindowFlags_NoInputs); + + ImDrawList* list = ImGui::GetWindowDrawList(); + for(int pass = 0;pass<2;pass++) + { + for(auto & p : L) + { + list->PathLineTo({ highdpi*p(0),height-highdpi*p(1) }); + } + const bool closed = !(mode==LASSO || mode==POLYGONAL_LASSO) || !(is_down || is_drawing); + if(pass == 0) + { + list->PathStroke(IM_COL32(255, 255, 255, 255), closed, 2); + }else + { + list->PathStroke(IM_COL32(0, 0, 0, 255), closed, 1); + } + } + + ImGui::End(); + + ImGui::Render(); + ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); + +} + +IGL_INLINE bool SelectionWidget::mouse_down(int button, int modifier) +{ + if(mode == OFF || (modifier & IGL_MOD_ALT) ){ return false;} + is_down = true; + has_moved_since_down = false; + if(!is_drawing) + { + L.clear(); + is_drawing = true; + } + M.row(0) = xy(viewer); + M.row(1) = M.row(0); + L.emplace_back(M.row(0)); + return true; +} + +IGL_INLINE bool SelectionWidget::mouse_up(int button, int modifier) +{ + is_down = false; + // are we done? Check first and last lasso point (need at least 3 (2 real + // points + 1 mouse-mouse point)) + if(is_drawing && + (mode!=POLYGONAL_LASSO ||(L.size()>=3&&(L[0]-L[L.size()-1]).norm()<=10.0))) + { + if(callback){ callback();} + is_drawing = false; + } + return false; +} + +IGL_INLINE bool SelectionWidget::mouse_move(int mouse_x, int mouse_y) +{ + if(!is_drawing){ return false; } + if(!has_moved_since_down) + { + if(mode == POLYGONAL_LASSO) { L.emplace_back(L[L.size()-1]); } + has_moved_since_down = true; + } + M.row(1) = xy(viewer); + switch(mode) + { + case RECTANGULAR_MARQUEE: + rect(M,L); + break; + case ELLIPTICAL_MARQUEE: + circle(M,L); + break; + case POLYGONAL_LASSO: + // Over write last point + L[L.size()-1] = xy(viewer); + break; + case LASSO: + L.emplace_back(xy(viewer)); + break; + default: assert(false); + } + return true; +} + +IGL_INLINE bool SelectionWidget::key_pressed(unsigned int key, int modifiers) +{ + Mode old = mode; + if(OFF_KEY.find(char(key)) != std::string::npos) + { + mode = OFF; + }else if(LASSO_KEY.find(char(key)) != std::string::npos) + { + if(mode == LASSO) + { + mode = POLYGONAL_LASSO; + }else/*if(mode == POLYGONAL_LASSO)*/ + { + mode = LASSO; + } + }else if(MARQUEE_KEY.find(char(key)) != std::string::npos) + { + if(mode == RECTANGULAR_MARQUEE) + { + mode = ELLIPTICAL_MARQUEE; + }else/*if(mode == ELLIPTICAL_MARQUEE)*/ + { + mode = RECTANGULAR_MARQUEE; + } + } + if(old != mode) + { + clear(); + if(callback_post_mode_change){ callback_post_mode_change(old); } + return true; + } + return false; +} + +IGL_INLINE void SelectionWidget::clear() +{ + M.setZero(); + L.clear(); + is_drawing = false; + is_down = false; +}; + +IGL_INLINE void SelectionWidget::circle(const Eigen::Matrix & M, std::vector & L) +{ + L.clear(); + L.reserve(64); + const float r = (M.row(1)-M.row(0)).norm(); + for(float th = 0;th<2.*igl::PI;th+=0.1) + { + L.emplace_back(M(0,0)+r*cos(th),M(0,1)+r*sin(th)); + } +} + +IGL_INLINE void SelectionWidget::rect(const Eigen::Matrix & M, std::vector & L) +{ + L.resize(4); + L[0] = Eigen::RowVector2f(M(0,0),M(0,1)); + L[1] = Eigen::RowVector2f(M(1,0),M(0,1)); + L[2] = Eigen::RowVector2f(M(1,0),M(1,1)); + L[3] = Eigen::RowVector2f(M(0,0),M(1,1)); +} + +IGL_INLINE Eigen::RowVector2f SelectionWidget::xy(const Viewer * vr) +{ + return Eigen::RowVector2f( + vr->current_mouse_x, + vr->core().viewport(3) - vr->current_mouse_y); +} + + + +}}}} diff --git a/vendor/libigl/include/igl/opengl/glfw/imgui/SelectionWidget.h b/vendor/libigl/include/igl/opengl/glfw/imgui/SelectionWidget.h new file mode 100644 index 0000000000000000000000000000000000000000..3285ecdf6b4d0ca7d364d316d348cc53bf9c0d44 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/imgui/SelectionWidget.h @@ -0,0 +1,60 @@ +#ifndef IGL_OPENGL_GFLW_IMGUI_SELECTIONWIDGET_H +#define IGL_OPENGL_GFLW_IMGUI_SELECTIONWIDGET_H +#include "../../../igl_inline.h" +#include "ImGuiWidget.h" +#include +#include +#include +#include + +namespace igl{ namespace opengl{ namespace glfw{ namespace imgui{ + +class SelectionWidget: public ImGuiWidget +{ +public: + // customizable hotkeys + std::string MARQUEE_KEY = "Mm"; + // leave 'L' for show_lines in viewer + std::string LASSO_KEY = "l"; + std::string OFF_KEY = "Vv"; + enum Mode + { + OFF = 0, + RECTANGULAR_MARQUEE = 1, + ELLIPTICAL_MARQUEE = 2, + POLYGONAL_LASSO = 3, + LASSO = 4, + NUM_MODES = 5 + } mode = RECTANGULAR_MARQUEE; + bool is_down = false; + bool has_moved_since_down = false; + bool is_drawing = false; + // min and max corners of 2D rectangular marquee + Eigen::Matrix M = Eigen::Matrix::Zero(); + // list of points of 2D lasso marquee + std::vector L; + // callback called when slection is completed (usually on mouse_up) + std::function callback; + // callback called after mode is changed + std::function callback_post_mode_change; + IGL_INLINE virtual void init(Viewer *_viewer, ImGuiPlugin *_plugin) override; + IGL_INLINE virtual void draw() override; + IGL_INLINE virtual bool mouse_down(int button, int modifier) override; + IGL_INLINE virtual bool mouse_up(int button, int modifier) override; + IGL_INLINE virtual bool mouse_move(int mouse_x, int mouse_y) override; + IGL_INLINE virtual bool key_pressed(unsigned int key, int modifiers) override; + IGL_INLINE void clear(); + // helpers + IGL_INLINE static void circle(const Eigen::Matrix & M, std::vector & L); + IGL_INLINE static void rect(const Eigen::Matrix & M, std::vector & L); + IGL_INLINE static Eigen::RowVector2f xy(const Viewer * v); +public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW +}; + +}}}} + +#ifndef IGL_STATIC_LIBRARY +#include "SelectionWidget.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/opengl/glfw/map_texture.cpp b/vendor/libigl/include/igl/opengl/glfw/map_texture.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7975d87d479b0bfe43377a28f786de2e750a9958 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/map_texture.cpp @@ -0,0 +1,211 @@ +#ifdef IGL_OPENGL_4 + +#include "map_texture.h" +#include "background_window.h" +#include "../create_shader_program.h" + +#include "../gl.h" +#include + +#include +#include + +template +IGL_INLINE bool igl::opengl::glfw::map_texture( + const Eigen::MatrixBase & _V, + const Eigen::MatrixBase & _F, + const Eigen::MatrixBase & _U, + const unsigned char * in_data, + const int w, + const int h, + const int nc, + std::vector & out_data) +{ + int out_w = w; + int out_h = h; + int out_nc = nc; + return map_texture(_V,_F,_U,in_data,w,h,nc,out_data,out_w,out_h,out_nc); +} + + +template +IGL_INLINE bool igl::opengl::glfw::map_texture( + const Eigen::MatrixBase & _V, + const Eigen::MatrixBase & _F, + const Eigen::MatrixBase & _U, + const unsigned char * in_data, + const int w, + const int h, + const int nc, + std::vector & out_data, + int & out_w, + int & out_h, + int & out_nc) +{ + const auto fail = [](const std::string msg) + { + std::cerr< V = _V.template cast(); + Eigen::Matrix< + double, + DerivedU::RowsAtCompileTime, + DerivedU::ColsAtCompileTime, + Eigen::RowMajor> U = _U.template cast(); + Eigen::Matrix< + int, + DerivedF::RowsAtCompileTime, + DerivedF::ColsAtCompileTime, + Eigen::RowMajor> F = _F.template cast(); + const int dim = U.cols(); + GLFWwindow * window; + if(!background_window(window)) + { + fail("Could not initialize glfw window"); + } + + // Compile each shader + std::string vertex_shader = dim == 2 ? + R"( +#version 330 core +layout(location = 0) in vec2 position; +layout(location = 1) in vec2 tex_coord_v; +out vec2 tex_coord_f; +void main() +{ + tex_coord_f = vec2(tex_coord_v.x,1.-tex_coord_v.y); + gl_Position = vec4( 2.*position.x-1., 2.*(1.-position.y)-1., 0.,1.); +} +)" + : + R"( +#version 330 core +layout(location = 0) in vec3 position; +layout(location = 1) in vec2 tex_coord_v; +out vec2 tex_coord_f; +void main() +{ + tex_coord_f = vec2(tex_coord_v.x,1.-tex_coord_v.y); + gl_Position = vec4( 2.*position.x-1., 2.*(1.-position.y)-1., position.z,1.); +} +)" + ; + std::string fragment_shader = R"( +#version 330 core +layout(location = 0) out vec3 color; +uniform sampler2D tex; +in vec2 tex_coord_f; +void main() +{ + color = texture(tex,tex_coord_f).rgb; +} +)"; + GLuint prog_id = + igl::opengl::create_shader_program(vertex_shader,fragment_shader,{}); + glUniform1i(glGetUniformLocation(prog_id, "tex"),0); + // Generate and attach buffers to vertex array + glDisable(GL_CULL_FACE); + GLuint VAO = 0; + glGenVertexArrays(1,&VAO); + glBindVertexArray(VAO); + GLuint ibo,vbo,tbo; + glGenBuffers(1,&ibo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)*F.size(), F.data(), GL_STATIC_DRAW); + glGenBuffers(1,&vbo); + glEnableVertexAttribArray(0); + glBindBuffer(GL_ARRAY_BUFFER,vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(double)*U.size(), U.data(), GL_STATIC_DRAW); + glVertexAttribLPointer(0, U.cols(), GL_DOUBLE, U.cols() * sizeof(GLdouble), (GLvoid*)0); + glGenBuffers(1,&tbo); + glEnableVertexAttribArray(1); + glBindBuffer(GL_ARRAY_BUFFER,tbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(double)*V.size(), V.data(), GL_STATIC_DRAW); + glVertexAttribLPointer(1, V.cols(), GL_DOUBLE, V.cols() * sizeof(GLdouble), (GLvoid*)0); + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindVertexArray(0); + // Prepare texture + GLuint in_tex; + GLenum format; + { + format = nc==1 ? GL_RED : (nc==3 ? GL_RGB : (nc == 4 ? GL_RGBA : GL_FALSE)); + glGenTextures(1, &in_tex); + glBindTexture(GL_TEXTURE_2D, in_tex); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB, w, h, 0,format, GL_UNSIGNED_BYTE, in_data); + } + // Prepare framebuffer + GLuint fb = 0; + glGenFramebuffers(1, &fb); + glBindFramebuffer(GL_FRAMEBUFFER, fb); + GLuint out_tex; + glGenTextures(1, &out_tex); + glBindTexture(GL_TEXTURE_2D, out_tex); + // always use float for internal storage + assert(out_nc == 3); + glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB, out_w, out_h, 0,GL_RGB, GL_FLOAT, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, out_tex, 0); + { + GLenum bufs[1] = {GL_COLOR_ATTACHMENT0}; + glDrawBuffers(1, bufs); + } + if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) + { + fail("framebuffer setup failed."); + } + glBindFramebuffer(GL_FRAMEBUFFER, fb); + // clear screen and set viewport + glClearColor(0.0,1.0,0.0,0.); + glClear(GL_COLOR_BUFFER_BIT); + glViewport(0,0,out_w,out_h); + // Attach shader program + glUseProgram(prog_id); + glActiveTexture(GL_TEXTURE0 + 0); + glBindTexture(GL_TEXTURE_2D, in_tex); + // Draw mesh as wireframe + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glBindVertexArray(VAO); + glDrawElements(GL_TRIANGLES, F.size(), GL_UNSIGNED_INT, 0); + glBindVertexArray(0); + // Write into memory + assert(out_nc == 3); + out_data.resize(out_nc*out_w*out_h); + glBindTexture(GL_TEXTURE_2D, out_tex); + glGetTexImage(GL_TEXTURE_2D, 0, format, GL_UNSIGNED_BYTE, &out_data[0]); + // OpenGL cleanup + glDeleteBuffers(1,&fb); + glDeleteBuffers(1,&ibo); + glDeleteBuffers(1,&vbo); + glDeleteBuffers(1,&tbo); + glDeleteTextures(1,&in_tex); + glDeleteTextures(1,&out_tex); + glDeleteVertexArrays(1,&VAO); + glUseProgram(0); + glDeleteProgram(prog_id); + // GLFW cleanup + glfwDestroyWindow(window); + glfwTerminate(); + return true; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::opengl::glfw::map_texture, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned char const*, int, int, int, std::vector >&); +#endif + +#endif // IGL_OPENGL_4 diff --git a/vendor/libigl/include/igl/opengl/glfw/map_texture.h b/vendor/libigl/include/igl/opengl/glfw/map_texture.h new file mode 100644 index 0000000000000000000000000000000000000000..ee3b30a4503fa176c2d71660e0846f3b7dc3ea25 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/glfw/map_texture.h @@ -0,0 +1,63 @@ +#ifndef IGL_OPENGL_GLFW_MAP_TEXTURE_H +#define IGL_OPENGL_GLFW_MAP_TEXTURE_H + +#ifdef IGL_OPENGL_4 + +#include "../../igl_inline.h" +#include +#include + +namespace igl +{ + namespace opengl + { + namespace glfw + { + // Given a mesh (V,F) in [0,1]² and new positions (U) and a texture image + // (in_data), _render_ a new image (out_data) of the same size. + // Inputs: + // V #V by 2 list of undeformed mesh vertex positions (matching texture) + // F #F by 3 list of mesh triangle indices into V + // U #U by 2 list of deformed vertex positions + // in_data w*h*nc array of color values, channels, then columns, then + // rows (e.g., what stbi_image returns and expects) + // w width + // h height + // nc number of channels + // Outputs: + // out_data h*w*nc list of output colors in same order as input + // + template + IGL_INLINE bool map_texture( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & U, + const unsigned char * in_data, + const int w, + const int h, + const int nc, + std::vector & out_data); + template + IGL_INLINE bool map_texture( + const Eigen::MatrixBase & _V, + const Eigen::MatrixBase & _F, + const Eigen::MatrixBase & _U, + const unsigned char * in_data, + const int w, + const int h, + const int nc, + std::vector & out_data, + int & out_w, + int & out_h, + int & out_nc); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "map_texture.cpp" +#endif + +#endif // IGL_OPENGL_4 + +#endif diff --git a/vendor/libigl/include/igl/opengl/init_render_to_texture.cpp b/vendor/libigl/include/igl/opengl/init_render_to_texture.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7fbcfea10b4fe93597bc6bc3081883e190e34964 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/init_render_to_texture.cpp @@ -0,0 +1,86 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "init_render_to_texture.h" +#include "gl.h" +#include + +IGL_INLINE void igl::opengl::init_render_to_texture( + const size_t width, + const size_t height, + const bool depth_texture, + GLuint & tex_id, + GLuint & fbo_id, + GLuint & d_id) +{ + using namespace std; + // http://www.opengl.org/wiki/Framebuffer_Object_Examples#Quick_example.2C_render_to_texture_.282D.29 + const auto & gen_tex = [](GLuint & tex_id) + { + glGenTextures(1, &tex_id); + glBindTexture(GL_TEXTURE_2D, tex_id); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + }; + gen_tex(tex_id); + //NULL means reserve texture memory, but texels are undefined + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_BGRA, GL_FLOAT, NULL); + glBindTexture(GL_TEXTURE_2D, 0); + + glGenFramebuffers(1, &fbo_id); + glBindFramebuffer(GL_FRAMEBUFFER, fbo_id); + //Attach 2D texture to this FBO + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex_id, 0); + if(depth_texture) + { + // Generate a depth texture + gen_tex(d_id); + glTexImage2D( + GL_TEXTURE_2D, + 0, + GL_DEPTH_COMPONENT32, + width, + height, + 0, + GL_DEPTH_COMPONENT, + GL_FLOAT, + NULL); + glFramebufferTexture2D( + GL_FRAMEBUFFER,GL_DEPTH_ATTACHMENT,GL_TEXTURE_2D,d_id,0); + }else + { + // Attach a depth buffer + glGenRenderbuffers(1, &d_id); + glBindRenderbuffer(GL_RENDERBUFFER, d_id); + glRenderbufferStorage(GL_RENDERBUFFER,GL_DEPTH_COMPONENT24,width,height); + glFramebufferRenderbuffer( + GL_FRAMEBUFFER,GL_DEPTH_ATTACHMENT,GL_RENDERBUFFER,d_id); + } + + //Does the GPU support current FBO configuration? + GLenum status; + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + assert(status == GL_FRAMEBUFFER_COMPLETE); + // Unbind to clean up + if(!depth_texture) + { + glBindRenderbuffer(GL_RENDERBUFFER, 0); + } + glBindFramebuffer(GL_FRAMEBUFFER, 0); +} + +IGL_INLINE void igl::opengl::init_render_to_texture( + const size_t width, + const size_t height, + GLuint & tex_id, + GLuint & fbo_id, + GLuint & dfbo_id) +{ + return init_render_to_texture(width,height,false,tex_id,fbo_id,dfbo_id); +} diff --git a/vendor/libigl/include/igl/opengl/init_render_to_texture.h b/vendor/libigl/include/igl/opengl/init_render_to_texture.h new file mode 100644 index 0000000000000000000000000000000000000000..ae854e770af2146f04cb298513e8d22ec8bd7145 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/init_render_to_texture.h @@ -0,0 +1,77 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_INIT_RENDER_TO_TEXTURE_H +#define IGL_OPENGL_INIT_RENDER_TO_TEXTURE_H +#include "../igl_inline.h" +#include "gl.h" +#include +namespace igl +{ + namespace opengl + { + // Create a frame buffer that renders color to a RGBA texture a depth to a + // "render buffer". + // + // After calling this, you can use with something like: + // + // glBindFramebuffer(GL_FRAMEBUFFER, fbo_id); + // if(!depth_texture) + // { + // glBindRenderbuffer(GL_RENDERBUFFER, d_id); + // } + // // + // // draw scene ... + // // + // // clean up + // glBindFramebuffer(GL_FRAMEBUFFER,0); + // if(!depth_texture) + // { + // glBindRenderbuffer(GL_RENDERBUFFER, 0); + // } + // // Later ... + // glActiveTexture(GL_TEXTURE0+0); + // glBindTexture(GL_TEXTURE_2D,tex_id); + // if(depth_texture) + // { + // glActiveTexture(GL_TEXTURE0+1); + // glBindTexture(GL_TEXTURE_2D,d_id); + // } + // // draw textures + // + // + // + // Inputs: + // width image width + // height image height + // depth_texture whether to create a texture for depth or to create a + // render buffer for depth + // Outputs: + // tex_id id of the texture + // fbo_id id of the frame buffer object + // d_id id of the depth texture or frame buffer object + // + IGL_INLINE void init_render_to_texture( + const size_t width, + const size_t height, + const bool depth_texture, + GLuint & tex_id, + GLuint & fbo_id, + GLuint & d_id); + // Wrapper with depth_texture = false for legacy reasons + IGL_INLINE void init_render_to_texture( + const size_t width, + const size_t height, + GLuint & tex_id, + GLuint & fbo_id, + GLuint & dfbo_id); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "init_render_to_texture.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/opengl/load_shader.cpp b/vendor/libigl/include/igl/opengl/load_shader.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0ee0a978f439b1b89c743028cd341d3512a6d380 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/load_shader.cpp @@ -0,0 +1,34 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "load_shader.h" + +// Copyright Denis Kovacs 4/10/08 +#include "print_shader_info_log.h" +#include +IGL_INLINE GLuint igl::opengl::load_shader( + const std::string & src,const GLenum type) +{ + if(src.empty()) + { + return (GLuint) 0; + } + + GLuint s = glCreateShader(type); + if(s == 0) + { + fprintf(stderr,"Error: load_shader() failed to create shader.\n"); + return 0; + } + // Pass shader source string + const char *c = src.c_str(); + glShaderSource(s, 1, &c, NULL); + glCompileShader(s); + // Print info log (if any) + igl::opengl::print_shader_info_log(s); + return s; +} diff --git a/vendor/libigl/include/igl/opengl/load_shader.h b/vendor/libigl/include/igl/opengl/load_shader.h new file mode 100644 index 0000000000000000000000000000000000000000..6c234d8fcde8f3fba88b5a17e3089759fb6ebaa4 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/load_shader.h @@ -0,0 +1,38 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_LOAD_SHADER_H +#define IGL_OPENGL_LOAD_SHADER_H +#include "../igl_inline.h" +#include "gl.h" +#include + +namespace igl +{ + namespace opengl + { + // Creates and compiles a shader from a given string + // + // Inputs: + // src string containing GLSL shader code + // type GLSL type of shader, one of: + // GL_VERTEX_SHADER + // GL_FRAGMENT_SHADER + // GL_GEOMETRY_SHADER + // Returns index id of the newly created shader, 0 on error + // + // Will immediately return 0 if src is empty. + IGL_INLINE GLuint load_shader( + const std::string & src,const GLenum type); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "load_shader.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/print_program_info_log.cpp b/vendor/libigl/include/igl/opengl/print_program_info_log.cpp new file mode 100644 index 0000000000000000000000000000000000000000..41b37b7fbe4810a22b69b891504db8fa46d2098d --- /dev/null +++ b/vendor/libigl/include/igl/opengl/print_program_info_log.cpp @@ -0,0 +1,28 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "print_program_info_log.h" + +#include +#include +// Copyright Denis Kovacs 4/10/08 +IGL_INLINE void igl::opengl::print_program_info_log(const GLuint obj) +{ + GLint infologLength = 0; + GLint charsWritten = 0; + char *infoLog; + + glGetProgramiv(obj, GL_INFO_LOG_LENGTH,&infologLength); + + if (infologLength > 0) + { + infoLog = (char *)malloc(infologLength); + glGetProgramInfoLog(obj, infologLength, &charsWritten, infoLog); + printf("%s\n",infoLog); + free(infoLog); + } +} diff --git a/vendor/libigl/include/igl/opengl/print_program_info_log.h b/vendor/libigl/include/igl/opengl/print_program_info_log.h new file mode 100644 index 0000000000000000000000000000000000000000..43bcc09744f3bc6b414cc3f96f2b25087266749c --- /dev/null +++ b/vendor/libigl/include/igl/opengl/print_program_info_log.h @@ -0,0 +1,27 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_PRINT_PROGRAM_INFO_LOG_H +#define IGL_OPENGL_PRINT_PROGRAM_INFO_LOG_H +#include "../igl_inline.h" +#include "gl.h" + +namespace igl +{ + namespace opengl + { + // Inputs: + // obj OpenGL index of program to print info log about + IGL_INLINE void print_program_info_log(const GLuint obj); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "print_program_info_log.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/print_shader_info_log.cpp b/vendor/libigl/include/igl/opengl/print_shader_info_log.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2d3554387c24c1f34aa8457821d7866f9551e634 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/print_shader_info_log.cpp @@ -0,0 +1,29 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "print_shader_info_log.h" + +#include +#include +// Copyright Denis Kovacs 4/10/08 +IGL_INLINE void igl::opengl::print_shader_info_log(const GLuint obj) +{ + GLint infologLength = 0; + GLint charsWritten = 0; + char *infoLog; + + // Get shader info log from opengl + glGetShaderiv(obj, GL_INFO_LOG_LENGTH,&infologLength); + // Only print if there is something in the log + if (infologLength > 0) + { + infoLog = (char *)malloc(infologLength); + glGetShaderInfoLog(obj, infologLength, &charsWritten, infoLog); + printf("%s\n",infoLog); + free(infoLog); + } +} diff --git a/vendor/libigl/include/igl/opengl/print_shader_info_log.h b/vendor/libigl/include/igl/opengl/print_shader_info_log.h new file mode 100644 index 0000000000000000000000000000000000000000..5a571fb11692e170ff3dc410e4d2c8da7d4fa611 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/print_shader_info_log.h @@ -0,0 +1,27 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_PRINT_SHADER_INFO_LOG_H +#define IGL_OPENGL_PRINT_SHADER_INFO_LOG_H +#include "../igl_inline.h" +#include "gl.h" + +namespace igl +{ + namespace opengl + { + // Inputs: + // obj OpenGL index of shader to print info log about + IGL_INLINE void print_shader_info_log(const GLuint obj); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "print_shader_info_log.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/report_gl_error.cpp b/vendor/libigl/include/igl/opengl/report_gl_error.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2dcc0b6323e8dac154dc127b7348e2b80fdcc2a1 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/report_gl_error.cpp @@ -0,0 +1,61 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "report_gl_error.h" +#include "../verbose.h" +#include + +IGL_INLINE GLenum igl::opengl::report_gl_error(const std::string id) +{ + // http://stackoverflow.com/q/28485180/148668 + + // gluErrorString was deprecated + const auto gluErrorString = [](GLenum errorCode)->const char * + { + switch(errorCode) + { + default: + return "unknown error code"; + case GL_NO_ERROR: + return "no error"; + case GL_INVALID_ENUM: + return "invalid enumerant"; + case GL_INVALID_VALUE: + return "invalid value"; + case GL_INVALID_OPERATION: + return "invalid operation"; +#ifndef GL_VERSION_3_0 + case GL_STACK_OVERFLOW: + return "stack overflow"; + case GL_STACK_UNDERFLOW: + return "stack underflow"; + case GL_TABLE_TOO_LARGE: + return "table too large"; +#endif + case GL_OUT_OF_MEMORY: + return "out of memory"; +#ifdef GL_EXT_framebuffer_object + case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: + return "invalid framebuffer operation"; +#endif + } + }; + + GLenum err = glGetError(); + if(GL_NO_ERROR != err) + { + verbose("GL_ERROR: "); + fprintf(stderr,"%s%s\n",id.c_str(),gluErrorString(err)); + } + return err; +} + +IGL_INLINE GLenum igl::opengl::report_gl_error() +{ + return igl::opengl::report_gl_error(std::string("")); +} + diff --git a/vendor/libigl/include/igl/opengl/report_gl_error.h b/vendor/libigl/include/igl/opengl/report_gl_error.h new file mode 100644 index 0000000000000000000000000000000000000000..70e5c7d74f19a1bf130b13e0f3a346b878c8dc37 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/report_gl_error.h @@ -0,0 +1,36 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_REPORT_GL_ERROR_H +#define IGL_OPENGL_REPORT_GL_ERROR_H +#include "../igl_inline.h" + +// Hack to allow both opengl/ and opengl2 to use this (we shouldn't allow this) +#ifndef __gl_h_ +# include "gl.h" +#endif +#include + +namespace igl +{ + namespace opengl + { + // Print last OpenGL error to stderr prefixed by specified id string + // Inputs: + // id string to appear before any error msgs + // Returns result of glGetError() + IGL_INLINE GLenum report_gl_error(const std::string id); + // No prefix + IGL_INLINE GLenum report_gl_error(); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "report_gl_error.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/uniform_type_to_string.cpp b/vendor/libigl/include/igl/opengl/uniform_type_to_string.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2f9a2fdb4bc18cf13bda77d79de10c076a7a410 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/uniform_type_to_string.cpp @@ -0,0 +1,71 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "uniform_type_to_string.h" + +IGL_INLINE std::string igl::opengl::uniform_type_to_string(const GLenum type) +{ + switch(type) + { + case GL_FLOAT: + return "GL_FLOAT"; + case GL_FLOAT_VEC2: + return "GL_FLOAT_VEC2"; + case GL_FLOAT_VEC3: + return "GL_FLOAT_VEC3"; + case GL_FLOAT_VEC4: + return "GL_FLOAT_VEC4"; + case GL_INT: + return "GL_INT"; + case GL_INT_VEC2: + return "GL_INT_VEC2"; + case GL_INT_VEC3: + return "GL_INT_VEC3"; + case GL_INT_VEC4: + return "GL_INT_VEC4"; + case GL_BOOL: + return "GL_BOOL"; + case GL_BOOL_VEC2: + return "GL_BOOL_VEC2"; + case GL_BOOL_VEC3: + return "GL_BOOL_VEC3"; + case GL_BOOL_VEC4: + return "GL_BOOL_VEC4"; + case GL_FLOAT_MAT2: + return "GL_FLOAT_MAT2"; + case GL_FLOAT_MAT3: + return "GL_FLOAT_MAT3"; + case GL_FLOAT_MAT4: + return "GL_FLOAT_MAT4"; + case GL_FLOAT_MAT2x3: + return "GL_FLOAT_MAT2x3"; + case GL_FLOAT_MAT2x4: + return "GL_FLOAT_MAT2x4"; + case GL_FLOAT_MAT3x2: + return "GL_FLOAT_MAT3x2"; + case GL_FLOAT_MAT3x4: + return "GL_FLOAT_MAT3x4"; + case GL_FLOAT_MAT4x2: + return "GL_FLOAT_MAT4x2"; + case GL_FLOAT_MAT4x3: + return "GL_FLOAT_MAT4x3"; + case GL_SAMPLER_1D: + return "GL_SAMPLER_1D"; + case GL_SAMPLER_2D: + return "GL_SAMPLER_2D"; + case GL_SAMPLER_3D: + return "GL_SAMPLER_3D"; + case GL_SAMPLER_CUBE: + return "GL_SAMPLER_CUBE"; + case GL_SAMPLER_1D_SHADOW: + return "GL_SAMPLER_1D_SHADOW"; + case GL_SAMPLER_2D_SHADOW: + return "GL_SAMPLER_2D_SHADOW"; + default: + return "UNKNOWN_TYPE"; + } +} diff --git a/vendor/libigl/include/igl/opengl/uniform_type_to_string.h b/vendor/libigl/include/igl/opengl/uniform_type_to_string.h new file mode 100644 index 0000000000000000000000000000000000000000..ed0a93e9067e602448e77076bdcb13bc647094e8 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/uniform_type_to_string.h @@ -0,0 +1,31 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_OPENGL_UNIFORM_TYPE_TO_STRING_H +#define IGL_OPENGL_UNIFORM_TYPE_TO_STRING_H +#include "../igl_inline.h" +#include "gl.h" +#include + +namespace igl +{ + namespace opengl + { + // Convert a GL uniform variable type (say, returned from + // glGetActiveUniform) and output a string naming that type + // Inputs: + // type enum for given type + // Returns string name of that type + IGL_INLINE std::string uniform_type_to_string(const GLenum type); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "uniform_type_to_string.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/verasansmono_compressed.cpp b/vendor/libigl/include/igl/opengl/verasansmono_compressed.cpp new file mode 100644 index 0000000000000000000000000000000000000000..65111157dcc5697114f99a8ec9d247694ddcf234 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/verasansmono_compressed.cpp @@ -0,0 +1,67 @@ +#include "verasansmono_compressed.h" + +#include +#include +#include + +namespace igl +{ +namespace opengl +{ + +// The string below is a compression of a 256x256x256 font atlas where each pixel's grayscale value is represented by a byte. +// Source font atlas: https://github.com/prideout/recipes/blob/master/verasansmono.png +// The compression below is a pair: hex_value_of_pixel-recurrence_in_hex. If recurrence_in_hex==1, +// it was not appended to the pair and only the pixel value constitutes the item in the list. +// The method below can be used to recover the original format. +// For example, 0-d1e compresses to 3358 neighbouring pixels with value 0x00. +static char verasansmono_compressed_atlas[] = "0-d1e,66-4,0-4,66-4,0-17,44-2,0-8,44-2,0-9,22,66,0-18,1b,46,66,22,0-7,11,5d,1a,0-2,1b,46,66,22,0-4,24,55,5c,30,0-92,72-2,81,a0,0-4,72-2,81,a0,0-17,4c-2,0-8,6b-2,0-3,33,9a,0-4,35,a0,0-18,8e,7d,a0,35,0-6,4,5a,6e,b,0-2,8e,7d,a0,35,0-2,1,31,97,83,75,86,0-94,35,a0,0-6,35,a0,0-21,6b-2,0-3,35,a0,0-4,35,a0,0-18,2d,11,a0,35,0-6,1e,89,2f,0-3,2d,11,a0,35,0-2,e,75,77,1a,5,1f,0-83,12,63,8b-2,5c,0-3,13,67,8e,86,4a,3,0-3,35,a0,0-6,35,a0,0-c,84,49,0-4,49,84,0,64,97-2,64,0-3,1,1f,7a,92,57,77,6b,0,32,97,9a,a0,97-2,64,0,35,a0,2d,7a,90,64,8,0-4,1d-2,0-f,a0,35,0-6,5c,78,1,0-5,a0,35,0-2,27,92,32,0-85,b,66,8b,53,48,71,0-2,b,66,7a,48,5d,92,2a,0-3,35,a0,0-6,35,a0,0-c,6d,6e,0-4,6e,6c,0,2b,41,80,6b,0-3,10,73,7f,49,64,95,6b,0,15,41,61,a0,41-2,2b,0,35,a0,6c,4b,5e,97,3a,0-4,6b-2,0-f,a0,35,0-5,10,8e,38,0-6,a0,35,0-2,31,9c,25,4e,53,24,0-82,28,93,2d,3,1,6,0-2,28,92,3a,29,2e,7e,5e,0-3,35,a0,0-6,35,a0,0-c,46,92,5,5d,5c,4,93,46,0-3,6b-2,0-3,2b,95,22,1,13,7c,6b,0-3,35,a0,0-4,35,a0,21,1,9,73,62,0-4,50-2,0-f,a0,35,0-4,3,56,70,c,0-6,a0,35,0-2,35,9f,69,79,85,93,1e,0-81,33,9e,6,0-5,33,9e,9f-2,a0-2,6a,0-3,35,a0,0-6,35,a0,0-c,2d,97,29,6e-2,29,97,2c,0-3,6b-2,0-3,33,9e,4,0,2,6d,6b,0-3,35,a0,0-4,35,a0,3,0-2,6b,6a,0-15,a0,35,0-4,1d,88,32,0-7,a0,35,0-2,32,9d,33,5,1d,81,57,0-81,30,9a,13,0-5,2f,98,17,10-3,a,0-3,35,9f,2,0-5,35,9f,2,0-b,19,84,68,59-2,67,83,18,0-3,6b-2,0-3,30,9b,e,0,7,72,6b,0-3,35,a0,1,0-3,35,a0,0-3,6b-2,0-15,a0,35,0-4,58,7a,3,0-7,a0,35,0-2,28,92,8,0,3,6e,66,0-81,1c,86,5c,11,6,2c,0-2,1a,85,4f,10,4,1b,2e,0-3,2d,98,26,1,0-4,2d,98,26,1,0-a,8,72,94,3d,3f,94,71,8,0-3,6b-2,0-3,1f,8a,4a,8,30,8d,6b,0-3,31,9c,1e,1,0-2,35,a0,0-3,6b-2,0-4,3c-2,0-f,a0,35,0-3,f,8d,3a,0-8,a0,35,0-2,14,7f,3d,6,23,84,52,0-81,2,3d,8c,8e,8b,84,0-2,2,38,89,8d-2,89,57,0-3,10,6c,91,8e,5e,0-3,10,6c,91,8e,5e,0-a,53,8d,23-2,8e,53,0,2f,8e-2,9a-2,8e-2,2f,4,4e,90,8e,77,88,6b,0-3,19,79,90,8e,5e,0,35,a0,0-3,6b-2,0-4,6b-2,0-d,8e-2,a0,93,8e,2f,3,53,73,e,0-6,8e-2,a0,93,8e,2f,1,3b,8b,8d,8f,84,13,0-83,27,43-2,22,0-4,23,41,46,33,b,0-4,12,41,49,31,0-4,12,41,49,31,0-a,1c,3b,9,a,3b,1c,0,18,4a-6,18,0,4,36,46,21,32,31,0-3,1,1b,43,49,31,0,18,4a,0-3,31-2,0-4,31-2,0-d,4a-5,18,1c,86,33,0-7,4a-5,18,0,1,2c,45,3f,19,0-ea,6,13,4,0-5a5,15-4,0-4,15-4,0-c,7,15,0-11,e-2,0-b,7,15,0-22,d,6,0-2,1,9,12,15,10,5,0-4,d,14,10,3,0-4,d,14,10,3,0-7,4,14,6,1,9,12,15,10,5,0-3,3,10,15,12,8,0-6,e,15,0-4,6,d,0-9,4,14,6,0-2,8,12,13,a,0-52,a0-4,0-4,a0-4,0-c,35,a0,0-11,6b-2,0-b,35,a0,0-8,18,4a,0-17,4,6d,21,0-2,1e,6e,93,9d,8a,5a,8,0-2,1b,7c,9a,88,3f,0-3,1b,7c,9a,88,3f,0-7,33,86,1c,1e,6e,93,9d,8a,5a,8,0,6,43,8c,9d,92,68,d,0-4,6,83,a0,0-4,21,6d,4,0-8,33,86,1c,0,e,68,92,98,72,0-52,22-2,4c,a0,0-4,22-2,4c,a0,0-c,35,a0,0-11,17-2,0-b,35,a0,0-8,35,a0,0-17,32,6c,7,0-2,28,5d,30,25,4d,90,43,0,9,68,7b,30,61,92,10,0,9,68,7b,30,61,92,10,0-5,e,73,53,3,28,5d,30,25,4d,90,43,0,26,90,59,28,44,8e,4b,0-3,2,42,81,a0,0-4,7,6d,33,0-7,e,73,53,3,4,58,90,4c,2a,57,0-44,25,3f-2,20,0-3,1,28,41,3c,16,0-4,35,a0,0-6,35,a0,0-c,35,a0,b,34,43,26,0-3,1,28,41,3c,16,0-3,2f,47-2,2f,0-4,4,33,43,20,30,2f,0,35,a0,b,34,43,26,0-2,18,47,64,a0,47-2,2f,0-13,7,6d,44,0-7,5,70,65,0,21,8b,2f,0,18,83,41,0,21,8b,2f,0,18,83,41,0-5,3a,8d,f,0-5,5,70,65,0,32,9d,8,0,4,6f,64,0-3,1c,75,40,a0,0-5,45,6d,7,0-6,3a,8d,f,0,1c,87,50,2,0-44,2,3a,8b,90,8e,84,0-2,2,3a,89,8f,90,7e,d,0-3,35,a0,0-6,35,a0,0-c,35,a0,58,88,93,8d,1c,0,2,3a,89,8f,90,7e,d,0-2,61,90,9b,6b,0-3,3,4b,91,90,77,88,6b,0,35,a0,58,88,93,8d,1c,0,30,90,96,a0,90-2,61,0-4,52-2,0-d,1c,86,24,0-5,5,10,35,85,3f,0,2e,99,e,8,10,72,5c,0,2e,99,e,8,10,72,5c,0-4,3,7a,58,0-4,5,10,35,85,3f,0,1b,7f,44,15,30,82,35,0-2,1,58,4a,35,a0,0-5,24,86,1c,0-5,3,7a,58,0-2,2d,97,23,d,e,6,0-42,1b,86,5d,12,8,2e,0-2,1a,85,3f,8,1e,81,4c,0-3,35,a0,0-6,35,a0,0-c,35,a0,4d,a,20,84,56,0,1a,85,3f,8,1e,81,4c,0-4,6b-2,0-3,1f,89,4e,9,2f,8d,6b,0,35,a0,4d,a,20,84,56,0-3,35,a0,0-7,6b-2,0-d,2d,97,c,0-5,35,a0,9d,67,1,0,34,9f,2,53-2,6c,68,0,34,9f,2,53-2,6c,68,0-4,32,88,1d,0-4,35,a0,9d,67,1,0-2,30,97,a0,9b,5f,0-3,1d,78,14,35,a0,0-5,d,97,2d,0-5,32,88,1d,0-2,34,9f,4b,90,95,65,8,0-41,2f,9a,13,0-5,2f,9a,7b,77,79,94,66,0-3,35,a0,0-6,35,a0,0-c,35,a0,d,0,3,6d,68,0,2f,9a,7b,77,79,94,66,0-4,6b-2,0-3,30,9b,e,0,7,72,6b,0,35,a0,d,0,3,6d,68,0-3,35,a0,0-7,1a-2,0-d,33,9e,3,0-5,d,29,55,87,24,0,33,9e,3,15,17,6d,66,0,33,9e,3,15,17,6d,66,0-3,c,70,56,3,0-4,d,29,55,87,24,0,12,70,66,30,51,87,26,0,9,66,41,1,35,a0,0-5,3,9e,33,0-4,c,70,56,3,0-2,34,9f,5d,30,4f,93,3c,0-41,33,9e,6,0-5,33,9d,60,5f-3,3f,0-3,35,a0,0-6,35,a0,0-c,35,a0,0-3,6b-2,0,33,9d,60,5f-3,3f,0-4,6b-2,0-3,33,9e,4,0,2,6d,6b,0,35,a0,0-3,6b-2,0-3,35,a0,0-16,33,9d,4,0-7,7,72,5f,0,2d,97,12,0,9,74,58,0,2d,97,12,0,9,74,58,0-3,38,8e,10,0-7,7,72,5f,0,30,9a,b,0,6,70,5f,0,2d,93,44,41,61,a0,41,15,0-3,4,9d,33,0-4,38,8e,10,0-3,2e,98,c,0,5,70,64,0-41,29,93,2b,2,1,4,0-2,28,92,1c,2,1,3,5,0-3,33,9d,8,0-5,33,9d,8,0-b,35,a0,0-3,6b-2,0,28,92,1c,2,1,3,5,0-4,6b-2,0-3,2b,95,22,1,11,7a,6b,0,35,a0,0-3,6b-2,0-3,34,9f,5,0-6,6-2,0-d,2b,95,f,0-3,3,5,1-2,d,76,63,0,1d,88,38,1,1e,87,3a,0,1d,88,38,1,1e,87,3a,0-2,1,78,5c,0-4,3,5,1-2,d,76,63,0,32,9d,12,1,a,73,63,0,32,97-3,9a,a0,97,32,0-3,10,95,2b,0-3,1,78,5c,0-4,20,8b,13,1,9,73,61,0-41,b,68,8b,50,45,6e,0-2,a,64,86,4e,43,5b,5c,0-3,1f,8a,63,3f,29,0-3,1f,8a,63,3f,29,0-9,35,a0,0-3,6b-2,0,a,64,86,4e,43,5b,5c,0,15,3d-2,7f-2,3d-2,15,f,73,81,47,60,94,6b,0,35,a0,0-3,6b-2,0-3,28,92,5d,3f,29,0-4,6b-2,0-d,18,83,29,0-3,2e,70,46,42,6f,97,2e,0,5,5d,88,4a,73,8c,9,0,5,5d,88,4a,73,8c,9,0-2,2f,89,1e,0-4,2e,70,46,42,6f,97,2e,0,1a,83,77,44,62,97,34,0-5,35,a0,0-5,29,83,18,0-3,2f,89,1e,0-4,8,63,78,44,60,95,31,0-42,14,67,8f-2,5f,0-3,12,62,8d,94,79,2f,0-3,5,3d,8d,99,66,0-3,5,3d,8d,99,66,0-9,33,9a,0-3,66-2,0-2,12,62,8d,94,79,2f,0,33,9a-6,33,1,20,7d,95,59,77,68,0,33,9a,0-3,66-2,0-3,9,4e,90,99,66,0-4,66-2,0-d,5,67,4b,0-3,17,61,8e,97,7f,43,3,0-2,12,6e,93,7c,30,0-3,12,6e,93,7c,30,0-2,b,6e,5a,4,0-4,17,61,8e,97,7f,43,3,0,3,2b,7e,96,88,4f,5,0-5,33,9a,0-5,4b,68,5,0-2,b,6e,5a,4,0-5,15,6e,93,89,51,4,0-82,1d,e,3,1d,81,4e,0-24,26,72,a,0-1a,1a,5d,11,0-1f,b,73,26,0-3,1a,5d,11,0-8e,61,7a,70,81,91,17,0-24,3,66,23,0-3c,23,67,3,0-94,12,50,64,52,1a,0-1264,e,2f,47,50,55,1c,0-8,1c,55,39,0-9,1c,55,50,46,2f,d,0-df,1f,ae,d9,f1,fa,ff,55,0-8,55,ff,aa,0-9,55,ff,fa,f0,d9,ad,1d,0-6c,aa,ff-2,0-6e,13,b7,ff,fd,ca,b2,aa,39,0-8,55,ff,aa,0-9,39,aa,b2,cb,fd,ff,b6,12,0-6b,aa,ff-2,0-6e,37,e1,ff,bf,20,8,0-a,55,ff,aa,0-b,8,21,c2,ff,e1,37,0-6b,aa,ff-2,0-6e,4e,f8,ff,69,0-c,55,ff,aa,0-d,6a,ff,f8,4e,0-2c,8,44,91,a2,88,4b,1,0-8,25,7c,9e,98,6a,f,0-e,23,81,a3,9b,72,19,0-5,5,38,82,9e,a6,9b,7a,50,f,0-8,aa,ff-2,0-6e,54,fe,ff,57,0-c,55,ff,aa,0-d,57,ff,fe,54,0-1b,10,40,52,47,24,0-8,55,ff-2,6c,bc,fd,ff-4,b5,2b,0-5,9,8e,f3,ff-4,da,4a,ff-2,aa,0-5,55,ff-2,56,75,ef,ff-4,aa,0-4,24,c2,fd,ff-6,aa,0-4,aa,ff-b,55,0-4,55,ff-2,55,0-5,aa,ff-2,0-3,79,ff-2,59,0-6,5a,ff-2,79,0,df,ff,c4,1a,0-8,1a,c4,ff,de,0,4c,f7,ff,d5,30,0-3,6,ab,ff,fb,9d,0-3,72,ff-2,6e,0-6,62,ff-2,75,0-3,55,ff-a,55,0-8,55,ff-2,55,0-c,55,ff,aa,0-d,55,ff-2,55,0-1a,38,a9,ea,fd,f1,cd,57,8,0-6,55,ff-2,da,fa,b7,64,63,b3,f9,fd,bc,3,0-3,2,6b,fa,ff,d1,78,5f,8a,f5,d9,ff-2,aa,0-5,55,ff-2,86,f1,d8,76,5b,78,c9,aa,0-3,10,a4,ff-2,ae,6d,59,68,a8,ee,aa,0-4,aa,ff-b,55,0-4,55,ff-2,55,0-5,aa,ff-2,0-3,2a,ff-2,a2,6,0-4,7,a3,ff-2,29,0,aa,ff,de,34,0-8,34,de,ff,a9,0,3,9e,fe,fd,ab,0-3,59,fb,ff,cd,27,0-3,1d,fa,ff,b6,12,0-4,b,ab,ff,fd,23,0-3,55,ff-a,55,0-8,55,ff-2,55,0-c,55,ff,aa,0-d,55,ff-2,55,0-19,10,ba,f9,ff-4,d4,46,0-6,55,ff-3,73,5,0-2,4,70,ff-2,6d,1,0-2,37,e0,ff,c2,9,0-3,43,e2,ff-2,aa,0-5,55,ff-2,f2,9e,13,0-3,2,40,0-3,42,ec,ff,98,0-5,11,4f,0-8,aa,ff-2,0-a,55,ff-2,55,0-5,aa,ff-2,0-4,c5,ff,db,31,0-4,32,dc,ff,c5,0-2,6a,fe,fa,59,0-8,59,fa,fd,69,0-2,1b,b7,ff-2,70,6,41,e0,ff,f0,36,0-5,a5,ff,ef,4b,0-4,3c,e5,ff,b7,0-a,2,55,ff-2,db,33,0-8,57,ff-2,55,0-c,55,ff,aa,0-d,55,ff-2,56,0-19,64,ff-7,b9,0-6,55,ff-2,e3,c,0-4,c,e2,ff,b7,12,0-2,77,fd,f1,52,0-4,7,96,ff-2,aa,0-5,55,ff-2,f4,1e,0-9,52,fc,ff,61,0-f,aa,ff-2,0-a,55,ff-2,55,0-5,aa,ff-2,0-4,76,fe,fa,61,0-4,62,fa,fe,76,0-2,45,ee,ff,89,0-8,89,ff,ee,44,0-3,37,f7,ff,de,3f,c0,fe,fb,86,0-6,55,f4,ff,96,0-4,77,fd,fb,66,0-a,29,ce,ff-2,69,5,0-8,63,ff,fb,51,0-c,55,ff,aa,0-d,51,fb,ff,62,0-19,99,ff-7,ee,0-6,55,ff-2,95,0-6,95,ff,df,35,0-2,bf,ff,ca,20,0-5,41,ff-2,aa,0-5,55,ff-2,a5,0-a,4a,f4,ff,c6,35,13,0-d,aa,ff-2,0-a,55,ff-2,55,0-5,aa,ff-2,0-4,34,de,ff,c0,0-4,c1,ff,de,34,0-2,23,cd,ff,cb,0-2,42,eb,e9,3f,0-2,cb,ff,cd,23,0-4,6e,f4,ff,f6,ff-2,a4,11,0-6,18,bf,ff,f3,14,0-2,4,da,ff,d1,27,0-9,8,b8,ff,fc,a3,0-a,a5,ff,e7,3d,0-c,55,ff,aa,0-d,3d,e7,ff,a4,0-8,d,31,4d,53,49,31,a,0-5,1a,13,0-3,99,ff-7,ee,0-6,55,ff-2,6e,0-6,6e,ff,f1,47,0-2,e4,ff,b6,c,0-5,1a,ff-2,aa,0-5,55,ff-2,75,0-a,27,d1,ff-2,df,bd,90,5e,18,0-a,aa,ff-2,0-a,55,ff-2,55,0-5,aa,ff-2,0-4,d,b4,ff,f7,18,0-2,19,f7,ff,b4,e,0-2,a,b2,ff,f7,9,0,6d,fd-2,68,0,9,f6,ff,b2,a,0-4,13,ab,ff-3,eb,24,0-7,1,7b,ff-2,63,0-2,35,fe,ff,9e,6,0-8,1,62,fd,ff,d1,2b,0-7,1,1a,66,f1,ff,bc,17,0-c,55,ff,aa,0-d,16,bb,ff,f1,65,1a,1,0-4,32,af,db,f7,fd,f3,db,a9,64,1d,5,1a,59,c2,4c,0-3,64,ff-7,b9,0-6,55,ff-2,5a,0-6,5b,ff,fb,51,0-2,f8,ff,ac,2,0-5,6,ff-2,aa,0-5,55,ff-2,5a,0-b,43,d8,fb,ff-4,f6,a4,17,0-8,aa,ff-2,0-a,55,ff-2,55,0-5,aa,ff-2,0-5,5e,ff-2,74,0-2,74,ff-2,5f,0-4,7a,ff-2,42,0,b8,e9,ec,b3,0,42,ff-2,7b,0-6,14,e5,ff,f1,5a,0-9,17,f4,ff,bf,16,5,99,ff-2,3c,0-9,46,e3,ff,f3,3c,0-7,55,ff-3,f1,ad,1c,0-d,55,ff,aa,0-e,19,aa,f0,ff-3,55,0-3,aa,f3,ce,b1,ad,bd,d9,fc,ff-5,eb,45,0-3,10,ba,f9,ff-4,d4,46,0-6,55,ff-2,5a,0-6,5b,ff,fb,51,0-2,f9,ff,ac,2,0-5,6,ff-2,aa,0-5,55,ff-2,55,0-c,2e,6d,b8,ea,ff-4,90,a,0-7,aa,ff-2,0-a,55,ff-2,55,0-5,aa,ff-2,0-5,15,f8,ff,b4,f,10,b4,ff,f9,16,0-4,45,ff-2,77,5,ef,ac,b1,ec,4,76,ff-2,46,0-6,13,e3,ff,f1,59,0-a,b0,ff,ec,44,24,ce,ff,e0,6,0-8,6,c5,ff,fc,8e,1,0-7,55,ff-3,f1,a8,16,0-d,55,ff,aa,0-e,14,a5,f0,ff-3,55,0-3,85,56,24,7,3,13,2f,65,ab,eb,fa,e1,a9,45,c,0-4,38,a9,ea,fd,f1,cd,57,8,0-6,55,ff-2,6e,0-6,6e,ff,f2,48,0-2,e6,ff,b6,c,0-5,1a,ff-2,aa,0-5,55,ff-2,55,0-f,1,38,91,f5,ff,e6,3c,0-7,aa,ff-2,0-a,55,ff-2,55,0-4,3,ad,ff-2,0-6,aa,ff,e8,3f,40,e8,ff,ab,0-5,b,f8,ff,b0,4a,fb,61,64,fc,46,af,ff,f8,c,0-5,14,ac,ff-3,eb,27,0-9,4c,f1,ff,a2,61,fa,fe,7e,0-8,a,8a,ff-2,ab,15,0-9,2,1b,66,f1,ff,b8,15,0-c,55,ff,aa,0-d,15,b7,ff,f0,64,1b,2,0-18,10,40,53,47,24,0-8,55,ff-2,95,0-6,94,ff,e0,36,0-2,c2,ff,c9,1f,0-5,41,ff-2,aa,0-5,55,ff-2,55,0-11,6,9a,ff,fa,50,0-7,aa,ff-2,0-a,53,fd,ff,5b,0-4,e,b8,ff-2,0-6,60,fa,fd,79,7a,fd,fa,61,0-6,ce,ff,cc,a0,e3,39,3b,e5,9c,cb,ff,cf,0-6,76,f5,ff,f6,ff-2,a9,15,0-8,1c,c6,ff,ee,bd,ff,e8,40,0-8,4b,e8,ff,f0,2b,0-d,a2,ff,e6,3c,0-c,55,ff,aa,0-d,3c,e6,ff,a1,0-28,55,ff-2,e3,c,0-4,b,e2,ff,ba,14,0-2,7a,fd,f0,51,0-4,7,96,ff-2,aa,0-5,55,ff-2,55,0-12,63,ff,fb,51,0-7,9f,ff-2,f,0-9,47,f1,ff,83,0-4,33,dc,ff-2,0-6,26,d0,ff,d8-2,ff,d1,27,0-6,8c,ff,f4-2,bb,12,14,bc," +"f2,f3,ff,8d,0-4,1,44,fb,ff,dc,3d,bd,fe,fd,94,2,0-8,71,ff-4,b1,e,0-7,1b,e2,ff,f0,5e,0-e,61,ff,fb,51,0-c,55,ff,aa,0-d,51,fb,ff,61,0-28,55,ff-3,73,5,0-2,4,6f,ff-2,71,1,0-2,39,e2,ff,c0,8,0-3,43,e2,ff-2,aa,0-5,55,ff-2,55,0-a,2b,4e,1,0-4,3,b2,ff,e6,3c,0-7,82,ff-2,48,0-9,31,db,ff,d1,6,0-3,8f,fb,ff-2,0-6,6,a0,ff,fd-2,ff,a2,6,0-6,5b,fb,ff-2,8d,1,2,8f,ff-2,fc,5d,0-4,25,c6,ff-2,66,5,3a,db,ff,f5,49,0-8,1c,f9,ff-3,6b,0-7,a,93,ff-2,9d,e,0-e,56,ff-2,55,0-c,55,ff,aa,0-d,55,ff-2,56,0-28,55,ff-2,db,f9,b6,63,62,b3,f9,fd,bf,4,0-3,2,6d,fa,ff,d0,77,5e,8a,f5,d7,ff-2,aa,0-5,55,ff-2,55,0-a,55,ff,dc,9a,65,58,75,c5,ff-2,91,a,0-7,31,f8,ff,e3,85,58,55-2,1c,0-4,8,9b,ff-2,bf,6a,66,ad,df,e1,ff-2,0-7,43,ff-4,45,0-7,35,df,ff-2,3f,0-2,41,ff-2,e0,36,0-3,a,b7,ff,fa,9a,0-3,4a,f6,ff,da,39,0-8,a4,ff-2,f3,10,0-7,4c,f6,ff,f7,62,55-6,1c,0-8,55,ff-2,55,0-c,55,ff,aa,0-d,55,ff-2,55,0-28,55,ff-2,6d,c1,fe,ff-4,b7,2d,0-5,9,8f,f3,ff-4,da,49,ff-2,aa,0-5,55,ff-2,55,0-a,55,ff-7,f8,a8,17,0-8,3,93,f7,ff-5,55,0-5,26,e0,ff-4,f6,5c,b0,ff-2,0-7,9,ea,ff-2,eb,a,0-7,1b,c5,ff,f4,a,0-2,b,f4,ff,c6,1c,0-2,2,6a,fd,ff,c7,23,0-3,2,95,fd,fe,bb,4,0-7,5b,fa,ff,b1,0-8,55,ff-a,55,0-8,55,ff-2,55,0-c,55,ff,aa,0-d,55,ff-2,55,0-28,55,ff-2,55,9,48,93,a2,89,4c,1,0-8,26,7d,9f,99,6b,10,0,ff-2,aa,0-5,39,aa-2,39,0-a,6,2c,62,84,a0,a7,99,76,27,1,0-a,2,2c,7c,9b,a9,aa-2,39,0-6,16,69,a2,a3,73,22,0,71,aa-2,0-8,6d,aa-2,6e,0-8,2,70,aa,7f,0-4,80,aa,72,2,0-2,24,95,aa-2,2b,0-5,15,87,aa-2,47,0-7,8c,ff,f5,54,0-8,39,aa-a,39,0-8,54,fe,ff,57,0-c,55,ff,aa,0-d,57,ff,fe,54,0-28,55,ff-2,55,0-16,ff-2,aa,0-76,4,e0,ff,d0,26,0-1c,4e,f8,ff,68,0-c,55,ff,aa,0-d,6a,ff,f8,4e,0-28,55,ff-2,55,0-16,ff-2,aa,0-75,1,60,ff-2,88,1,0-1c,37,e1,ff,bf,1f,7,0-a,55,ff,aa,0-b,8,20,c2,ff,e1,37,0-28,55,ff-2,55,0-16,ff-2,aa,0-74,1,3e,cd,ff,fd,2c,0-1d,13,b8,ff,fd,c9,b1,aa,39,0-8,55,ff,aa,0-9,39,aa,b2,ca,fd,ff,b6,12,0-28,55,ff-2,55,0-16,ff-2,aa,0-73,55,ff-3,f5,83,0-1f,20,af,d9,f1,fa,ff,55,0-8,55,ff,aa,0-9,55,ff,fa,f1,d9,ae,1e,0-29,55,ff-2,55,0-16,ff-2,aa,0-73,55,ff,fa,dd,70,13,0-20,e,2f,47,50,55,1c,0-8,55,ff,aa,0-9,1c,55,50,47,2f,e,0-ee,55,ff,aa,0-fd,1c,55,39,0-43a,20,55,52,8,0-fc,21,dc,fc,66,2,0-fc,34,d2,e9,53,0-1a,55,ff-2,55,0-25,aa,ff-2,0-19,9,63,b6,ed,fc,ff-2,aa,0-13,55,ff-2,55,0-11,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,0-b,aa,ff-6,aa,0-3b,2,45,f7,d5,12,0-19,55,ff-2,55,0-25,aa,ff-2,0-18,3,70,f6,ff-5,aa,0-13,55,ff-2,55,0-11,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,0-b,aa,ff-6,aa,0-3d,5c,eb,aa,14,0-18,55,ff-2,55,0-25,aa,ff-2,0-18,30,da,ff,cc,2b,6,0-16,55,ff-2,55,0-11,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,0-10,ff-2,aa,0-3d,a,42,4a,12,0-18,55,ff-2,55,0-25,aa,ff-2,0-18,4a,f4,ff,6c,0-18,55,ff-2,55,0-11,39,55-2,0-e,55-2,39,0-8,aa,ff-2,0-10,ff-2,aa,0-4a,6,21,35,47,50,54,4d,35,13,0-6,55,ff-2,55,4,23,49,51,44,26,1,0-9,9,2a,48,52,51,48,30,14,0-6,a,2f,4c,50,3e,18,0,aa,ff-2,0-6,1,18,40,50,52,43,1a,1,0-a,54,fe,ff,55,0-a,a,2f,4d,50,3d,17,0-8,55,ff-2,55,2,1a,45,51,47,25,0-27,aa,ff-2,0-10,ff-2,aa,0-b,9,38,51,36,1,4,3c,52,3d,d,0-8,2,1d,47,53,49,28,0-9,10,3a,4e,53,4a,2a,7,0-17,77,cb,df,f1,fa,fe,f7,df,ba,40,2,0-4,55,ff-2,55,6e,cb,f3,fb,ee,d0,65,a,0-7,21,a2,d4,f2,fc,fb,f2,da,be,0-5,13,9c,d9,f6,fa,e8,bf,33,aa,ff-2,0-6,60,bd,ea,fa,fc,ed,bf,5a,0-6,39,aa-3,c6,ff-2,c6,aa-4,71,0-4,10,99,d9,f7,fa,e7,bd,2c,71,aa-2,0-4,55,ff-2,55,4e,be,ef,fb,f1,cf,49,0-6,71,aa-6,0-a,aa-6,71,0-8,aa,ff-2,0-5,1b,a4,aa-2,75,0-6,ff-2,aa,0-8,71,aa-2,69,e2,fb,e0,4a,66,e6,fc,e7,85,0-4,39,aa-2,39,54,c2,f1,fd,f3,d2,4d,1,0-6,3c,ad,e4,f8,fd,f4,d4,97,10,0-16,aa,fc,e5,c1,b1,ad,b9,e5,fe,f2,71,0-4,55,ff-2,bb,fc,db,b1-2,da,fc,fb,95,2,0-5,56,e4,ff,f4,c3,af,b0,c0,e8,fe,0-4,24,c4,ff,f9,c3,af,bd,ea,dd-2,ff-2,0-4,f,8a,ff,fc,ca,b0,b4,d6,ff-2,6d,6,0-4,55,ff-b,aa,0-3,20,bd,ff,fb,c7,af,ba,e7,d7-2,ff-2,0-4,55,ff-2,98,f4,cc,ae,bc,f6,ff,e2,3d,0-5,aa,ff-6,0-a,ff-6,aa,0-8,aa,ff-2,0-4,39,cf,ff-2,aa,1d,0-6,ff-2,aa,0-8,aa,ff-2,d5,b3,f4,ff,ee,e6,b5,d9,ff,fe,26,0-3,55,ff-2,9e,f4,cc,ae,bc,f6,ff,e4,3f,0-4,2,49,f7,ff,e7,ba,ad,c2,f9,ff,c4,26,0-15,8f,74,3b,17,7,3,f,48,cf,ff,eb,17,0-3,55,ff-2,fd,ba,36,7-2,35,b9,ff,f8,3d,0-4,1a,e1,ff,e3,67,19,5,6,16,44,a5,0-4,8e,fb,f7,88,19,5,13,4b,f1,fe,ff-2,0-4,62,f1,f8,92,20,6,a,2c,c3,ff,de,34,0-4,1c,55-3,8e,ff-2,8e,55-4,39,0-3,84,fa,f9,92,1d,5,10,45,ed,fd,ff-2,0-4,55,ff-2,f5,91,22,4,12,89,fa,fe,89,0-5,39,55-3,c6,ff-2,0-a,55-4,ff-2,aa,0-8,aa,ff-2,0-3,20,d1,fe,ff,c3,1c,0-7,ff-2,aa,0-8,aa,ff-2,5d,9,aa,ff-2,b1,b,54,ff-2,60,0-3,55,ff-2,f6,91,22,4,12,89,fa,fe,8b,0-4,21,c5,ff,ed,46,10,3,18,87,f6,fb,92,0-1d,4b,ff-2,69,0-3,55,ff-2,f1,1b,0-4,19,f1,ff,ad,b,0-2,6,97,ff,fc,49,0-a,16,f7,ff,a7,c,0-4,6b,f9,ff-2,0-3,b,e6,ff,9e,a,0-4,38,e1,ff,91,0-8,55,ff-2,55,0-7,12,f4,ff,ad,f,0-4,66,f8,ff-2,0-4,55,ff-2,d8,4,0-3,22,cc,ff,d1,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,0-2,3f,d4,ff-2,a3,19,0-8,ff-2,aa,0-8,aa,ff-2,1b,0,6e,ff-2,71,0,18,ff-2,8a,0-3,55,ff-2,d8,4,0-3,22,cc,ff,d3,0-4,6d,fd,f7,64,0-4,c,a7,ff,fa,1a,0-1c,14,ff-2,90,0-3,55,ff-2,b3,0-6,b2,ff,d4,2a,0-2,23,cd,ff,ce,3,0-a,54,ff-2,5c,0-5,30,da,ff-2,0-3,44,ff-2,45,0-5,14,be,ff,cd,0-8,55,ff-2,55,0-7,4f,ff-2,61,0-5,2e,d8,ff-2,0-4,55,ff-2,8f,0-4,a,b4,ff,ee,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,0,26,d6,fe,ff,bc,18,0-9,ff-2,aa,0-8,aa,ff-2,a,0,5f,ff-2,60,0,9,ff-2,9c,0-3,55,ff-2,8f,0-4,a,b4,ff,f0,0-4,af,ff,d7,2d,0-5,5b,ff-2,58,0-15,4,1e,3f,4d,54,55-3,ff-2,a4,0-3,55,ff-2,76,0-6,77,ff,ef,45,0-2,43,ed,ff,81,0-b,8a,ff-2,21,0-5,11,bb,ff-2,0-3,86,ff-2,5e,54-3,55-2,57,c9,ff,f4,0-8,55,ff-2,55,0-7,87,ff-2,22,0-5,11,bb,ff-2,0-4,55,ff-2,62,0-4,1,ab,ff,fc,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,45,d9,ff,fe,9b,16,0-a,ff-2,aa,0-8,aa,ff-2,1,0,57,ff-2,56,0,2,ff-2,a7,0-3,55,ff-2,62,0-4,1,ab,ff,fe,0-4,e2,ff,b9,f,0-5,1f,ff-2,8c,0-14,f,8c,c8,e9,f7,fe,ff-5,a9,0-3,55,ff-2,5f,0-6,60,ff,f9,4f,0-2,50,fa,ff,63,0-b,9e,ff-2,a,0-5,6,b0,ff-2,0-3,a0,ff-2,fe-4,ff-5,fe,0-8,55,ff-2,55,0-7,9d,ff-2,b,0-5,5,af,ff-2,0-4,55,ff-2,57,0-5,aa,ff-2,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,db,ff-2,f6,20,0-b,ff-2,aa,0-8,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,57,0-5,aa,ff-2,0-4,f7,ff,ae,4,0-5,9,ff-2,a1,0-13,2b,ca,ff,fe,d5,ba,ac,aa-3,ff-2,aa,0-3,55,ff-2,58,0-6,59,ff,fc,52,0-2,54,fe,ff,59,0-b,a5,ff-2,3,0-5,2,ac,ff-2,0-3,a8,ff,f8,aa-a,0-8,55,ff-2,55,0-7,a6,ff-2,3,0-5,2,ac,ff-2,0-4,55,ff-2,55,0-5,aa,ff-2,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-6,98,d,0-a,ff-2,aa,0-8,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,55,0-5,aa,ff-2,0-4,fd,ff,ab,1,0-5,2,ff-2,a8,0-13,90,fd,fa,9b,2b,10,2,0-2,7,ff-2,aa,0-3,55,ff-2,63,0-6,63,ff,f6,4c,0-2,4e,f8,ff,68,0-b,99,ff-2,d,0-5,7,b1,ff-2,0-3,9c,ff,f2,0-12,55,ff-2,55,0-7,9a,ff-2,f,0-5,7,b1,ff-2,0-4,55,ff-2,55,0-5,aa,ff-2,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,fd,af,e2,ff,ee,5a,0-a,ff-2,aa,0-8,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,55,0-5,aa,ff-2,0-4,f3,ff,b0,6,0-5,d,ff-2,9e,0-13,e7,ff,c0,16,0-5,29,ff-2,aa,0-3,55,ff-2,8b,0-6,8a,ff,e4,3a,0-2,38,e2,ff,9d,0-b,75,ff-2,33,0-5,1b,c5,ff-2,0-3,72,ff-2,1e,0-11,55,ff-2,55,0-7,75,ff-2,38,0-5,1b,c5,ff-2,0-4,55,ff-2,55,0-5,aa,ff-2,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,8c,10,4a,e8,ff,ee,27,0-9,fe,ff,aa,0-8,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,55,0-5,aa,ff-2,0-4,d2,ff,c3,19,0-5,32,ff-2,7c,0-13,fc,ff,ae,4,0-5,6d,ff-2,aa,0-3,55,ff-2,c5,0-6,c3,ff,cb,21,0-2,1a,c4,ff,e3,8,0-a,43,ff-2,6c,0-5,39,e3,ff-2,0-3,37,ff-2,67,0-11,55,ff-2,55,0-7,41,ff-2,76,0-5,38,e2,ff-2,0-4,55,ff-2,55,0-5,aa,ff-2,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,f,0,9,86,ff-2,a6,12,0-8,f5,ff,af,5,0-7,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,55,0-5,aa,ff-2,0-4,a1,ff,e0,36,0-5,6d,ff-2,4c,0-13,e0,ff,cd,24,0-4,3d,d8,ff-2,aa,0-3,55,ff-3,4e,3,0-2,2,4b,ff-2,85,1,0-3,66,ff-2,8e,f,0-4,2,26,0-3,2,d9,ff,cd,27,0-3,6,a3,ff-3,0-4,c0,ff,d8,3e,0-5,1,28,16,0-8,55,ff-2,55,0-7,2,d6,ff,d4,32,0-3,4,a0,ff-3,0-4,55,ff-2,55,0-5,aa,ff-2,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,0-3,4,be,fe,fb,88,0-8,c9,ff,d0,26,0-7,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,55,0-5,aa,ff-2,0-4,4e,f1,ff,9b,4,0-3,28,cd,ff,e2,7,0-13,96,ff,f8,ab,2a,6,18,58,d3,e6,ff-2,aa,0-3,55,ff-2,fc,d9,64,e,d,61,d6,ff,ef,1f,0-4,d,c7,ff,f1,a3,32,9,a,28,79,cd,0-4,6c,f7,fb,b9,32,8,24,85,f7,fd,ff-2,0-4,4b,e6,fe,d5,5c,1a,3,12,49,8c,d2,4e,0-8,55,ff-2,55,0-8,68,f5,fc,c5,3c,b,20,7e,ef,f7,ff-2,0-4,55,ff-2,55,0-5,aa,ff-2,0-9,aa,ff-2,0-e,ff-2,aa,0-8,aa,ff-2,0-4,3f,df,ff,f1,37,0-7,7f,fe,f8,99,14,1,0-5,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,55,0-5,aa,ff-2,0-4,15,b3,ff,f6,7d,20,6,30,b9,fb,f9,78,0-14,20,ad,fe,ff-5,d2,44,ff-2,aa,0-3,55,ff-2,83,de,fe,ff-4,d6,49,0-6,1e,a1,f7,ff-7,0-4,9,79,f3,ff-4,fd,a0,c0,ff-2,0-5,45,d9,fc,ff-7,55,0-8,55,ff-2,55,0-8,8,76,f2,ff-4,fc,90,b8,ff,fe,0-4,55,ff-2,55,0-5,aa,ff-2,0-4,55,ff-b,aa,0-9,ff-2,aa,0-8,aa,ff-2,0-5,57,fa,ff,cd,28,0-6,1b,a8,ff-6,0-3,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,55,0-5,aa,ff-2,0-5,18,c3,f9,ff-5,f3,7f,c,0-15,1c,80,cc,f6,fa,d9,99,2f,3,ff-2,aa,0-3,55,ff-2,55,3d,9b,e7,f7,dd,a0,32,4,0-7,11,5f,aa,e6,fa,f9,e5,b7,7e,0-5,9,5d,b3,ee,f6,d1,83,18,aa,ff-2,0-6,31,7d,cf,f1,fd,f4,d9,b8,81,23,0-8,55,ff-2,55,0-9,8,5c,b5,ef,f5,cd,7c,14,ac,ff,f5,0-4,55,ff-2,55,0-5,aa,ff-2,0-4,55,ff-b,aa,0-9,ff-2,aa,0-8,aa,ff-2,0-5,5,a9,ff,fb,9d,0-7,1c,87,d4,f9,ff-3,0-3,aa,ff-2,0-2,55,ff-2,55,0-2,ff-2,aa,0-3,55,ff-2,55,0-5,aa,ff-2,0-6,20,70,cb,f1,fc,ea,ab,5a,9,0-7d,10,ba,ff,d8,0-29,7,ff-2,a3,0-cf,33,dd,ff,a1,0-29,26,ff-2,8a,0-c7,49,a7,47,23,8,3,10,33,c2,ff,e5,3e,0-28,18,99,ff,fe,42,0-c7,55,ff,ef,cd,b2,ad,ba,dd,ff-2,76,9,0-24,39,aa-3,c2,f4,ff,c6,7,0-c7,3c,c2,df,f0,fb,fd,f4,e1,b3,51,0-26,55,ff-3,f9,e6,9d,20,0-c8,4,18,35,46,51,53,4a,37,11,0-27,1c,55-3,4f,3c,c,0-76b,3,2e,80,9c-2,7f,2d,3,0-18,1,25,74,97,a4,92,59,1a,0-7a,aa-6,0-18,aa-6,0-28,55,ff-5,fd,f2,d2,9f,45,d,0-5,1b,af,fb,ff-4,fa,ad,1a,0-5,ff-5,fd,ec,cc,81,37,0-7,1c,a7,f8,ff-5,fc,ab,29,0-2,55,ff-e,55,0-2,ff-2,aa,0-6,aa,ff-2,0-2,40,ea,ff,9d,0-8,9d,ff,ea,40,eb,ff,b9,f,0-8,f,b9,ff,ea,0,56,fd,ff,b6,15,0-5,30,f8,ff,d1,2a,2e,d7,ff,ed,1a,0-6,1b,ef,ff,d7,2d,0-2,ff-d,55,0-6,ff-6,0-5,6a,ff-2,40,0-f,ff-6,0-b,17,d2,ff,e9,55,0-18,55,ff-9,ec,96,2,0-3,13,9f,ff-2,a6,67,69,a6,ff-2,9c,12,0-4,ff-8,fd,df,51,1,0-4,16,a3,ff-2,c1,77,5c,6d,b6,f4,ff,55,0-2,55,ff-e,55,0-2,ff-2,aa,0-6,aa,ff-2,0-2,1e,c8,ff,df,0-8,df,ff,c8,1e,c8,ff,c9,1f,0-8,20,ca,ff,c8,0,7,c2,ff,f3,61,0-4,10,a7,ff-2,69,3,5,80,ff-2,84,4,0-4,4,87,ff-2,80,5,0-2,ff-d,55,0-6,ff-2,c6,55-3,0-5,13,ef,ff,9f,8,0-e,55-3,c6,ff-2,0-a,d,92,ff-3,da,19,0-17,55,ff-2,55,0-2,3,15,5f,c4,ff-2,81,5,0-2,6d,f9,f3,70,0-4,70,f3,f8,69,0-4,ff-2,aa,0-2,3,1e,66,e1,ff,e7,46,0-4,74,fc,f5,82,0-5,24,ae,4b,0-8,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-2,1,92,ff-2,35,0-6,35,ff-2,92,1,9e,ff,df,35,0-8,35,df,ff,9e,0-2,3b,e2,ff,e9,19,0-3,72,f8,ff,b9,1,0-2,a,db,ff,e5,43,0-4,45,e6,ff,da,9,0-c,3e,fb,ff,cf,29,0-6,ff-2,aa,0-9,83,fd,e7,41,0-11,aa,ff-2,0-9,1,87,f9,ea,75,d5,ff,ba,1d,0-16,55,ff-2,55,0-4,1,24,e6,ff,ce,24,0-2,cb,ff,c2,18,0-4,18,c2,ff,c8,0-4,ff-2,aa,0-5,60,ef,ff,9a,0-4,c5,ff,c9,1f,0-6,15,12,0-8,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-3,50,ff-2,78,0-6,78,ff-2,50,0,7c,ff,f0,46,0-8,46,f0,ff,7b,0-2,8,8b,ff-2,88,5,0,16,e4,ff,e5,45,0-4,6b,f8,fe,aa,0-4,ac,fe,f8,6b,0-c,1a,b8,ff-2,5f,3,0-6,ff-2,aa,0-9,39,e1,fe,91,0-11,aa,ff-2,0-9,46,f2,ff,70,9,46,dd,f9,94,0-16,55,ff-2,55,0-6,7e,ff,f2,48,0,23,ff-2,77,0-6,79,ff-2,21,0-3,ff-2,aa,0-5,13,bd,ff,e2,0-4,f4,ff,ad,3,0-10,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-3,9,f1,ff,bb,11,0-4,11,bb,ff,f1,9,0,55,fb,ff,61,0-8,62,ff,fb,55,0-3,c,da,ff,eb,4f,d,a0,ff-2,75,2,0-4,13,b0,ff-2,4a,0-2,4c,ff-2,b0,13,0-c,8f,fd-2,a7,0-8,ff-2,aa,0-9,5,94,ff,f6,1b,0-10,aa,ff-2,0-8,3f,dd,f4,83,0-3,39,e8,ff,6b,6,0-14,55,ff-2,55,0-6,5c,ff,fc,52,0,55,ff-2,48,0-6,49,ff-2,53,0-3,ff-2,aa,0-5,3,ad,ff,f8,0-4,f7,ff,ba,10,0-10,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-4,b7,ff,dd,33,0-4,32,dc,ff,b8,0-2,42,ec,ff,83,0-2,4c,aa-2,4c,0-2,83,ff,ed,43,0-4,66,f5,ff,c2,51,ec,ff,d8,10,0-6,44,ff-2,b5,16-2,b6,ff-2,44,0-c,32,f2,ff,d9,34,0-8,ff-2,aa,0-a,32,fe,ff,78,0-10,aa,ff-2,0-7,b,c7,fe,98,12,0-4,65,ed,e2,45,0-14,55,ff-2,55,0-6,72,ff,f5,4b,0,80,ff-2,23,0-6,24,ff-2,7e,0-3,ff-2,aa,0-5,b,b5,ff,ec,0-4,c9,ff,f3,7c,12,0-f,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-4,66,fc,fd,67,0-4,66,fd,fc,67,0-2,2d,d7,ff,ad,0-2,a2,ff-2,a2,0-2,ae,ff,d7,2d,0-4,d,a1,ff-2,f5,ff,ea,4b,0-8,a5,fe,f9,71,72,fa,fe,a4,0-c,1e,c3,ff,fb,55,0-9,ff-2,aa,0-b,b0,ff,d2,28,0-f,aa,ff-2,0-6,12,a3,fa,aa,4,0-5,2,5a,f5,e5,25,0-13,55,ff-2,55,0-5,1,c1,ff,e0,36,0,95,ff-2," +"10,0-6,11,ff-2,94,0-3,ff-2,aa,0-5,2a,d4,ff,bb,0-4,73,fa,ff,f5,b6,79,30,7,0-c,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-4,3a,e4,ff,a9,0-4,a7,ff,e5,3b,0-2,1c,c6,ff,d0,0-2,d3,ff-2,d2,0-2,d0,ff,c6,1c,0-5,2d,f7,ff-3,9b,c,0-8,40,e3,ff,df,e0,ff,e3,3f,0-c,7f,f8,ff,b5,6,0-9,ff-2,aa,0-b,55,f2,f9,68,0-f,aa,ff-2,0-6,11,4a,50,1b,0-7,3,4b,55,22,0-13,55,ff-2,55,0-2,1,a,31,99,ff-2,9d,a,0,a2,ff-2,5,0-6,6,ff-2,a1,0-3,ff-2,aa,0-2,1,c,2b,b1,ff,e9,4b,0-4,e,84,f3,ff-4,f0,a5,57,e,0-9,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-4,11,b9,ff,f2,a,0-2,a,f1,ff,ba,12,0-2,8,b0,ff,f6,4,11,fd,d7-2,fd,10,4,f6,ff,b0,8,0-6,80,fb,ff,e6,13,0-9,3,80,ff-4,80,3,0-b,39,fa,ff,d2,2b,0-a,ff-2,aa,0-b,12,b4,ff,db,8,0-e,aa,ff-2,0-28,55,ff-2,c6,aa-2,ab,b4,da,fb,ff,df,24,0-2,a7,ff-2,2,0-6,2,ff-2,a7,0-3,ff-2,e3,aa-2,ab,b6,d5,ff,f3,64,a,0-5,a,5b,b6,fd,ff-4,f4,9c,1d,0-8,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-4,1,86,ff-2,41,0-2,3e,ff-2,87,1,0-3,96,ff-2,1d,40,ff,a3-2,ff,3f,1d,ff-2,96,0-7,6e,fb,ff,df,8,0-a,17,eb,ff-2,ea,17,0-b,17,b3,ff-2,64,3,0-a,ff-2,aa,0-c,60,ff-2,4b,0-e,aa,ff-2,0-28,55,ff-5,fe,f9,e9,d0,86,1a,0-3,9e,ff-2,8,0-6,a,ff-2,a1,0-3,ff-8,b8,32,0-a,15,4c,8d,ba,ef,ff-2,c1,7,0-7,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-5,33,ff-2,93,2-2,91,ff-2,34,0-4,6c,ff-2,47,7c,fd,64-2,fd,7b,47,ff-2,6c,0-6,1c,ec,ff-3,83,6,0-a,73,ff-2,73,0-c,89,fc,fd,ac,0-c,ff-2,aa,0-c,4,da,ff,b9,13,0-d,aa,ff-2,0-28,55,ff-2,8e,55-2,54,4f,3f,26,2,0-4,92,ff-2,13,0-6,14,ff-2,93,0-3,ff-2,c7,5a,62,75,c0,fb,f8,bc,d,0-b,1,12,58,d7,ff,fe,42,0-7,55,ff-2,55,0-8,ff-2,aa,0-6,aa,ff-2,0-5,6,e9,ff,c1,18,16,bf,ff,ea,6,0-4,49,ff-2,6e,a7,eb,41-2,eb,a6,6e,ff-2,4a,0-5,6,8c,ff-4,df,38,0-a,55,ff-2,55,0-b,2d,f0,ff,db,38,0-c,ff-2,aa,0-d,79,fd,ec,46,0-d,aa,ff-2,0-28,55,ff-2,55,0-b,6f,ff-2,2f,0-6,30,ff-2,76,0-3,ff-2,aa,0-3,5,6f,fe,ff,99,b,0-d,46,ff-2,8d,0-7,55,ff-2,55,0-8,fc,ff,aa,0-6,aa,ff,fb,0-6,9b,ff,eb,42,40,e9,ff,9c,0-5,1f,ff-2,b3,c9,cb,21-2,cb,c8,b2,ff-2,20,0-5,51,ec,ff,d5,70,f4,ff,c0,7,0-9,55,ff-2,55,0-a,1b,bf,ff,fc,5a,0-d,ff-2,aa,0-d,26,cf,ff,b4,0-d,aa,ff-2,0-28,55,ff-2,55,0-b,4b,ff-2,53,0-6,53,ff-2,51,0-3,ff-2,aa,0-4,a,ca,ff,e7,40,0-d,d,ff-2,a4,0-7,55,ff-2,55,0-8,f4,ff,aa,0-5,1,ab,ff,f3,0-6,5c,fa,fe,73,6f,fd,fa,5d,0-5,5,f7,ff,e6,e8,b0,8-2,af,e7,e5,ff,f8,5,0-4,3,c4,ff,f3,61,16,b8,ff,fd,58,0-9,55,ff-2,55,0-a,79,f7,ff,ba,7,0-d,ff-2,aa,0-d,4,8a,ff,f7,24,0-c,aa,ff-2,0-28,55,ff-2,55,0-b,d,f5,ff,94,4,0-4,4,94,ff,f9,16,0-3,ff-2,aa,0-5,4c,ee,ff,b8,1,0-c,14,ff-2,98,0-7,55,ff-2,55,0-8,dc,ff,b0,6,0-4,7,b1,ff,dd,0-6,2c,d6,ff,c6,c2,ff,d7,2d,0-6,d2,ff-3,78,0-2,76,ff-3,d3,0-4,3,70,ff-2,9e,c,0,2b,f1,ff,d6,2f,0-8,55,ff-2,55,0-9,34,f8,ff,d5,2e,0-e,ff-2,aa,0-e,1a,f2,ff,97,6,0-b,aa,ff-2,0-28,55,ff-2,55,0-c,b5,ff,cf,25,0-4,25,ce,ff,c5,0-4,ff-2,aa,0-5,13,b9,ff,f9,2c,0-3,57,7,0-7,5c,ff-2,6e,0-7,55,ff-2,55,0-8,b7,ff,c6,1c,0-4,1d,c7,ff,b7,0-6,c,b3,ff,f7,f6,ff,b4,d,0-6,b0,ff-3,43,0-2,42,ff-3,b1,0-4,2a,d2,ff,f6,29,0-3,90,fe,fc,97,0-8,55,ff-2,55,0-8,15,ae,ff-2,6a,4,0-e,ff-2,aa,0-f,a5,ff,d7,2d,0-b,aa,ff-2,0-28,55,ff-2,55,0-c,3f,e6,ff,b4,28,9-2,28,b3,ff,ef,51,0-4,ff-2,aa,0-6,48,fe,ff,a3,a,0-2,fd,ca,58,2c,d,3,8,1e,6c,e5,ff,e7,15,0-7,55,ff-2,55,0-8,59,f4,fc,9a,21,7,8,21,9d,fc,f4,59,0-7,6b,ff-4,6d,0-7,85,ff-2,f7,a,0-2,a,f7,ff-2,87,0-3,2,a6,ff,f9,7a,0-4,1e,c0,ff,fe,46,0-7,55,ff-2,55,0-8,83,fb,fe,b1,0-10,ff-2,aa,0-f,3d,e6,ff,86,0-b,aa,ff-2,0-28,55,ff-2,55,0-c,9,77,ff-2,d2,b3-2,d2,ff-2,94,e,0-4,ff-2,aa,0-6,7,d4,ff,e1,37,0-2,ff-2,f5,d6,b7,ad,b2,c8,f6,ff,ed,65,0-8,55,ff-2,55,0-8,13,a3,ff,fd,cb,b1,b2,cb,fd,ff,a5,14,0-7,28,ff-4,2a,0-7,64,ff-2,ce,0-4,cc,ff-2,65,0-3,3a,f7,ff,ca,21,0-4,1,50,ff-2,b9,19,0-6,55,ff-2,55,0-8,ed,ff,fe,cd,aa-9,39,0-6,ff-2,aa,0-f,e,af,ff,e4,9,0-a,aa,ff-2,0-28,55,ff-2,55,0-e,5a,bc,ea,f8,ff-2,fc,99,2,0-5,ff-2,aa,0-7,5d,f6,ff,a1,0-2,3a,90,c8,e1,f6,fd,f9,ef,d3,a9,2d,0-9,55,ff-2,55,0-9,3,78,c7,ed,fa-2,ed,c7,7a,3,0-9,d3,ff-2,d5,0-8,47,f1,ff,8d,0-4,8b,ff,f2,48,0-2,1b,c1,ff,fa,45,0-7,a1,fd,fc,86,0-6,55,ff-2,55,0-8,ff-d,55,0-6,ff-2,aa,0-10,3e,fd,ff,6d,1,0-9,aa,ff-2,0-28,1c,55-2,1c,0-e,2,17,40,4e,7e,ed,fd,c2,13,0-5,55-2,39,0-7,13,4c,55,48,0-3,1,1e,37,4c,53,4f,45,29,9,0-a,1c,55-2,1c,0-a,3,1e,43,50-2,43,1e,3,0-a,3b,55-2,3c,0-8,15,4d,55,26,0-4,25,55,4e,15,0-2,14,4d,55,50,3,0-7,1f,53,55,43,0-6,1c,55-2,1c,0-8,55-d,1c,0-6,ff-2,aa,0-10,5,cf,ff,bd,18,0-9,aa,ff-2,0-3e,1,53,f0,ff,c5,2f,0-98,ff-2,aa,0-11,5c,f6,f7,60,0-9,aa,ff-2,0-3f,2,74,f1,ec,55,0-98,ff-2,e3,aa-3,0-e,20,ca,ff,bf,0-6,aa-3,e3,ff-2,0-40,3,56,2e,0-99,ff-6,0-18,ff-6,0-dc,55-6,0-18,55-6,0-16,aa-d,39,0-f2,ff-d,55,0-f2,55-d,1c,0-638,7,27,46,51,4d,3a,10,0-39,16,37,4b,52,49,34,b,0-77,2,17,40,4e-2,40,17,2,0-1a,42,aa-3,b,0-7,aa-6,9e,86,47,b,0-9,1a,9e,d1,f0,fb,f7,e4,b1,51,0-4,aa-4,a0,90,65,2c,0-8,39,aa-b,71,0-3,39,aa-b,0-6,7,57,c0,e1,f5,fc,f3,de,aa,4c,0-4,aa-2,71,0-7,aa-2,71,0-3,39,aa-a,39,0-7,71,aa-6,71,0-5,aa-2,71,0-7,4d,a7,aa,6e,0-2,39,aa-2,39,0-b,71,aa-2,9c,2b,0-5,56,aa-3,39,0-2,aa-3,65,0-6,aa-2,71,0-5,5c,bd,ea,f8-2,ea,bc,5a,0-a,17,38,4e,53,47,2e,3,0-9,aa,ff-3,57,0-7,ff-9,e1,4b,6,0-6,52,e1,ff,ed,bf,af,b8,d5,fd,ff,0-4,ff-8,ba,4d,1,0-5,55,ff-b,aa,0-3,55,ff-b,0-5,14,b2,fd,f9,d7,b4,ae,bd,dd,ff-2,0-4,ff-2,aa,0-7,ff-2,aa,0-3,55,ff-a,55,0-7,aa,ff-6,aa,0-5,ff-2,aa,0-5,4,4c,f7,ff,ae,1d,0-2,55,ff-2,55,0-b,aa,ff-3,76,0-4,11,ba,ff-3,55,0-2,ff-3,e9,c,0-5,ff-2,aa,0-3,9,78,ff-2,d2,b3,b4,d3,ff-2,76,9,0-6,a,5c,c1,e2,f8,fd,f1,d8,82,16,0-7,5,eb,ff-3,9b,3,0-6,ff-2,c6,55-3,62,8a,ed,ff,df,3e,0-5,1c,e1,ff,d1,54,15,5,e,2b,8c,ef,0-4,ff-2,c6,55,5f,74,b4,f2,ff,e8,52,1,0-4,55,ff-2,8e,55-8,39,0-3,55,ff-2,8e,55-8,0-4,a,8d,fe-2,81,2e,a,4,13,33,99,f3,0-4,ff-2,aa,0-7,ff-2,aa,0-3,1c,55-3,8e,ff-2,8e,55-3,1c,0-7,39,55-4,ff-2,aa,0-5,ff-2,aa,0-5,45,dc,ff,d1,20,0-3,55,ff-2,55,0-b,aa,ff-2,fb,bf,0-4,36,e0,fb,ff-2,55,0-2,ff-4,53,0-5,ff-2,aa,0-3,41,e6,ff,b4,28,9,a,29,b4,ff,e5,3f,0-5,1e,be,fe,f5,d1,b4,ae,c2,ed,ff,c6,12,0-6,4a,ff-2,fd,ff,d0,26,0-6,ff-2,aa,0-5,39,df,ff,b6,0-4,d,a5,ff,ea,21,0-6,41,0-4,ff-2,aa,0-4,1e,c1,fd,e1,40,0-4,55,ff-2,55,0-c,55,ff-2,55,0-c,5d,f3,f8,7e,0-6,1,45,0-4,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-2,aa,0-3,2,3e,f0,ff,bc,25,0-4,55,ff-2,55,0-b,aa,ff-2,b7,fd,1e,0-3,74,fe,b7,ff-2,55,0-2,ff-2,fb-2,b7,11,0-4,ff-2,aa,0-3,b6,ff,cf,25,0-4,25,cf,ff,b3,0-4,17,a7,ff,e9,60,27,a,4,18,50,ec,ff,77,1,0-4,1,90,ff-2,bf,ff,f2,4b,0-6,ff-2,aa,0-5,c,b6,ff,ea,0-4,38,e2,ff,8b,0-c,ff-2,aa,0-5,37,d9,fe,a0,0-4,55,ff-2,55,0-c,55,ff-2,55,0-c,bc,ff,cc,22,0-c,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-2,aa,0-3,38,d2,ff,de,29,0-5,55,ff-2,55,0-b,aa,ff-2,6f,fe,66,0-3,be,fc,70,ff-2,55,0-2,ff-2,dc-2,e7,3e,0-4,ff-2,aa,0-2,d,f5,ff,94,4,0-4,4,95,ff,f4,c,0-3,8b,fd,c8,2c,0-6,55,f0,d0,26,0-4,20,ca,ff,de,46,ef,ff,97,0-6,ff-2,aa,0-5,5,af,ff,f8,0-4,7b,ff,e8,3e,0-c,ff-2,aa,0-5,1,8e,ff,f9,15,0-3,55,ff-2,55,0-c,55,ff-2,55,0-b,22,ff-2,84,0-d,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-2,aa,0,1,32,e7,ff,c8,2f,0-6,55,ff-2,55,0-b,aa,ff-2,33,dd,b5,d,0,1d,fd,bc,55,ff-2,55,0-2,ff-2,ae,96,ff,9b,0-4,ff-2,aa,0-2,4b,ff-2,53,0-6,54,ff-2,4a,0-2,1b,f0,fe,42,1,0-6,1d,c7,ec,42,0-4,44,ed,ff,98,22,cc,ff,dd,0-6,ff-2,aa,0-5,19,c3,ff,d9,0-4,ad,ff,ce,24,0-c,ff-2,aa,0-6,53,ff-2,48,0-3,55,ff-2,55,0-c,55,ff-2,55,0-b,55,ff-2,4c,0-d,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-2,aa,0,2d,c6,ff,e8,33,1,0-6,55,ff-2,55,0-b,aa,ff-2,f,b7,db,31,0,66,fe,73,55,ff-2,55,0-2,ff-2,aa,3d,ff,ec,c,0-3,ff-2,aa,0-2,6f,ff-2,2f,0-6,30,ff-2,6e,0,2,81,ff,a2,0-3,15,88,dc,f5,c8,48,b3,fb,51,0-4,8b,ff,f3,4c,2,93,ff-2,37,0-5,ff-2,aa,0-3,7,1e,8a,f8,f6,72,0-4,dd,ff,b9,f,0-c,ff-2,aa,0-6,24,ff-2,7d,0-3,55,ff-2,55,0-c,55,ff-2,55,0-b,87,ff-2,20,0-d,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-2,aa,27,db,ff,d4,39,0-8,55,ff-2,55,0-b,aa,ff-2,0,6b,fd,6b,e,b5,e0,36,55,ff-2,55,0-2,ff-2,aa,0,c7,ff,6d,1,0-2,ff-2,aa,0-2,92,ff-2,14,0-6,15,ff-2,91,0,12,ba,f4,54,0-2,11,97,fe,ff-3,d9,df,ff,55,0-4,d2,ff,d1,27,0,4d,ff-2,7e,0-5,ff-2,e3,aa-3,b1,c8,f9-2,88,14,0-4,ee,ff,b0,6,0-c,ff-2,aa,0-6,f,ff-2,93,0-3,55,ff-2,c6,aa-8,0-4,55,ff-2,c6,aa-7,39,0-3,98,ff-2,d,0-d,ff-2,e3,aa-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-2,cd,b9,ff-2,a5,9,0-8,55,ff-2,55,0-b,aa,ff-2,0,22,fe,b3,31,db,bb,11,55,ff-2,55,0-2,ff-2,aa,0,6d,fc,b8,13,0-2,ff-2,aa,0-2,9d,ff-2,8,0-6,a,ff-2,9c,0,30,da,d3,29,0-2,6b,fa,da,58,9,26,bb,fd,ff,55,0-3,2b,ff-2,9c,4,0,7,ed,ff,c0,16,0-4,ff-8,ef,93,29,3,0-4,fb,ff,ac,2,0-c,ff-2,aa,0-6,2,ff-2,a3,0-3,55,ff-b,0-4,55,ff-a,55,0-3,a6,ff-2,3,0-4,39,55-4,39,0-3,ff-c,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-4,fc,ff,f0,5e,0-8,55,ff-2,55,0-b,aa,ff-2,0-2,c4,fa,82,fd,70,0,55,ff-2,55,0-2,ff-2,aa,0,25,cf,f1,4f,0-2,ff-2,aa,0-2,a7,ff-2,2,0-6,2,ff-2,a6,0,43,ed,be,14,0-2,ba,ff,6b,3,0-2,3a,de,ff,55,0-3,73,ff-2,59,0-3,ad,ff,e4,3a,0-4,ff-2,c6,55-3,63,88,e5,ff,cc,42,0-4,f5,ff,ae,4,0-c,ff-2,aa,0-6,3,ff-2,a3,0-3,55,ff-2,8e,55-8,0-4,55,ff-2,8e,55-7,1c,0-3,9f,ff-2,8,0-4,aa,ff-4,aa,0-3,ff-2,c6,55-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-3,f4,8c,f0,ff,d9,10,0-7,55,ff-2,55,0-b,aa,ff-2,0-2,7a,ff,eb,ff,27,0,55,ff-2,55,0-2,ff-2,aa,0,5,92,ff,9e,0-2,ff-2,aa,0-2,a2,ff-2,5,0-6,6,ff-2,a1,0,4d,f7,b1,7,0-2,f1,ff,13,0-3,a,b4,ff,55,0-2,11,ba,ff,f3,c,0-3,5a,f9,ff,77,0-4,ff-2,aa,0-5,1b,b5,ff,e6,13,0-3,e3,ff,b6,c,0-c,ff-2,aa,0-6,e,ff-2,93,0-3,55,ff-2,55,0-c,55,ff-2,55,0-b,8d,ff-2,17,0-4,71,aa-2,ff-2,aa,0-3,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-2,e4,4d,7,88,ff-2,9d,d,0-6,55,ff-2,55,0-b,aa,ff-2,0-2,39,e3,ff,ca,0-2,55,ff-2,55,0-2,ff-2,aa,0-2,27,fa,f8,1b,0,ff-2,aa,0-2,96,ff-2,f,0-6,10,ff-2,94,0,53,fd,ac,2,0-2,fa,ff,5,0-3,3,ad,ff,55,0-2,34,de,ff,f3,aa-4,c0,f9,ff,be,0-4,ff-2,aa,0-6,4a,ff-2,5e,0-3,c5,ff,c4,1a,0-c,ff-2,aa,0-6,24,ff-2,7e,0-3,55,ff-2,55,0-c,55,ff-2,55,0-b,6d,ff-2,34,0-7,ff-2,aa,0-3,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-10,ff-2,aa,0-5,ff-2,b0,6,0,16,dd,ff,ee,57,0-6,55,ff-2,55,0-b,aa,ff-2,0-2,15,bf,ff,80,0-2,55,ff-2,55,0-2,ff-2,aa,0-2,1,c3,ff,71,0,ff-2,aa,0-2,80,ff-2,23,0-6,23,ff-2,7e,0,4d,f7,b2,8,0-2,e1,ff,2b,0-3,16,c0,ff,55,0-2,6d,fe,ff-9,fc,1a,0-3,ff-2,aa,0-6,c,ff-2,9a,0-3,8c,ff,e0,36,0-c,ff-2,aa,0-6,52,ff-2,49,0-3,55,ff-2,55,0-c,55,ff-2,55,0-b,33,ff-2,6a,0-7,ff-2,aa,0-3,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-f,9,ff-2,9e,0-5,ff-2,aa,0-3,49,e8,ff,e8,1e,0-5,55,ff-2,55,0-b,aa,ff-2,0-8,55,ff-2,55,0-2,ff-2,aa,0-3,58,f6,c8,1e,ff-2,aa,0-2,56,ff-2,48,0-6,48,ff-2,53,0,45,ef,bb,11,0-2,aa,ff,88,6,0-2,4d,eb,ff,55,0-2,b3,ff,e5,73,55-5,91,ff-2,5e,0-3,ff-2,aa,0-6,8,ff-2,a3,0-3,54,f5,fa,61,0-c,ff-2,aa,0-5,1,8d,ff,f9,16,0-3,55,ff-2,55,0-c,55,ff-2,55,0-b,8,e4,ff,a7,8,0-6,ff-2,aa,0-3,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-f,1c,ff-2,8e,0-5,ff-2,aa,0-3,a,8e,ff-2,96,b,0-4,55,ff-2,55,0-b,aa,ff-2,0-8,55,ff-2,55,0-2,ff-2,aa,0-3,23,cd,f3,51,ff-2,aa,0-2,25,ff-2,77,0-6,78,ff-2,22,0,30,da,d6,2c,0-2,41,e6,f7,aa,5d,7b,eb,fb,ff,55,0,13,f9,ff,b1,d,0-5,19,f9,ff,ad,9,0-2,ff-2,aa,0-6,38,ff-2,87,0-3,1a,be,ff,d5,11,0-6,20,0-4,ff-2,aa,0-5,37,da,ff,a2,0-4,55,ff-2,55,0-c,55,ff-2,55,0-c,7c,fa,e9,50,0-6,ff-2,aa,0-3,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-7,71,21,0-6,54,ff-2,5e,0-5,ff-2,aa,0-4,8,cd,ff,f5,6d,0-4,55,ff-2,55,0-b,aa,ff-2,0-8,55,ff-2,55,0-2,ff-2,aa,0-4,7b,ff,b9,ff-2,aa,0-3,cd,ff,c2,18,0-4,18,c1,ff,c9,0-2,16,c0,f2,4c,0-2,9,6d,fc,ff-3,c4,cd,ff,55,0,54,ff-2,77,0-7,cc,ff,d4,2a,0-2,ff-2,aa,0-5,10,9e,ff-2,47,0-3,1,57,ff-2,8c,11,0-4,37,ba,0-4,ff-2,aa,0-4,1d,c1,fd,e2,42,0-4,55,ff-2,55,0-c,55,ff-2,55,0-c,25,cd,ff,d0,23,0-4,5,ff-2,aa,0-3,ff-2,aa,0-7,ff-2,aa,0-7,55,ff-2,55,0-7,aa,be,41,0-4,10,a8,ff,fd,21,0-5,ff-2,aa,0-5,51,ea,ff,e4,1a,0-3,55,ff-2,55,0-b,aa,ff-2,0-8,55,ff-2,55,0-2,ff-2,aa,0-4,22,fb,f7,ff-2,aa,0-3,6f,fa,f3,70,0-4,6f,f3,f9,6a,0-3,80,ff,b1,1,0-3,35,88,a0,76,d,71,aa,39,6,a5,ff,fc,21,0-7,75,fd,f9,5c,0-2,ff-2,c6,55-3,60,7e,d6,ff,fa,a8,0-6,86,f2,ff,da,7e,5f,6f,a9,fb,ff,0-4,ff-2,c6,55,5f,73,b3,f2,ff,e9,54,1,0-4,55,ff-2,8e,55-8,39,0-3,55,ff-2,55,0-d,2e,dc,ff,ee,a3,65,5b,80,d1,ff-2,92,0-3,ff-2,aa,0-7,ff-2,aa,0-3,1c,55-3,8e,ff-2,8e,55-3,1c,0-3,aa,ff,fe,b7,76,5a,6d,c8,fd,fb,9a,0-6,ff-2,aa,0-5,3,77," +"ff-2,ad,13,0-2,55,ff-2,8e,55-8,39,0-2,aa,ff-2,0-8,55,ff-2,55,0-2,ff-2,aa,0-5,a9,ff-3,aa,0-3,14,a2,ff-2,a5,67-2,a5,ff-2,9e,12,0-3,23,fb,f6,3d,0-b,24,ce,ff,d5,1,0-7,41,ea,ff,9e,0-2,ff-9,fb,8f,1e,0-6,10,67,ef,ff-5,f6,a6,0-4,ff-8,bc,4f,1,0-5,55,ff-b,aa,0-3,55,ff-2,55,0-e,3c,b3,ff-6,f3,9f,20,0-3,ff-2,aa,0-7,ff-2,aa,0-3,55,ff-a,55,0-3,52,d7,fe,ff-6,a5,20,0-6,ff-2,aa,0-6,f,d0,ff,f3,67,0-2,55,ff-b,aa,0-2,aa,ff-2,0-8,55,ff-2,55,0-2,ff-2,aa,0-5,57,f4,ff-2,aa,0-4,1c,b2,fb,ff-4,fa,ae,1a,0-5,86,f8,d6,40,0-a,30,a1,aa,60,0-8,14,85,aa,99,0-2,aa-6,a0,8e,5c,1c,0-a,11,52,8e,a2,9a,74,20,0-5,aa-4,a1,91,67,2d,0-8,39,aa-b,71,0-3,39,aa-2,39,0-10,32,73,98,a4,8f,65,19,0-5,aa-2,71,0-7,aa-2,71,0-3,39,aa-a,39,0-4,3,2c,73,96,a6,9c,75,35,0-8,aa-2,71,0-7,36,a2,aa,9d,6,0,39,aa-b,71,0-2,71,aa-2,0-8,39,aa-2,39,0-2,aa-2,71,0-5,16,88,aa-2,71,0-5,4,30,82,9d,9c,80,2e,3,0-6,1e,be,fe,d8,4c,5,0-fb,14,ba,f8,fc,d6,86,67,5c,7c,b2,32,0-f6,1b,75,ec,ff-5,f9,56,0-f8,c,45,84,9e,a6,91,4f,e,0-9f6,c,4f,b6,e6,f6,df,8e,38,0-6,2,e,23,33,48,53,55-2,0-8,1c,48,8f,c2,ec,fa,f1,d6,94,4c,8,0-5,22,7b,af,d1,ef,fb,f0,d0,83,36,0-c,17,4f,55-2,0-6,1c,55-a,1c,0-6,1,1b,72,ba,e9,f9,ee,cf,90,25,0-4,55-c,39,0-5,1e,6d,c8,ed,f9,e7,a7,56,7,0-7,2f,82,d3,f2,f4,db,8c,3b,1,0-56,d,48,87,cb,ec,fa,ee,b8,69,11,0-7,83,ed,ff-4,fe,dc,3c,0-5,3b,b8,cd,dd,f2,fd,ff-2,0-8,c6,f0,ff-7,ee,87,12,0-4,55,ff-7,fd,dd,4d,1,0-a,80,f9,ff-2,0-6,55,ff-a,55,0-6,33,b9,fd,ff-6,55,0-4,ff-c,a7,0-4,12,c0,f9,ff-5,f2,79,9,0-5,34,d7,fc,ff-4,fe,df,49,0-56,7e,ed,ff-6,fa,96,14,0-4,1,5e,ff-2,a1,2f,d,46,d7,ff,d7,2f,0-4,53,f1,dd,cd,b8,e5,ff-2,0-8,ff,eb,ae,6d,27,c,e,37,aa,f4,fe,a8,3,0-3,4f,d4,90,4f,18,6,16,54,d6,ff,e7,48,0-9,34,f9,ff-3,0-6,55,ff-2,c6,aa-7,39,0-5,21,e3,ff,e3,86,26,9,19,50,bd,4b,0-4,aa-8,ab,e2,ff-2,5c,0-3,c,a6,ff,fb,81,21,8,31,bf,fd,f6,64,0-4,27,d1,ff,eb,6b,1c,9,33,b7,f9,e1,3e,0-55,aa,ea,aa,49,16,2,1d,9a,f4,fd,81,0-4,1a,c0,ff,d6,13,0-3,53,eb,fc,86,0-4,1a,47,33,23,e,ac,ff-2,0-8,b2,4c,d,0-5,13,a2,ff,f9,35,0-3,16,2a,1,0-5,4d,e6,ff,a2,0-8,12,aa,e8-2,ff-2,0-6,55,ff-2,55,0-c,7,92,ff,fb,51,6,0-4,17,13,0-c,18,c0,ff,f1,11,0-3,34,de,ff,bc,6,0-3,3a,dd,ff,bc,0-4,71,fb,f9,77,0-4,21,c3,fe,9b,0-55,84,48,d,0-4,1a,c4,ff,d5,0-4,52,f5,fa,63,0-4,a,aa,ff,ea,6,0-8,aa,ff-2,0-11,29,ff-2,8a,0-b,d,b7,ff,ea,0-8,75,f9,86,ae,ff-2,0-6,55,ff-2,55,0-c,3a,e4,fe,92,0-14,54,f3,ff,94,0-4,4f,f9,ff,68,0-4,a,b4,ff,f3,0-4,c3,ff,ce,24,0-5,55,ff,f5,d,0-5b,8,b2,ff,f7,0-4,87,ff,e3,39,0-5,72,ff-2,31,0-8,aa,ff-2,0-11,8,ff-2,a4,1,0-a,4,ae,ff,f9,0-7,18,e6,eb,19,aa,ff-2,0-6,55,ff-2,55,0-c,6e,fc,ed,47,0-14,a1,ff,ef,4b,0-4,51,fb,ff,5a,0-4,3,ad,ff,f7,0-4,e9,ff,b6,c,0-5,1c,ff-2,3d,0-2e,6,5b,2e,0-11,5b,31,3,0-16,30,d9,ff,e2,0-4,bb,ff,c7,1d,0-5,3b,ff-2,65,0-8,aa,ff-2,0-11,23,ff-2,af,5,0-a,1c,c6,ff,d4,0-6,e,a4,f5,67,0,aa,ff-2,0-6,55,ff-2,55,0-c,ac,ff,ca,20,f,38,51,4f,39,13,0-d,18,f8,ff,b8,13,0-4,38,e2,ff,7d,0-4,15,bf,ff,c5,0-4,fa,ff,ac,2,0-5,5,ff-2,70,0-7,55,ff-3,0-c,55,ff-3,0-10,f,3a,90,e4,ff,55,0-11,aa,fc,d0,67,2f,3,0-12,1d,ca,ff,fa,80,0-4,dc,ff,ba,10,0-5,21,ff-2,86,0-8,aa,ff-2,0-11,6a,ff-2,96,1,0-a,77,f4,fc,80,0-6,53,ee,be,18,0,aa,ff-2,0-6,55,ff-2,98,91,a5,9b,7f,38,6,0-6,d3,ff,b8,1f,a8,e2,fb,f9,e3,b9,34,0-c,6a,ff-2,72,1,0-4,f,a9,ff,d4,b,0-3,4b,ea,f7,6a,0-4,f3,ff,af,5,0-5,d,ff-2,8b,0-7,55,ff-3,0-c,55,ff-3,0-e,d,53,b5,e4,ff-2,f5,4b,0-11,97,ff-2,fa,d9,93,3c,0-10,1f,ad,ff-2,c3,22,0-4,f0,ff,af,5,6,33,4c,21,0,b,ff-2,9a,0-8,aa,ff-2,0-10,30,d5,ff,fc,3c,0-6,39,55,57,74,b9,ff,f3,8c,12,0-5,14,df,f7,37,0-2,aa,ff-2,0-6,55,ff-7,fe,d2,3e,5,0-4,ed,ff,c8,c0,e8,bc,ae,be,f2,ff,e7,4f,0-a,17,c1,ff,f1,11,0-6,13,bb,f6,ce,75,5c,85,f2,ed,78,a,0-4,d1,ff,c5,1b,0-5,42,ff-2,9f,0-7,55,ff-3,0-c,55,ff-3,0-b,e,43,89,eb,ff-2,ef,bb,79,18,0-2,aa,ff-d,55,0-2,39,8d,d2,f7,ff-2,cb,73,2b,7,0-b,15,ca,ff,fd,ca,18,0-5,f9,ff,ac,2,37,d5,f6,bb,0,4,ff-2,a4,0-8,aa,ff-2,0-f,3,ae,fc,ff,bb,4,0-6,aa,ff-4,dc,64,c,0-5,4,7f,ff,a6,1,0-2,aa,ff-2,0-6,4d,c7,8b,6b,5a,5d,81,c7,ff-2,db,45,0-4,f8,ff,f7,df,44,12,4,14,6e,eb,ff,cc,1,0-9,45,ed,ff,aa,0-8,1d,89,fc,ff-3,df,66,6,0-5,99,ff,e9,42,0-4,7,95,ff-2,a7,0-7,55,ff-3,0-c,55,ff-3,0-9,8,62,ae,e9,fe,ff,ef,92,4b,14,1,0-3,aa,ff-d,55,0-3,2,28,59,bc,f7,ff,fd,d5,9e,36,4,0-8,4,85,ff-2,c7,31,0-6,fa,ff,ac,2,38,d8,f7,bc,0,4,ff-2,a4,0-8,aa,ff-2,0-e,10,8f,ff-2,ce,2c,0-7,71,aa,ab,b7,d3,fd,f1,79,15,0-4,4d,e9,d4,2c,0-3,aa,ff-2,0-e,68,e8,ff,de,d,0-3,fd,ff,f1,54,0-4,2,84,ff-2,45,0-9,a2,ff,f0,4a,0-6,2,35,c9,fd,d8,b6,ad,bc,ee,fa,90,1f,0-4,3d,e6,ff,d2,34,d,4,19,81,e3,ff-2,a3,0-22,30,96,e8,ff-2,e0,b2,54,e,0-1d,1a,7c,bd,f1,ff,fd,d6,6d,18,0-6,2e,d8,ff,de,18,0-7,f0,ff,af,5,7,35,4d,21,0,b,ff-2,9a,0-8,aa,ff-2,0-e,82,f2,ff,f6,45,2,0-9,1,d,29,8d,f3,f6,98,0-3,3,c2,ff,76,4,0-3,aa,ff-2,0-e,8,8b,ff-2,4c,0-3,f6,ff,cb,21,0-5,38,ff-2,7c,0-8,d,ee,ff,c6,1c,0-6,2d,cd,ff,bd,2e,c,3,12,5d,e0,fa,ab,1,0-3,a,83,ff-2,dd,b7,ae,c3,f4,8e,ff-2,96,0-22,a2,ff-2,d6,81,36,d,0-20,1,16,4e,95,f1,ff,fb,51,0-6,47,f1,ff,7f,0-8,dc,ff,ba,10,0-5,20,ff-2,86,0-8,aa,ff-2,0-c,d,7c,ff-2,e3,52,0-e,3,7a,ff-2,44,0-2,70,ff,cd,5,0-4,aa,ff-2,0-f,25,ff-2,90,0-3,e1,ff,b0,6,0-5,b,ff-2,9e,0-8,6a,ff-2,73,0-7,a0,ff,d8,2e,0-5,5f,ff-2,4b,0-5,6e,c6,ef,fb,f6,da,6d,27,ff-2,7e,0-22,a2,ff-2,cd,79,31,b,0-20,1,13,48,8c,eb,ff,fb,51,0-6,53,fd,ff,57,0-8,bc,ff,c7,1d,0-5,3b,ff-2,66,0-8,aa,ff-2,0-c,79,f0,ff,f8,56,6,0-f,20,ff-2,8b,0-2,a9,ff,da,aa-5,e3,ff-2,aa-2,71,0-c,7,ff-2,a3,0-3,c7,ff,ac,2,0-5,4,ff-2,a5,0-7,10,b3,ff,fb,1e,0-7,e0,ff,b6,c,0-5,19,ff-2,8c,0-5,3,1e,45,51,4c,30,3,41,ff-2,56,0-22,30,97,e8,ff,fe,db,ad,4e,c,0-7,71,aa-d,39,0-7,17,76,b9,ed,ff,fd,d6,6e,18,0-6,55,ff-2,55,0-8,88,ff,e3,39,0-5,72,ff-2,31,0-8,aa,ff-2,0-a,d,79,ff-2,d9,4e,0-11,9,ff-2,a3,0-2,aa,ff-c,aa,0-c,18,ff-2,95,0-3,94,ff,b8,e,0-5,18,ff-2,92,0-7,47,ec,ff,ab,0-8,fa,ff,ad,3,0-5,7,ff-2,a4,0-b,2,89,ff,f9,1c,0-24,8,62,af,ea,fe,ff,ec,8e,4a,14,1,0-3,aa,ff-d,55,0-3,2,27,57,b8,f5,ff,fd,d5,9f,37,4,0-8,39,aa-2,39,0-8,52,f5,fa,63,0-4,a,aa,ff,ea,6,0-8,aa,ff-2,0-a,7a,f0,ff,e3,3d,4,0-11,2f,ff-2,90,0-2,39,55-7,c6,ff-2,55-2,39,0-c,54,ff-2,6c,0-3,5f,fb,d4,2a,0-5,48,ff-2,6d,0-7,8d,fe,f7,5a,0-8,eb,ff,bc,12,0-5,24,ff-2,95,0-b,20,c8,ff,c7,0-27,e,43,89,ec,ff-2,ee,ba,79,18,0-2,39,55-d,1c,0-2,3a,8d,d1,f6,ff-2,cb,73,2b,7,0-16,1b,c0,ff,d6,13,0-3,53,eb,fc,86,0-9,aa,ff-2,0-8,e,7c,ff,fe,ae,26,0-a,36,b,0-6,1b,af,ff,fd,42,0-a,aa,ff-2,0-6,35,9,0-6,35,cf,ff,ed,18,0-3,25,ce,fd,8d,3,0-3,15,b3,ff,f6,1f,0-6,e,ee,ff,c6,1d,0-8,a7,ff,ee,5d,0-4,c,93,ff-2,50,0-4,25,4,0-4,c,9d,fd,ef,52,0-8,55,ff-3,0-c,55,ff-3,0-e,d,54,b5,e4,ff-2,f6,4c,0-11,98,ff-2,fa,d9,94,3d,0-e,1c,55-2,1c,0-8,1,5f,ff-2,a0,2f,c,45,d7,ff,d7,2f,0-9,aa,ff-2,0-8,7e,f0,fb,a9,1a,0-b,e0,af,62,30,c,4,19,4c,bb,f7,ff,bf,7,0-a,aa,ff-2,0-6,df,ab,5a,29,a,6,23,64,d3,fd,f7,7e,0-4,4,76,ff,f3,7e,23,7,28,a3,f5,ff,a0,0-7,55,ff-2,87,3,0-8,4f,ec,ff,e0,5f,18,6,24,93,ef,ff,d7,d,0-4,97,92,3f,a,c,43,a0,fa,ff,9d,10,0-8,55,ff-3,0-c,55,ff-3,0-10,f,3a,90,e4,ff,55,0-11,aa,fd,d1,68,2f,3,0-f,55,ff-2,55,0-a,84,ed,ff-4,fe,dc,3d,0-6,aa,ff-a,0-4,ff-c,bb,11,0-2,ff-9,f5,9b,1c,0-b,aa,ff-2,0-6,ff-8,fd,e2,67,7,0-6,93,ef,ff-5,f9,9d,19,0-6,f,b5,ff,f9,21,0-9,2,5a,e3,fe,ff-5,fd,b9,2f,0-5,aa,ff-6,ee,9f,5,0-9,55,ff-3,0-c,59,ff-2,f6,0-13,6,5c,2e,0-11,5b,31,3,0-12,55,ff-2,55,0-a,c,4f,b7,e7,f6,e0,8f,38,0-7,aa,ff-a,0-4,ff-c,bb,11,0-2,72,9e,ca,e3,f7,fd,f2,da,9d,57,e,0-c,aa,ff-2,0-6,79,ab,d6,ec,fa,fc,eb,ca,81,3b,2,0-7,e,52,b3,e3,f9,ee,b9,6a,13,0-7,3a,e4,ff,c1,0-b,1,3d,89,d3,f1,fa,ec,b9,73,1d,1,0-5,4a,ae,db,f8,f7,dc,a8,4d,e,0-a,55,ff-3,0-c,7f,ff-2,ab,0-3c,55,ff-2,55,0-bc,c8,ff,e1,38,0-fb,c,f6,ff,9c,9,0-fb,4c,ff,f2,20,0-fc,86,ff,9d,0-890,55,1c,0-fe,ff,55,0-1b,22,7d,9f,a0,83,3e,9,0-1c,13,84,9b,2a,0-8,2a,9c,84,13,0-f,71-2,0-6d,55,ff-2,55,0-a,55,ff,aa,0-2,aa,ff,55,0-a,5b,fb,b3,d,0,f,fa-2,13,0-9,ff,56,0-8,10,3b,51,47,19,1,0-b,1,78,ef,ff-5,55,0-a,55,ff,aa,0-f,74,f9,a6,c,0-8,d,a7,f9,73,0-f,aa-2,0-51,20,ca,ff,bf,0-18,55,ff-2,55,0-a,55,ff,aa,0-2,aa,ff,55,0-a,90,ff,86,0-2,45,ff,d2,0-a,ff,57,0-7,f,a8,e5,fb,f1,b9,3d,0-b,2b,f1,ff,e8,8b,5f,84,ed,55,0-a,55,ff,aa,0-e,c,e1,ff,45,0-a,47,ff,e1,c,0-9,3c,41,0-3,aa-2,0-3,41,3c,0-4c,5c,f6,f7,60,0-18,55,ff-2,55,0-a,55,ff,aa,0-2,aa,ff,55,0-a,d8,ff,3e,0,1,8d,ff,88,0-6,28,74,c7,ee,ff,fb,e1,bf,86,23,0-2,10,a8,fe,df,b2,c7,fe,eb,1a,0-a,87,ff-2,49,0-3,23,21,0-a,55,ff,aa,0-d,3,7e,ff,c8,0-c,cb,ff,7d,3,0-8,b1,f9,97,32,0,aa-2,0,32,97,f9,b1,0-4b,5,cf,ff,bd,18,0-18,55,ff-2,55,0-a,55,ff,aa,0-2,aa,ff,55,0-9,16,fb,f7,c,0,10,b8,f8,55,0-5,2b,d1,fb,ff,fe,ff-5,55,0-2,3b,e5,df,4e,8,1d,c0,ff,70,0-a,a3,ff-2,c,0-f,55,ff,aa,0-d,20,c9,fd,72,0-c,75,fe,c8,1f,0-8,2a,7e,f1,d8,5f,b3-2,5f,d8,f1,7d,29,0-4b,3e,fd,ff,6d,1,0-18,55,ff-2,55,0-a,55,ff,aa,0-2,aa,ff,55,0-9,5a,ff,ba,0-2,34,de,d6,2c,0-4,1a,c2,ff,eb,60,12,ff,59,1a,3c,77,31,0-2,52,fc,b2,8,0-2,65,ff,a2,0-a,8d,ff-2,25,0-f,55,ff,aa,0-d,63,fa,dd,33,0-c,35,df,f9,61,0-a,20,8c,e5,fd-2,e5,8b,20,0-a,55,ff,aa,0-3f,e,af,ff,e4,9,0-19,55,ff-2,55,0-a,55,ff,aa,0-2,aa,ff,55,0-5,57,aa-3,d2,ff,de,aa-2,c0,f9,ed,b4,aa-2,0-2,43,ed,ff,8d,0-2,ff,55,0-6,49,f3,c4,1a,0-2,8e,ff,91,0-a,4c,ff-2,72,0-f,55,ff,aa,0-d,af,ff,bb,11,0-c,13,bd,ff,ac,0-b,e,b5,fd-2,b3,d,0-b,55,ff,aa,0-3f,3d,e6,ff,87,0-1a,55,ff-2,55,0-a,55,ff,aa,0-2,aa,ff,55,0-5,83,ff-e,0-2,52,fc,ff,61,0-2,ff,55,0-6,1c,be,fd,bb,64,8e,fc,f5,36,0-2,1,2e,7b,6f,3,0-4,bc,fe,d5,2d,0-e,55,ff,aa,0-c,c,f6,ff,87,0-e,8a,ff,f5,b,0-8,16,6e,db,d8,e6-2,d8,da,6d,16,0-9,55,ff,aa,0-3f,a5,ff,d7,2d,0-1a,55,ff-2,55,0-a,1c,55,39,0-2,39,55,1c,0-5,2c,55-2,7b,ec,e1,6f,55-2,e2,ff,81,55-3,0-2,45,ef,ff,a1,0-2,ff,55,0-6,1,42,ef,ff-3,f6,89,2,0,17,78,d8,ee,69,4,0-3,1,8f,fd,fb,92,0-e,1c,55,39,0-c,3b,ff-2,5a,0-e,5d,ff-2,38,0-7,50,b6,f4,b2,2f,af-2,2f,b2,f4,b6,4f,0-8,55,ff,aa,0-3e,1a,f2,ff,97,6,0-1a,54,fe-2,54,0-1a,57,f9,b6,e,0,e,fa-2,11,0-5,15,ae,ff-2,a2,56,ff,65,4,0-7,20,77,a3,92,36,3,30,7e,ed,d9,7b,19,0-4,22,a7,ff,fc,ff-2,58,3,0-1b,71,ff-2,2e,0-e,30,ff-2,6f,0-7,a7,ca,45,3,0,aa-2,0,4,45,ca,a6,0-8,55,ff,aa,0-3d,4,8a,ff,f7,24,0-1b,4f,f9-2,4f,0-1a,86,ff,8e,1,0,3e,ff,d6,0-7,2b,d3,ff-2,f8,ff,d6,9e,53,1,0-9,19,7b,d9,ed,7f,30,1,0-4,6,b5,fb,da,82,fd,ff,d3,2f,0-3,7,aa-2,0-15,8e,ff-2,16,0-e,18,ff-2,8d,0-7,1e,21,0-3,aa-2,0-3,21,1e,0-8,55,ff,aa,0-3d,26,cf,ff,b4,0-1c,47,f1-2,47,0-1a,c9,ff,4c,0-2,80,ff,94,0-8,d,59,b0,cc,ff-4,ba,2f,0-5,1,31,81,ee,d8,7a,18,0-6,5,85,ff,ec,28,0,82,f7,ff,c6,e,0-2,3,ff,f4,0-15,a3,ff-2,6,0-e,7,ff-2,a2,0-c,aa-2,0-7,55,ff-d,aa,0-37,79,fd,ec,46,0-1c,41,eb,ea,40,0-19,8,f5,fe,18,0,8,ac,fd,61,0-a,a,22,ff,97,b6,f9,fe,c4,4,0-3,1b,7d,da,ec,7d,2f,3,38,92,a2,6f,19,0-2,27,d0,ff,99,0-2,1a,b9,ff-2,78,4,0,c,ff,e4,0-15,a7,ff-2,2,0-e,3,ff-2,a6,0-c,39-2,0-7,55,ff-d,aa,0-15,39,aa-6,39,0-19,4,da,ff,b9,13,0-1c,38,e2-2,38,0-16,ff-e,83,0-9,ff,55,5,7e,ff-2,5e,0-2,46,ef,d7,77,17,0,2,8c,f7,ff-3,e7,36,0,4b,f5,ff,5f,0-3,1e,e3,ff,ef,5f,0,39,ff,b4,0-15,9c,ff-2,b,0-e,c,ff-2,9b,0-1b,55,ff,aa,0-1b,55,ff-6,55,0-19,5f,ff-2,4b,0-1d,12,4a-2,12,0-16,ff-e,83,0-9,ff,55,0,24,ff-2,94,0-2,29,7c,2e,1,0-2,38,f6,fb,8c,65,c1,fe,b4,17,52,fc,ff,61,0-4,66,f2,ff,de,1a,85,ff,7b,0-15,86,ff-2,1d,0-e,1f,ff-2,86,0-1b,55,ff,aa,0-1b,1c,55-6,1c,0-18,12,b4,ff,db,8,0-39,e,b8,f8,55,0-2,7a,ff,95,1,0-c,ff,55,0,8,ff-2,a2,0-8,92,ff,8b,0-2,1d,c7,f0,46,43,ed,ff,a4,0-4,6,80,ff-2,dd,ec,d9,30,0-15,5c,ff-2,3f,0-e,42,ff-2,5b,0-1b,55,ff,aa,0-3b,55,f2,f9,68,0-3a,2b,d5,df,35,0-2,b5,ff,5c,0-7,26,30,0-4,ff,55,0,2e,ff-2,80,0-8,a3,ff,64,0-2,8,b2,fb,51,23,cd,ff,f0,29,0-4,11,cd,ff-3,7f,7,0-15,2d,ff-2,66,0-e,69,ff-2,2c,0-1b,55,ff,aa,0-d,39,aa-3,0-1c,39,aa-3,0-a,b0,ff,d2,28,0-1e,55,ff-2,55,0-18,53,f7,ba,11,0,a,f5,fc,18,0-7,55,f7,89,3e,13,3,ff,58,2b,b3,ff,f1,24,0-8,78,ff,bd,1b,8,4f,e0,e4,3a,0,5f,fa,ff,d8,5b,16,4,a,29,a3,fe,ff-2,6d,2,0-16,e1,ff,a0,3,0-c,4,a3,ff,df,0-1c,55,ff,aa,0-d,55,ff-3,0-1c,55,ff-3,0-9,32,fe,ff,78,0-1f,55,ff-2,55,0-18,84,ff,8f,1,0,3a,ff,d9,1,0-7,55,ff,fd,e6,bd,aa,ff,c9,d2,fa,f5,7e,0-9,21,f0,fd,c5,b2,df,fe,a4,e,0,8,9a,f9,ff,f0,c0,ae,b4,d3,fe,df,f7,ff,cb,24,0-16,9a,ff,c4,1a,0-c,1c,c6,ff,98,0-1c,55,ff,aa,0-d,55,ff-3,0-1c,55,ff-3,0-8,5,94,ff,f6,1b,0-1f,55,ff-2,55,0-18,cd,ff,48,0-2,84,ff,92,0-8,c,50,ac,ce,ea,f8,ff,f9,e4,c1,4a,3,0-a,44,bf,f4,fb,e4,a5,d,0-3,5,4f,c0,e3,f8,fc,ee,d3,81,18,83,fb,fe,90,0-16,43,ec,ee,48,0-c,4b,f0,ec,43,0-2c,71,ff-2,c8,0-1c,55,ff-3,0-8,39,e1,fe,91,0-20,1c,55-2,1c,0-18,4e,55,e,0-2,35,55,27,0-a,8,24,40,50,ff,89,3a,17,0-c,1,1d,4a,51,3a,f,0-6,16,39,4e,52,44,29,2,0,19,51,55,45,0-16,13,ba,fe,89,0-c,8c,ff,ba,14,0-2c,ab,ff,f5,5f,0-1c,1c,55-3,0-8,83,fd,e7,41,0-51,2,ff,56,0-3d,48,fd,eb,f,0-a,10,ec,fd,4a,0-2c,6,ee,ff,b0,12,0-27,13,ef,ff,9f,8,0-51,1,ff,56,0-3d,6,c8,ff,60,0-a,62,ff,c8,6,0-2c,2f,ff-2,4d,0-28,6a,ff-2,40,0-53,ff,55,0-3e,41,e6,cb,21,0-8,22,cc,e6,41,0-2d,78,ff,bb,0-80,55,1c,0-3e,9,42,4e,15,0-8,15,4e,42,9,0-2d,32,55,2b,0-338"; + +IGL_INLINE void decompress_verasansmono_atlas(unsigned char* _fontatlas) +{ + std::string s = verasansmono_compressed_atlas; // Make a copy so that we can erase pieces as we parse the atlas + std::string delim_atlas = ","; + std::string delim_item = "-"; + size_t atlas_split = 0; // Locations found with delims above + size_t item_split = 0; + std::string curr_item; // Current element of the atlas string + int full_res = 0; // Running sum of the total bytes (256*256*1) + + while ((atlas_split = s.find(delim_atlas)) != std::string::npos) { + curr_item = s.substr(0, atlas_split); + if(curr_item.find(delim_item) != std::string::npos) + { + item_split = curr_item.find(delim_item); + unsigned int occurences = (unsigned int)std::stoi(curr_item.substr(item_split+1, curr_item.length()-1), 0, 16); + for(int i=0; i + +namespace igl +{ +namespace opengl +{ + +IGL_INLINE void decompress_verasansmono_atlas(unsigned char* _fontatlas); + +} + +} + +#ifndef IGL_STATIC_LIBRARY +# include "verasansmono_compressed.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/opengl/vertex_array.cpp b/vendor/libigl/include/igl/opengl/vertex_array.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c07113ad3f28b6eb8bd94aa98f048c792cce2e5e --- /dev/null +++ b/vendor/libigl/include/igl/opengl/vertex_array.cpp @@ -0,0 +1,61 @@ +#include "vertex_array.h" +#include + +template < + typename DerivedV, + typename DerivedF> +IGL_INLINE void igl::opengl::vertex_array( + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + GLuint & va_id, + GLuint & ab_id, + GLuint & eab_id) +{ + // Inputs should be in RowMajor storage. If not, we have no choice but to + // create a copy. + if(!(V.Options & Eigen::RowMajor)) + { + Eigen::Matrix< + typename DerivedV::Scalar, + DerivedV::RowsAtCompileTime, + DerivedV::ColsAtCompileTime, + Eigen::RowMajor> VR = V; + return vertex_array(VR,F,va_id,ab_id,eab_id); + } + if(!(F.Options & Eigen::RowMajor)) + { + Eigen::Matrix< + typename DerivedF::Scalar, + DerivedF::RowsAtCompileTime, + DerivedF::ColsAtCompileTime, + Eigen::RowMajor> FR = F; + return vertex_array(V,FR,va_id,ab_id,eab_id); + } + // Generate and attach buffers to vertex array + glGenVertexArrays(1, &va_id); + glGenBuffers(1, &ab_id); + glGenBuffers(1, &eab_id); + glBindVertexArray(va_id); + glBindBuffer(GL_ARRAY_BUFFER, ab_id); + const auto size_VScalar = sizeof(typename DerivedV::Scalar); + const auto size_FScalar = sizeof(typename DerivedF::Scalar); + glBufferData(GL_ARRAY_BUFFER,size_VScalar*V.size(),V.data(),GL_STATIC_DRAW); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, eab_id); + assert(sizeof(GLuint) == size_FScalar && "F type does not match GLuint"); + glBufferData( + GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)*F.size(), F.data(), GL_STATIC_DRAW); + glVertexAttribPointer( + 0, + V.cols(), + size_VScalar==sizeof(float)?GL_FLOAT:GL_DOUBLE, + GL_FALSE, + V.cols()*size_VScalar, + (GLvoid*)0); + glEnableVertexAttribArray(0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindVertexArray(0); +} + +#ifdef IGL_STATIC_LIBRARY +template void igl::opengl::vertex_array, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, unsigned int&, unsigned int&, unsigned int&); +#endif diff --git a/vendor/libigl/include/igl/opengl/vertex_array.h b/vendor/libigl/include/igl/opengl/vertex_array.h new file mode 100644 index 0000000000000000000000000000000000000000..1342a9c90cbbde58d29c72783ae48116f3de5289 --- /dev/null +++ b/vendor/libigl/include/igl/opengl/vertex_array.h @@ -0,0 +1,38 @@ +#ifndef IGL_OPENGL_VERTEX_ARRAY_H +#define IGL_OPENGL_VERTEX_ARRAY_H +#include +#include +#include +namespace igl +{ + namespace opengl + { + // Create a GL_VERTEX_ARRAY for a given mesh (V,F) + // + // Inputs: + // V #V by dim list of mesh vertex positions + // F #F by 3 list of mesh triangle indices into V + // Outputs: + // va_id id of vertex array + // ab_id id of array buffer (vertex buffer object) + // eab_id id of element array buffer (element/face buffer object) + // + template < + typename DerivedV, + typename DerivedF> + IGL_INLINE void vertex_array( + // Note: Unlike most libigl functions, the **input** Eigen matrices must + // be `Eigen::PlainObjectBase` because we want to directly access it's + // underlying storage. It cannot be `Eigen::MatrixBase` (see + // http://stackoverflow.com/questions/25094948/) + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F, + GLuint & va_id, + GLuint & ab_id, + GLuint & eab_id); + } +} +#ifndef IGL_STATIC_LIBRARY +# include "vertex_array.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/orient_outward.cpp b/vendor/libigl/include/igl/orient_outward.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c422e6151a9d76418d3a54af21822f50875a9d3 --- /dev/null +++ b/vendor/libigl/include/igl/orient_outward.cpp @@ -0,0 +1,96 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "orient_outward.h" +#include "per_face_normals.h" +#include "barycenter.h" +#include "doublearea.h" +#include + +template < + typename DerivedV, + typename DerivedF, + typename DerivedC, + typename DerivedFF, + typename DerivedI> +IGL_INLINE void igl::orient_outward( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & C, + Eigen::PlainObjectBase & FF, + Eigen::PlainObjectBase & I) +{ + using namespace Eigen; + using namespace std; + assert(C.rows() == F.rows()); + assert(F.cols() == 3); + assert(V.cols() == 3); + + // number of faces + const int m = F.rows(); + // number of patches + const int num_cc = C.maxCoeff()+1; + I.resize(num_cc); + if(&FF != &F) + { + FF = F; + } + DerivedV N,BC,BCmean; + Matrix A; + VectorXd totA(num_cc), dot(num_cc); + Matrix Z(1,1,1); + per_face_normals(V,F,Z.normalized(),N); + barycenter(V,F,BC); + doublearea(V,F,A); + BCmean.setConstant(num_cc,3,0); + dot.setConstant(num_cc,1,0); + totA.setConstant(num_cc,1,0); + // loop over faces + for(int f = 0;f, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::orient_outward, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif + diff --git a/vendor/libigl/include/igl/orientable_patches.h b/vendor/libigl/include/igl/orientable_patches.h new file mode 100644 index 0000000000000000000000000000000000000000..a77cf3cb89ddddd0ac0b8b0bcd950602b897c17e --- /dev/null +++ b/vendor/libigl/include/igl/orientable_patches.h @@ -0,0 +1,41 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_ORIENTABLE_PATCHES_H +#define IGL_ORIENTABLE_PATCHES_H +#include +#include +#include +namespace igl +{ + // Compute connected components of facets connected by manifold edges. + // + // Known bugs: This will detect a moebius strip as a single patch (manifold, + // non-orientable) and also non-manfiold, yet orientable patches. + // + // Q: Does this find exactly (manifold || orientable) patches? + // + // Inputs: + // F #F by simplex-size list of facets + // Outputs: + // C #F list of component ids + // A #F by #F adjacency matrix + // + template + IGL_INLINE void orientable_patches( + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & C, + Eigen::SparseMatrix & A); + template + IGL_INLINE void orientable_patches( + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & C); +}; +#ifndef IGL_STATIC_LIBRARY +# include "orientable_patches.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/orth.cpp b/vendor/libigl/include/igl/orth.cpp new file mode 100644 index 0000000000000000000000000000000000000000..467a4993e0a6e9d1b661e7012d2b815d3bd3acdf --- /dev/null +++ b/vendor/libigl/include/igl/orth.cpp @@ -0,0 +1,32 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "orth.h" + +// Broken Implementation +IGL_INLINE void igl::orth(const Eigen::MatrixXd &A, Eigen::MatrixXd &Q) +{ + + //perform svd on A = U*S*V' (V is not computed and only the thin U is computed) + Eigen::JacobiSVD svd(A, Eigen::ComputeThinU ); + Eigen::MatrixXd U = svd.matrixU(); + const Eigen::VectorXd S = svd.singularValues(); + + //get rank of A + int m = A.rows(); + int n = A.cols(); + double tol = std::max(m,n) * S.maxCoeff() * 2.2204e-16; + int r = 0; + for (int i = 0; i < S.rows(); ++r,++i) + { + if (S[i] < tol) + break; + } + + //keep r first columns of U + Q = U.block(0,0,U.rows(),r); +} diff --git a/vendor/libigl/include/igl/outer_element.cpp b/vendor/libigl/include/igl/outer_element.cpp new file mode 100644 index 0000000000000000000000000000000000000000..59826f71e929a1afa8e695676bf689f55acd9126 --- /dev/null +++ b/vendor/libigl/include/igl/outer_element.cpp @@ -0,0 +1,280 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "outer_element.h" +#include +#include + +template < + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename IndexType, + typename DerivedA + > +IGL_INLINE void igl::outer_vertex( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & I, + IndexType & v_index, + Eigen::PlainObjectBase & A) +{ + // Algorithm: + // Find an outer vertex (i.e. vertex reachable from infinity) + // Return the vertex with the largest X value. + // If there is a tie, pick the one with largest Y value. + // If there is still a tie, pick the one with the largest Z value. + // If there is still a tie, then there are duplicated vertices within the + // mesh, which violates the precondition. + typedef typename DerivedF::Scalar Index; + const Index INVALID = std::numeric_limits::max(); + const size_t num_selected_faces = I.rows(); + std::vector candidate_faces; + Index outer_vid = INVALID; + typename DerivedV::Scalar outer_val = 0; + for (size_t i=0; i outer_val) + { + outer_val = vx; + outer_vid = v; + candidate_faces = {f}; + } else if (v == outer_vid) + { + candidate_faces.push_back(f); + } else if (vx == outer_val) + { + // Break tie. + auto vy = V(v,1); + auto vz = V(v, 2); + auto outer_y = V(outer_vid, 1); + auto outer_z = V(outer_vid, 2); + assert(!(vy == outer_y && vz == outer_z)); + bool replace = (vy > outer_y) || + ((vy == outer_y) && (vz > outer_z)); + if (replace) + { + outer_val = vx; + outer_vid = v; + candidate_faces = {f}; + } + } + } + } + + assert(outer_vid != INVALID); + assert(candidate_faces.size() > 0); + v_index = outer_vid; + A.resize(candidate_faces.size(),1); + std::copy(candidate_faces.begin(), candidate_faces.end(), A.data()); +} + +template< + typename DerivedV, + typename DerivedF, + typename DerivedI, + typename IndexType, + typename DerivedA + > +IGL_INLINE void igl::outer_edge( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & I, + IndexType & v1, + IndexType & v2, + Eigen::PlainObjectBase & A) { + // Algorithm: + // Find an outer vertex first. + // Find the incident edge with largest abs slope when projected onto XY plane. + // If there is a tie, check the signed slope and use the positive one. + // If there is still a tie, break it using the projected slope onto ZX plane. + // If there is still a tie, again check the signed slope and use the positive one. + // If there is still a tie, then there are multiple overlapping edges, + // which violates the precondition. + typedef typename DerivedV::Scalar Scalar; + typedef typename DerivedV::Index Index; + typedef typename Eigen::Matrix ScalarArray3; + typedef typename Eigen::Matrix IndexArray3; + const Index INVALID = std::numeric_limits::max(); + + Index outer_vid; + Eigen::Matrix candidate_faces; + outer_vertex(V, F, I, outer_vid, candidate_faces); + const ScalarArray3& outer_v = V.row(outer_vid); + assert(candidate_faces.size() > 0); + + auto get_vertex_index = [&](const IndexArray3& f, Index vid) -> Index + { + if (f[0] == vid) return 0; + if (f[1] == vid) return 1; + if (f[2] == vid) return 2; + assert(false); + return -1; + }; + + auto unsigned_value = [](Scalar v) -> Scalar { + if (v < 0) return v * -1; + else return v; + }; + + Scalar outer_slope_YX = 0; + Scalar outer_slope_ZX = 0; + Index outer_opp_vid = INVALID; + bool infinite_slope_detected = false; + std::vector incident_faces; + auto check_and_update_outer_edge = [&](Index opp_vid, Index fid) { + if (opp_vid == outer_opp_vid) + { + incident_faces.push_back(fid); + return; + } + + const ScalarArray3 opp_v = V.row(opp_vid); + if (!infinite_slope_detected && outer_v[0] != opp_v[0]) + { + // Finite slope + const ScalarArray3 diff = opp_v - outer_v; + const Scalar slope_YX = diff[1] / diff[0]; + const Scalar slope_ZX = diff[2] / diff[0]; + const Scalar u_slope_YX = unsigned_value(slope_YX); + const Scalar u_slope_ZX = unsigned_value(slope_ZX); + bool update = false; + if (outer_opp_vid == INVALID) { + update = true; + } else { + const Scalar u_outer_slope_YX = unsigned_value(outer_slope_YX); + if (u_slope_YX > u_outer_slope_YX) { + update = true; + } else if (u_slope_YX == u_outer_slope_YX && + slope_YX > outer_slope_YX) { + update = true; + } else if (slope_YX == outer_slope_YX) { + const Scalar u_outer_slope_ZX = + unsigned_value(outer_slope_ZX); + if (u_slope_ZX > u_outer_slope_ZX) { + update = true; + } else if (u_slope_ZX == u_outer_slope_ZX && + slope_ZX > outer_slope_ZX) { + update = true; + } else if (slope_ZX == u_outer_slope_ZX) { + assert(false); + } + } + } + + if (update) { + outer_opp_vid = opp_vid; + outer_slope_YX = slope_YX; + outer_slope_ZX = slope_ZX; + incident_faces = {fid}; + } + } else if (!infinite_slope_detected) + { + // Infinite slope + outer_opp_vid = opp_vid; + infinite_slope_detected = true; + incident_faces = {fid}; + } + }; + + const size_t num_candidate_faces = candidate_faces.size(); + for (size_t i=0; i +IGL_INLINE void igl::outer_facet( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & N, + const Eigen::MatrixBase & I, + IndexType & f, + bool & flipped) { + // Algorithm: + // Find an outer edge. + // Find the incident facet with the largest absolute X normal component. + // If there is a tie, keep the one with positive X component. + // If there is still a tie, pick the face with the larger signed index + // (flipped face has negative index). + typedef typename DerivedV::Scalar Scalar; + typedef typename DerivedV::Index Index; + const size_t INVALID = std::numeric_limits::max(); + + Index v1,v2; + Eigen::Matrix incident_faces; + outer_edge(V, F, I, v1, v2, incident_faces); + assert(incident_faces.size() > 0); + + auto generic_fabs = [&](const Scalar& val) -> const Scalar { + if (val >= 0) return val; + else return -val; + }; + + Scalar max_nx = 0; + size_t outer_fid = INVALID; + const size_t num_incident_faces = incident_faces.size(); + for (size_t i=0; i generic_fabs(max_nx)) { + max_nx = nx; + outer_fid = fid; + } else if (nx == -max_nx && nx > 0) { + max_nx = nx; + outer_fid = fid; + } else if (nx == max_nx) { + if ((max_nx >= 0 && outer_fid < fid) || + (max_nx < 0 && outer_fid > fid)) { + max_nx = nx; + outer_fid = fid; + } + } + } + } + + assert(outer_fid != INVALID); + f = outer_fid; + flipped = max_nx < 0; +} + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::outer_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int&, bool&); +template void igl::outer_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, unsigned long>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned long&, bool&); +template void igl::outer_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int&, bool&); +template void igl::outer_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int&, bool&); +#endif diff --git a/vendor/libigl/include/igl/pathinfo.cpp b/vendor/libigl/include/igl/pathinfo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..110535cd8bcd661a4b5834d43626ec5fb06268d2 --- /dev/null +++ b/vendor/libigl/include/igl/pathinfo.cpp @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "pathinfo.h" + +#include "dirname.h" +#include "basename.h" +// Verbose should be removed once everything working correctly +#include "verbose.h" +#include + +IGL_INLINE void igl::pathinfo( + const std::string & path, + std::string & dirname, + std::string & basename, + std::string & extension, + std::string & filename) +{ + dirname = igl::dirname(path); + basename = igl::basename(path); + std::string::reverse_iterator last_dot = + std::find( + basename.rbegin(), + basename.rend(), '.'); + // Was a dot found? + if(last_dot == basename.rend()) + { + // filename is same as basename + filename = basename; + // no extension + extension = ""; + }else + { + // extension is substring of basename + extension = std::string(last_dot.base(),basename.end()); + // filename is substring of basename + filename = std::string(basename.begin(),last_dot.base()-1); + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +#endif diff --git a/vendor/libigl/include/igl/per_edge_normals.h b/vendor/libigl/include/igl/per_edge_normals.h new file mode 100644 index 0000000000000000000000000000000000000000..b40d7297681333df3f2eb985d6c48ca9ef1ec83c --- /dev/null +++ b/vendor/libigl/include/igl/per_edge_normals.h @@ -0,0 +1,81 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_PER_EDGE_NORMALS_H +#define IGL_PER_EDGE_NORMALS_H +#include "igl_inline.h" +#include +namespace igl +{ + enum PerEdgeNormalsWeightingType + { + // Incident face normals have uniform influence on edge normal + PER_EDGE_NORMALS_WEIGHTING_TYPE_UNIFORM = 0, + // Incident face normals are averaged weighted by area + PER_EDGE_NORMALS_WEIGHTING_TYPE_AREA = 1, + // Area weights + PER_EDGE_NORMALS_WEIGHTING_TYPE_DEFAULT = 2, + NUM_PER_EDGE_NORMALS_WEIGHTING_TYPE = 3 + }; + // Compute face normals via vertex position list, face list + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (triangle) indices + // weight weighting type + // FN #F by 3 matrix of 3D face normals per face + // Output: + // N #2 by 3 matrix of mesh edge 3D normals per row + // E #E by 2 matrix of edge indices per row + // EMAP #E by 1 matrix of indices from all edges to E + // + template < + typename DerivedV, + typename DerivedF, + typename DerivedFN, + typename DerivedN, + typename DerivedE, + typename DerivedEMAP> + IGL_INLINE void per_edge_normals( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const PerEdgeNormalsWeightingType weight, + const Eigen::MatrixBase& FN, + Eigen::PlainObjectBase & N, + Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & EMAP); + template < + typename DerivedV, + typename DerivedF, + typename DerivedN, + typename DerivedE, + typename DerivedEMAP> + IGL_INLINE void per_edge_normals( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const PerEdgeNormalsWeightingType weight, + Eigen::PlainObjectBase & N, + Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & EMAP); + template < + typename DerivedV, + typename DerivedF, + typename DerivedN, + typename DerivedE, + typename DerivedEMAP> + IGL_INLINE void per_edge_normals( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + Eigen::PlainObjectBase & N, + Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & EMAP); +} + +#ifndef IGL_STATIC_LIBRARY +# include "per_edge_normals.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/png/readPNG.cpp b/vendor/libigl/include/igl/png/readPNG.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0459c857420fa66ea62ffc1905429b1cee9363d5 --- /dev/null +++ b/vendor/libigl/include/igl/png/readPNG.cpp @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "readPNG.h" +#include + +IGL_INLINE bool igl::png::readPNG( + const std::string png_file, + Eigen::Matrix& R, + Eigen::Matrix& G, + Eigen::Matrix& B, + Eigen::Matrix& A +) +{ + int cols,rows,n; + unsigned char *data = stbi_load(png_file.c_str(), &cols, &rows, &n, 4); + if(data == NULL) { + return false; + } + + R.resize(cols,rows); + G.resize(cols,rows); + B.resize(cols,rows); + A.resize(cols,rows); + + for (unsigned i=0; i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_PNG_READ_PNG_H +#define IGL_PNG_READ_PNG_H +#include "../igl_inline.h" +#include +#include + +namespace igl +{ + namespace png + { + // Read an image from a .png file into 4 memory buffers + // + // Input: + // png_file path to .png file + // Output: + // R,G,B,A texture channels + // Returns true on success, false on failure + // + IGL_INLINE bool readPNG(const std::string png_file, + Eigen::Matrix& R, + Eigen::Matrix& G, + Eigen::Matrix& B, + Eigen::Matrix& A + ); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "readPNG.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/png/render_to_png.cpp b/vendor/libigl/include/igl/png/render_to_png.cpp new file mode 100644 index 0000000000000000000000000000000000000000..23e5b3ba2eddc7c03092c4ad54fcde7e82ec3ea4 --- /dev/null +++ b/vendor/libigl/include/igl/png/render_to_png.cpp @@ -0,0 +1,45 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "render_to_png.h" +#include + +#include "../opengl/gl.h" + +IGL_INLINE bool igl::png::render_to_png( + const std::string png_file, + const int width, + const int height, + const bool alpha, + const bool fast) +{ + unsigned char * data = new unsigned char[4*width*height]; + glReadPixels( + 0, + 0, + width, + height, + GL_RGBA, + GL_UNSIGNED_BYTE, + data); + //img->flip(); + if(!alpha) + { + for(int i = 0;i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_PNG_RENDER_TO_PNG_H +#define IGL_PNG_RENDER_TO_PNG_H +#include + +#include +namespace igl +{ + namespace png + { + // + // Render current open GL image to .png file + // Inputs: + // png_file path to output .png file + // width width of scene and resulting image + // height height of scene and resulting image + // alpha whether to include alpha channel + // fast sacrifice compression ratio for speed + // Returns true only if no errors occurred + // + // See also: igl/render_to_tga which is faster but writes .tga files + IGL_INLINE bool render_to_png( + const std::string png_file, + const int width, + const int height, + const bool alpha = true, + const bool fast = false); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "render_to_png.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/png/render_to_png_async.cpp b/vendor/libigl/include/igl/png/render_to_png_async.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f09d662de68202c045218a3332bcd2770891815b --- /dev/null +++ b/vendor/libigl/include/igl/png/render_to_png_async.cpp @@ -0,0 +1,54 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "render_to_png_async.h" +#include "../opengl/gl.h" +#include + +static IGL_INLINE bool render_to_png_async_helper( + unsigned char * img, int width, int height, + const std::string png_file, + const bool alpha, + const bool fast) +{ + //img->flip(); + if(!alpha) + { + for(int i = 0;i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_PNG_RENDER_TO_PNG_ASYNC_H +#define IGL_PNG_RENDER_TO_PNG_ASYNC_H +#include +#include +//#include + +#include +namespace igl +{ + namespace png + { + // History: + // added multithreaded parameter and support, Alec Sept 3, 2012 + // + // Render current open GL image to .png file + // Inputs: + // png_file path to output .png file + // width width of scene and resulting image + // height height of scene and resulting image + // alpha whether to include alpha channel + // fast sacrifice compression ratio for speed + // Returns true only if no errors occurred + // + // See also: igl/render_to_tga which is faster but writes .tga files + IGL_INLINE std::thread render_to_png_async( + const std::string png_file, + const int width, + const int height, + const bool alpha = true, + const bool fast = false); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "render_to_png_async.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/png/texture_from_file.cpp b/vendor/libigl/include/igl/png/texture_from_file.cpp new file mode 100644 index 0000000000000000000000000000000000000000..60e8c795cf6ec684a1840ddb755535b1b589f248 --- /dev/null +++ b/vendor/libigl/include/igl/png/texture_from_file.cpp @@ -0,0 +1,61 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "texture_from_file.h" + +#include "texture_from_png.h" +#include "../STR.h" +#include "../pathinfo.h" +#include "../opengl/report_gl_error.h" +//#include "../opengl2/texture_from_tga.h" +#include +#include +#include + +IGL_INLINE bool igl::png::texture_from_file(const std::string filename, GLuint & id) +{ + using namespace igl::opengl; + using namespace std; + // dirname, basename, extension and filename + string d,b,ext,f; + pathinfo(filename,d,b,ext,f); + // Convert extension to lower case + transform(ext.begin(), ext.end(), ext.begin(), ::tolower); + //if(ext == "tga") + //{ + // return texture_from_tga(filename,id); + //}else + if(ext == "png") + { + return texture_from_png(filename,id); + }else + { +#ifdef __APPLE__ + // Convert to a temporary png file + string tmp = "/var/tmp/.texture_from_file.png"; +#define PATH_TO_CONVERT "/opt/local/bin/convert" + string command = STR(PATH_TO_CONVERT<<" \""< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_PNG_TEXTURE_FROM_FILE_H +#define IGL_PNG_TEXTURE_FROM_FILE_H +#include "../igl_inline.h" +#include "../opengl/gl.h" + +#include + +namespace igl +{ + namespace png + { + // Read an image from an image file and use it as a texture. Officially, + // only .tga and .png are supported. Any filetype read by + // ImageMagick's `convert` will work via an unsafe system call. + // + // Input: + // filename path to image file + // Output: + // id of generated openGL texture + // Returns true on success, false on failure + IGL_INLINE bool texture_from_file(const std::string filename, GLuint & id); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "texture_from_file.cpp" +#endif + +#endif + + + diff --git a/vendor/libigl/include/igl/png/texture_from_png.cpp b/vendor/libigl/include/igl/png/texture_from_png.cpp new file mode 100644 index 0000000000000000000000000000000000000000..280e42aaab14e616d463c684a2956ef141d11461 --- /dev/null +++ b/vendor/libigl/include/igl/png/texture_from_png.cpp @@ -0,0 +1,83 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "texture_from_png.h" + +#include "../opengl/report_gl_error.h" +#include + +IGL_INLINE bool igl::png::texture_from_png(const std::string png_file, const bool flip, GLuint & id) +{ + int width,height,n; + unsigned char *data = stbi_load(png_file.c_str(), &width, &height, &n, 4); + if(data == NULL) { + return false; + } + + // Why do I need to flip? + /*if(flip) + { + yimg.flip(); + }*/ + + glGenTextures(1, &id); + glBindTexture(GL_TEXTURE_2D, id); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexImage2D( + GL_TEXTURE_2D, 0, GL_RGB, + width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); + glBindTexture(GL_TEXTURE_2D, 0); + + stbi_image_free(data); + + return true; +} + +IGL_INLINE bool igl::png::texture_from_png(const std::string png_file, GLuint & id) +{ + return texture_from_png(png_file,false,id); +} + + +IGL_INLINE bool igl::png::texture_from_png( + const std::string png_file, + Eigen::Matrix& R, + Eigen::Matrix& G, + Eigen::Matrix& B, + Eigen::Matrix& A +) +{ + int width,height,n; + unsigned char *data = stbi_load(png_file.c_str(), &width, &height, &n, 4); + if(data == NULL) { + return false; + } + + R.resize(height,width); + G.resize(height,width); + B.resize(height,width); + A.resize(height,width); + + for (unsigned j=0; j +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_PNG_TEXTURE_FROM_PNG_H +#define IGL_PNG_TEXTURE_FROM_PNG_H +#include "../igl_inline.h" +#include +#include + +#include "../opengl/gl.h" + +namespace igl +{ + namespace png + { + // Read an image from a .png file and use it as a texture + // + // Input: + // png_file path to .png file + // flip whether to flip the image vertically (A --> ∀) + // Output: + // id of generated openGL texture + // Returns true on success, false on failure + IGL_INLINE bool texture_from_png(const std::string png_file, const bool flip, GLuint & id); + IGL_INLINE bool texture_from_png(const std::string png_file, GLuint & id); + + // Read an image from a .png file and use it as a texture + // + // Input: + // png_file path to .png file + // Output: + // R,G,B,A texture channels + // Returns true on success, false on failure + // + // Todo: this is an inappropriate function name. This is really just + // reading a png.... Not necessarily as a texture. + IGL_INLINE bool texture_from_png(const std::string png_file, + Eigen::Matrix& R, + Eigen::Matrix& G, + Eigen::Matrix& B, + Eigen::Matrix& A + ); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "texture_from_png.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/png/writePNG.cpp b/vendor/libigl/include/igl/png/writePNG.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0b6060538918bef83d2904ddfc232382e0a19650 --- /dev/null +++ b/vendor/libigl/include/igl/png/writePNG.cpp @@ -0,0 +1,46 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "writePNG.h" +#include +#include + +IGL_INLINE bool igl::png::writePNG( + const Eigen::Matrix& R, + const Eigen::Matrix& G, + const Eigen::Matrix& B, + const Eigen::Matrix& A, + const std::string png_file +) +{ + assert((R.rows() == G.rows()) && (G.rows() == B.rows()) && (B.rows() == A.rows())); + assert((R.cols() == G.cols()) && (G.cols() == B.cols()) && (B.cols() == A.cols())); + + const int comp = 4; // 4 Channels Red, Green, Blue, Alpha + const int stride_in_bytes = R.rows()*comp; // Length of one row in bytes + std::vector data(R.size()*comp,0); // The image itself; + + for (unsigned i = 0; i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_PNG_WRITE_PNG_H +#define IGL_PNG_WRITE_PNG_H +#include "../igl_inline.h" +#include +#include + +namespace igl +{ + namespace png + { + // Writes an image to a png file + // + // Input: + // R,G,B,A texture channels + // Output: + // png_file path to .png file + // Returns true on success, false on failure + // + IGL_INLINE bool writePNG + ( + const Eigen::Matrix& R, + const Eigen::Matrix& G, + const Eigen::Matrix& B, + const Eigen::Matrix& A, + const std::string png_file + ); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "writePNG.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/point_in_circle.cpp b/vendor/libigl/include/igl/point_in_circle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9c26d8c0dcd0b00f7cb1bc839d3142ad498ed8cc --- /dev/null +++ b/vendor/libigl/include/igl/point_in_circle.cpp @@ -0,0 +1,18 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "point_in_circle.h" + +IGL_INLINE bool igl::point_in_circle( + const double qx, + const double qy, + const double cx, + const double cy, + const double r) +{ + return (qx-cx)*(qx-cx) + (qy-cy)*(qy-cy) - r*r < 0; +} diff --git a/vendor/libigl/include/igl/polar_svd.cpp b/vendor/libigl/include/igl/polar_svd.cpp new file mode 100644 index 0000000000000000000000000000000000000000..adf50e8fcd9e6f05e6e503549f0609e1d6b38aea --- /dev/null +++ b/vendor/libigl/include/igl/polar_svd.cpp @@ -0,0 +1,92 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "polar_svd.h" +#include +#include +#include + +// Adapted from Olga's CGAL mentee's ARAP code +template < + typename DerivedA, + typename DerivedR, + typename DerivedT> +IGL_INLINE void igl::polar_svd( + const Eigen::MatrixBase & A, + Eigen::PlainObjectBase & R, + Eigen::PlainObjectBase & T) +{ + typedef + Eigen::Matrix + MatA; + MatA U; + MatA V; + Eigen::Matrix S; + return igl::polar_svd(A,R,T,U,S,V); +} + +template < + typename DerivedA, + typename DerivedR, + typename DerivedT, + typename DerivedU, + typename DerivedS, + typename DerivedV> +IGL_INLINE void igl::polar_svd( + const Eigen::MatrixBase & A, + Eigen::PlainObjectBase & R, + Eigen::PlainObjectBase & T, + Eigen::PlainObjectBase & U, + Eigen::PlainObjectBase & S, + Eigen::PlainObjectBase & V) +{ + using namespace std; + typedef + Eigen::Matrix + MatA; + Eigen::JacobiSVD svd; + svd.compute(A, Eigen::ComputeFullU | Eigen::ComputeFullV ); + U = svd.matrixU(); + V = svd.matrixV(); + S = svd.singularValues(); + R = U*V.transpose(); + const auto & SVT = S.asDiagonal() * V.adjoint(); + // Check for reflection + if(R.determinant() < 0) + { + // Annoyingly the .eval() is necessary + auto W = V.eval(); + W.col(V.cols()-1) *= -1.; + R = U*W.transpose(); + T = W*SVT; + }else + { + T = V*SVT; + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::polar_svd >, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(Eigen::MatrixBase > const &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/polygon_corners.h b/vendor/libigl/include/igl/polygon_corners.h new file mode 100644 index 0000000000000000000000000000000000000000..6766d1f6db869f9e9392aeb3dd429e76ace3ad50 --- /dev/null +++ b/vendor/libigl/include/igl/polygon_corners.h @@ -0,0 +1,55 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_POLYGON_CORNERS_H +#define IGL_POLYGON_CORNERS_H +#include "igl_inline.h" +#include +#include + +namespace igl +{ + // Convert a list-of-lists polygon mesh faces representation to list of + // polygon corners and sizes + // + // Inputs: + // P #P list of lists of vertex indices into rows of some matrix V + // Outputs: + // I #I vectorized list of polygon corner indices into rows of some matrix V + // C #P+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of + // the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of + // the ith polygon + // + template < + typename PType, + typename DerivedI, + typename DerivedC> + IGL_INLINE void polygon_corners( + const std::vector > & P, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C); + // Convert a pure k-gon list of polygon mesh indices to list of polygon corners + // and sizes + // + // Inputs: + // Q #Q by k list of polygon indices (ith row is a k-gon, unless Q(i,j) = + // -1 then it's a j-gon) + template < + typename DerivedQ, + typename DerivedI, + typename DerivedC> + IGL_INLINE void polygon_corners( + const Eigen::MatrixBase & Q, + Eigen::PlainObjectBase & I, + Eigen::PlainObjectBase & C); +} + +#ifndef IGL_STATIC_LIBRARY +# include "polygon_corners.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/predicates/ear_clipping.cpp b/vendor/libigl/include/igl/predicates/ear_clipping.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fc3cd1b794e8b563b3793dd1d6d18eea420befa5 --- /dev/null +++ b/vendor/libigl/include/igl/predicates/ear_clipping.cpp @@ -0,0 +1,124 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Hanxiao Shen +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include +#include "ear_clipping.h" +#include "point_inside_convex_polygon.h" +#include "predicates.h" + +template +IGL_INLINE void igl::predicates::ear_clipping( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& RT, + Eigen::PlainObjectBase& I, + Eigen::PlainObjectBase& eF, + Eigen::PlainObjectBase& nP +){ + typedef typename DerivedF::Scalar Index; + typedef typename DerivedP::Scalar Scalar; + static_assert(std::is_same::value, + "index type should be consistent"); + + // check whether vertex i is an ear + auto is_ear = []( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& RT, + const Eigen::Matrix& L, + const Eigen::Matrix& R, + const Index i + ){ + + Index a = L(i), b = R(i); + if(RT(i) != 0 || RT(a) != 0 || RT(b) != 0) return false; + Eigen::Matrix pa = P.row(a); + Eigen::Matrix pb = P.row(b); + Eigen::Matrix pi = P.row(i); + auto r = igl::predicates::orient2d(pa,pi,pb); + if(r == igl::predicates::Orientation::NEGATIVE || + r == igl::predicates::Orientation::COLLINEAR) return false; + + // check if any vertex is lying inside triangle (a,b,i); + Index k=R(b); + while(k!=a){ + Eigen::Matrix T(3,2); + T< q=P.row(k); + if(igl::predicates::point_inside_convex_polygon(T,q)) + return false; + k=R(k); + } + return true; + }; + + Eigen::Matrix L(P.rows()); + Eigen::Matrix R(P.rows()); + for(int i=0;i ears; // mark ears + Eigen::Matrix X; // clipped vertices + ears.setZero(P.rows()); + X.setZero(P.rows()); + + // initialize ears + for(int i=0;i, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/predicates/ear_clipping.h b/vendor/libigl/include/igl/predicates/ear_clipping.h new file mode 100644 index 0000000000000000000000000000000000000000..79e6f9fe0bb4fb28618cec5f8f6c3fc4600d42bc --- /dev/null +++ b/vendor/libigl/include/igl/predicates/ear_clipping.h @@ -0,0 +1,51 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Hanxiao Shen +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_PREDICATES_EAR_CLIPPING_H +#define IGL_PREDICATES_EAR_CLIPPING_H + +#include +#include "../igl_inline.h" + +namespace igl +{ + namespace predicates + { + + // Implementation of ear clipping triangulation algorithm for a 2D polygon. + // https://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf + // If the polygon is simple, all vertices will be clipped and the result mesh is (P,eF) + // Otherwise, the function will try to clip as many ears as possible. + // + // Input: + // P : n*2, size n 2D polygon + // RT: n*1, preserved vertices (do not clip) marked as 1, otherwise 0 + // Output: + // I : size #nP vector, maps index from nP to P, e.g. nP's ith vertex is origianlly I(i) in P + // eF: clipped ears, in original index of P + // nP: leftover vertices after clipping + + template + IGL_INLINE void ear_clipping( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& RT, + Eigen::PlainObjectBase& I, + Eigen::PlainObjectBase& eF, + Eigen::PlainObjectBase& nP + ); + + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "ear_clipping.cpp" +#endif + + +#endif diff --git a/vendor/libigl/include/igl/predicates/point_inside_convex_polygon.cpp b/vendor/libigl/include/igl/predicates/point_inside_convex_polygon.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cfec83e91e851c422d0e33a52f0b9e3191bf9f25 --- /dev/null +++ b/vendor/libigl/include/igl/predicates/point_inside_convex_polygon.cpp @@ -0,0 +1,33 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Hanxiao Shen +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "point_inside_convex_polygon.h" + +template +IGL_INLINE bool igl::predicates::point_inside_convex_polygon( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& q +){ + EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(DerivedP, Eigen::Dynamic, 2); + EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(DerivedQ, 1, 2); + typedef typename DerivedP::Scalar Scalar; + for(int i=0;i a = P.row(i); + Eigen::Matrix b = P.row(i_1); + auto r = igl::predicates::orient2d(a,b,q); + if(r == igl::predicates::Orientation::COLLINEAR || + r == igl::predicates::Orientation::NEGATIVE) + return false; + } + return true; +} + +#ifdef IGL_STATIC_LIBRARY +template bool igl::predicates::point_inside_convex_polygon, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +#endif diff --git a/vendor/libigl/include/igl/predicates/point_inside_convex_polygon.h b/vendor/libigl/include/igl/predicates/point_inside_convex_polygon.h new file mode 100644 index 0000000000000000000000000000000000000000..58b69aeca8ec8f054bb13bf3ded30f3192aa54ab --- /dev/null +++ b/vendor/libigl/include/igl/predicates/point_inside_convex_polygon.h @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Hanxiao Shen +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_PREDICATES_POINT_INSIDE_CONVEX_POLYGON_H +#define IGL_PREDICATES_POINT_INSIDE_CONVEX_POLYGON_H + + + +#include "../igl_inline.h" +#include +#include "predicates.h" + +namespace igl +{ + namespace predicates + { + // check whether 2d point lies inside 2d convex polygon + // Inputs: + // P: n*2 polygon, n >= 3 + // q: 2d query point + // Returns true if point is inside polygon + template + IGL_INLINE bool point_inside_convex_polygon( + const Eigen::MatrixBase& P, + const Eigen::MatrixBase& q + ); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "point_inside_convex_polygon.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/predicates/polygons_to_triangles.cpp b/vendor/libigl/include/igl/predicates/polygons_to_triangles.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8adb76c21b7b8e07868eece6b36e8e8b1a2b2cc3 --- /dev/null +++ b/vendor/libigl/include/igl/predicates/polygons_to_triangles.cpp @@ -0,0 +1,248 @@ +#include "polygons_to_triangles.h" +#include "ear_clipping.h" +#include "../sort.h" +#include "../slice.h" +#include + +template < + typename DerivedV, + typename DerivedI, + typename DerivedC, + typename DerivedF, + typename DerivedJ> +IGL_INLINE void igl::predicates::polygons_to_triangles( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & I, + const Eigen::MatrixBase & C, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & J) +{ + typedef Eigen::Index Index; + // Each polygon results in #sides-2 triangles. So ∑#sides-2 + F.resize(C(C.size()-1) - (C.size()-1)*2,3); + J.resize(F.rows()); + { + Index f = 0; + for(Index p = 0;p(); + break; + case 3: + { + Eigen::MatrixXd P = (pV.rowwise() - pV.colwise().mean()).template cast(); + Eigen::Matrix3d O = P.transpose() * P; + Eigen::EigenSolver es(O); + Eigen::Matrix3d C = es.eigenvectors().real(); + { + Eigen::Vector3d _1; + Eigen::Vector3i I; + igl::sort(es.eigenvalues().real().eval(),1,false,_1,I); + igl::slice(Eigen::Matrix3d(C),I,2,C); + } + S = P*C.leftCols(2); + break; + } + default: assert(false && "dim>3 not supported"); + } + + Eigen::VectorXi RT = Eigen::VectorXi::Zero(S.rows(),1); + Eigen::VectorXi _I; + Eigen::MatrixXd _nS; + + // compute signed area + { + double area = 0; + for(Index c = 0;c0 && c1) + //{ + // // Delaunay-ize + // Eigen::MatrixXd pl; + // igl::edge_lengths(pV,pF,pl); + + // typedef Eigen::Matrix MatrixX2I; + // typedef Eigen::Matrix VectorXI; + // MatrixX2I E,uE; + // VectorXI EMAP; + // std::vector > uE2E; + // igl::unique_edge_map(pF, E, uE, EMAP, uE2E); + // typedef Index Index; + // typedef double Scalar; + // const Index num_faces = pF.rows(); + // std::vector Q; + // Q.reserve(uE2E.size()); + // for (size_t uei=0; uei v3 /__f__\ v4 + // // \ e / \ f2 / + // // d\ | /a d\ /a + // // \|/ \ / + // // v2 v2 + // // + // // hmm... is the flip actually in the other direction? + // const Index f1 = uE2E[uei][0]%num_faces; + // const Index f2 = uE2E[uei][1]%num_faces; + // const Index c1 = uE2E[uei][0]/num_faces; + // const Index c2 = uE2E[uei][1]/num_faces; + // const size_t e_24 = f1 + ((c1 + 1) % 3) * num_faces; + // const size_t e_41 = f1 + ((c1 + 2) % 3) * num_faces; + // const size_t e_13 = f2 + ((c2 + 1) % 3) * num_faces; + // const size_t e_32 = f2 + ((c2 + 2) % 3) * num_faces; + // const size_t ue_24 = EMAP(e_24); + // const size_t ue_41 = EMAP(e_41); + // const size_t ue_13 = EMAP(e_13); + // const size_t ue_32 = EMAP(e_32); + // // new edge lengths + // const Index v1 = pF(f1, (c1+1)%3); + // const Index v2 = pF(f1, (c1+2)%3); + // const Index v4 = pF(f1, c1); + // const Index v3 = pF(f2, c2); + // { + // const Scalar e = pl(f1,c1); + // const Scalar a = pl(f1,(c1+1)%3); + // const Scalar b = pl(f1,(c1+2)%3); + // const Scalar c = pl(f2,(c2+1)%3); + // const Scalar d = pl(f2,(c2+2)%3); + // const double f = (pV.row(v3)-pV.row(v4)).norm(); + // // New order + // pl(f1,0) = f; + // pl(f1,1) = b; + // pl(f1,2) = c; + // pl(f2,0) = f; + // pl(f2,1) = d; + // pl(f2,2) = a; + // } + // prIndexf("%d,%d %d,%d -> %d,%d\n",uE(uei,0),uE(uei,1),v1,v2,v3,v4); + // igl::flip_edge(pF, E, uE, EMAP, uE2E, uei); + // std::cout<<" "< +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_POLYGONS_TO_TRIANGLES_H +#define IGL_POLYGONS_TO_TRIANGLES_H + +#include "../igl_inline.h" +#include +#include + +namespace igl +{ + namespace predicates + { + // Given a polygon mesh, trivially triangulate each polygon with a fan. This + // purely combinatorial triangulation will work well for convex/flat polygons + // and degrade otherwise. + // + // Inputs: + // V #V by dim list of vertex positions + // I #I vectorized list of polygon corner indices into rows of some matrix V + // C #polygons+1 list of cumulative polygon sizes so that C(i+1)-C(i) = + // size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the + // indices of the ith polygon + // Outputs: + // F #F by 3 list of triangle indices into rows of V + // J #F list of indices into 0:#P-1 of corresponding polygon + // + template < + typename DerivedV, + typename DerivedI, + typename DerivedC, + typename DerivedF, + typename DerivedJ> + IGL_INLINE void polygons_to_triangles( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & I, + const Eigen::MatrixBase & C, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & J); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "polygons_to_triangles.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/predicates/predicates.cpp b/vendor/libigl/include/igl/predicates/predicates.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ca38d76bd0528aac4a387491b5c81d5b1d01a570 --- /dev/null +++ b/vendor/libigl/include/igl/predicates/predicates.cpp @@ -0,0 +1,176 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include +#include + +namespace igl { +namespace predicates { + +using REAL = IGL_PREDICATES_REAL; + +#ifdef LIBIGL_PREDICATES_USE_FLOAT +#define IGL_ASSERT_SCALAR(Vector) \ + static_assert( \ + std::is_same::value, \ + "Shewchuk's exact predicates only support float") +#else +#define IGL_ASSERT_SCALAR(Vector) \ + static_assert( \ + std::is_same::value || \ + std::is_same::value, \ + "Shewchuk's exact predicates only support float and double") +#endif + +IGL_INLINE void exactinit() { + // Thread-safe initialization using Meyers' singleton + class MySingleton { + public: + static MySingleton& instance() { + static MySingleton instance; + return instance; + } + private: + MySingleton() { ::exactinit(); } + }; + MySingleton::instance(); +} + +template +IGL_INLINE Orientation orient2d( + const Eigen::MatrixBase& pa, + const Eigen::MatrixBase& pb, + const Eigen::MatrixBase& pc) +{ + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector2D, 2); + IGL_ASSERT_SCALAR(Vector2D); + + using Point = Eigen::Matrix; + Point a{pa[0], pa[1]}; + Point b{pb[0], pb[1]}; + Point c{pc[0], pc[1]}; + + const auto r = ::orient2d(a.data(), b.data(), c.data()); + + if (r > 0) return Orientation::POSITIVE; + else if (r < 0) return Orientation::NEGATIVE; + else return Orientation::COLLINEAR; +} + +template +IGL_INLINE Orientation orient3d( + const Eigen::MatrixBase& pa, + const Eigen::MatrixBase& pb, + const Eigen::MatrixBase& pc, + const Eigen::MatrixBase& pd) +{ + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3D, 3); + IGL_ASSERT_SCALAR(Vector3D); + + using Point = Eigen::Matrix; + Point a{pa[0], pa[1], pa[2]}; + Point b{pb[0], pb[1], pb[2]}; + Point c{pc[0], pc[1], pc[2]}; + Point d{pd[0], pd[1], pd[2]}; + + const auto r = ::orient3d(a.data(), b.data(), c.data(), d.data()); + + if (r > 0) return Orientation::POSITIVE; + else if (r < 0) return Orientation::NEGATIVE; + else return Orientation::COPLANAR; +} + +template +IGL_INLINE Orientation incircle( + const Eigen::MatrixBase& pa, + const Eigen::MatrixBase& pb, + const Eigen::MatrixBase& pc, + const Eigen::MatrixBase& pd) +{ + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector2D, 2); + IGL_ASSERT_SCALAR(Vector2D); + + using Point = Eigen::Matrix; + Point a{pa[0], pa[1]}; + Point b{pb[0], pb[1]}; + Point c{pc[0], pc[1]}; + Point d{pd[0], pd[1]}; + + const auto r = ::incircle(a.data(), b.data(), c.data(), d.data()); + + if (r > 0) return Orientation::INSIDE; + else if (r < 0) return Orientation::OUTSIDE; + else return Orientation::COCIRCULAR; +} + +template +IGL_INLINE Orientation insphere( + const Eigen::MatrixBase& pa, + const Eigen::MatrixBase& pb, + const Eigen::MatrixBase& pc, + const Eigen::MatrixBase& pd, + const Eigen::MatrixBase& pe) +{ + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3D, 3); + IGL_ASSERT_SCALAR(Vector3D); + + using Point = Eigen::Matrix; + Point a{pa[0], pa[1], pa[2]}; + Point b{pb[0], pb[1], pb[2]}; + Point c{pc[0], pc[1], pc[2]}; + Point d{pd[0], pd[1], pd[2]}; + Point e{pe[0], pe[1], pe[2]}; + + const auto r = ::insphere(a.data(), b.data(), c.data(), d.data(), e.data()); + + if (r > 0) return Orientation::INSIDE; + else if (r < 0) return Orientation::OUTSIDE; + else return Orientation::COSPHERICAL; +} + +} +} + +#undef IGL_ASSERT_SCALAR + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation + +#define IGL_ORIENT2D(Vector) template igl::predicates::Orientation igl::predicates::orient2d(const Eigen::MatrixBase&, const Eigen::MatrixBase&, const Eigen::MatrixBase&) +#define IGL_INCIRCLE(Vector) template igl::predicates::Orientation igl::predicates::incircle(const Eigen::MatrixBase&, const Eigen::MatrixBase&, const Eigen::MatrixBase&, const Eigen::MatrixBase&) +#define IGL_ORIENT3D(Vector) template igl::predicates::Orientation igl::predicates::orient3d(const Eigen::MatrixBase&, const Eigen::MatrixBase&, const Eigen::MatrixBase&, const Eigen::MatrixBase&) +#define IGL_INSPHERE(Vector) template igl::predicates::Orientation igl::predicates::insphere(const Eigen::MatrixBase&, const Eigen::MatrixBase&, const Eigen::MatrixBase&, const Eigen::MatrixBase&, const Eigen::MatrixBase&) + +#define IGL_MATRIX(T, R, C) Eigen::Matrix +IGL_ORIENT2D(IGL_MATRIX(float, 1, 2)); +IGL_INCIRCLE(IGL_MATRIX(float, 1, 2)); +IGL_ORIENT2D(IGL_MATRIX(float, 2, 1)); +IGL_INCIRCLE(IGL_MATRIX(float, 2, 1)); +IGL_ORIENT3D(IGL_MATRIX(float, 1, 3)); +IGL_INSPHERE(IGL_MATRIX(float, 1, 3)); +IGL_ORIENT3D(IGL_MATRIX(float, 3, 1)); +IGL_INSPHERE(IGL_MATRIX(float, 3, 1)); + +#ifndef LIBIGL_PREDICATES_USE_FLOAT +IGL_ORIENT2D(IGL_MATRIX(double, 1, 2)); +IGL_INCIRCLE(IGL_MATRIX(double, 1, 2)); +IGL_ORIENT2D(IGL_MATRIX(double, 2, 1)); +IGL_INCIRCLE(IGL_MATRIX(double, 2, 1)); +IGL_ORIENT3D(IGL_MATRIX(double, 1, 3)); +IGL_INSPHERE(IGL_MATRIX(double, 1, 3)); +IGL_ORIENT3D(IGL_MATRIX(double, 3, 1)); +IGL_INSPHERE(IGL_MATRIX(double, 3, 1)); +#endif +#undef IGL_MATRIX + +#undef IGL_ORIENT2D +#undef IGL_ORIENT3D +#undef IGL_INCIRCLE +#undef IGL_INSPHERE + +#endif diff --git a/vendor/libigl/include/igl/predicates/predicates.h b/vendor/libigl/include/igl/predicates/predicates.h new file mode 100644 index 0000000000000000000000000000000000000000..353088694edd62f32a45cb6655cd1ef485e63285 --- /dev/null +++ b/vendor/libigl/include/igl/predicates/predicates.h @@ -0,0 +1,100 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Qingnan Zhou +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#pragma once +#ifndef IGL_PREDICATES_PREDICATES_H +#define IGL_PREDICATES_PREDICATES_H + +#include +#include + +namespace igl { + namespace predicates { + enum class Orientation { + POSITIVE=1, INSIDE=1, + NEGATIVE=-1, OUTSIDE=-1, + COLLINEAR=0, COPLANAR=0, COCIRCULAR=0, COSPHERICAL=0, DEGENERATE=0 + }; + + // Initialize internal variable used by predciates. Must be called before + // using exact predicates. It is safe to call this function from multiple + // threads. + IGL_INLINE void exactinit(); + + // Compute the orientation of the triangle formed by pa, pb, pc. + // + // Input: + // pa, pb, pc 2D points. + // + // Output: + // Return POSITIVE if pa, pb, pc are counterclockwise oriented. + // NEGATIVE if they are clockwise oriented. + // COLLINEAR if they are collinear. + template + IGL_INLINE Orientation orient2d( + const Eigen::MatrixBase& pa, + const Eigen::MatrixBase& pb, + const Eigen::MatrixBase& pc); + + // Compute the orientation of the tetrahedron formed by pa, pb, pc, pd. + // + // Input: + // pa, pb, pc, pd 3D points. + // + // Output: + // Return POSITIVE if pd is "below" the oriented plane formed by pa, pb and pc. + // NEGATIVE if pd is "above" the plane. + // COPLANAR if pd is on the plane. + template + IGL_INLINE Orientation orient3d( + const Eigen::MatrixBase& pa, + const Eigen::MatrixBase& pb, + const Eigen::MatrixBase& pc, + const Eigen::MatrixBase& pd); + + // Decide whether a point is inside/outside/on a circle. + // + // Input: + // pa, pb, pc 2D points that defines an oriented circle. + // pd 2D query point. + // + // Output: + // Return INSIDE if pd is inside of the circle defined by pa, pb and pc. + // OUSIDE if pd is outside of the circle. + // COCIRCULAR pd is exactly on the circle. + template + IGL_INLINE Orientation incircle( + const Eigen::MatrixBase& pa, + const Eigen::MatrixBase& pb, + const Eigen::MatrixBase& pc, + const Eigen::MatrixBase& pd); + + // Decide whether a point is inside/outside/on a sphere. + // + // Input: + // pa, pb, pc, pd 3D points that defines an oriented sphere. + // pe 3D query point. + // + // Output: + // Return INSIDE if pe is inside of the sphere defined by pa, pb, pc and pd. + // OUSIDE if pe is outside of the sphere. + // COSPHERICAL pd is exactly on the sphere. + template + IGL_INLINE Orientation insphere( + const Eigen::MatrixBase& pa, + const Eigen::MatrixBase& pb, + const Eigen::MatrixBase& pc, + const Eigen::MatrixBase& pd, + const Eigen::MatrixBase& pe); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "predicates.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/predicates/segment_segment_intersect.cpp b/vendor/libigl/include/igl/predicates/segment_segment_intersect.cpp new file mode 100644 index 0000000000000000000000000000000000000000..acf97cfbeac8ed80f480f8b7cb6db01febb57487 --- /dev/null +++ b/vendor/libigl/include/igl/predicates/segment_segment_intersect.cpp @@ -0,0 +1,52 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Hanxiao Shen +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "segment_segment_intersect.h" + +// https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ +template +IGL_INLINE bool igl::predicates::segment_segment_intersect( + const Eigen::MatrixBase& a, + const Eigen::MatrixBase& b, + const Eigen::MatrixBase& c, + const Eigen::MatrixBase& d +) +{ + typename DerivedP::Scalar Scalar; + + auto t1 = igl::predicates::orient2d(a,b,c); + auto t2 = igl::predicates::orient2d(b,c,d); + auto t3 = igl::predicates::orient2d(a,b,d); + auto t4 = igl::predicates::orient2d(a,c,d); + + // assume m,n,p are colinear, check whether p is in range [m,n] + auto on_segment = []( + const Eigen::MatrixBase& m, + const Eigen::MatrixBase& n, + const Eigen::MatrixBase& p + ){ + return ((p(0) >= std::min(m(0),n(0))) && + (p(0) <= std::max(m(0),n(0))) && + (p(1) >= std::min(m(1),n(1))) && + (p(1) <= std::max(m(1),n(1)))); + }; + + // colinear case + if((t1 == igl::predicates::Orientation::COLLINEAR && on_segment(a,b,c)) || + (t2 == igl::predicates::Orientation::COLLINEAR && on_segment(c,d,b)) || + (t3 == igl::predicates::Orientation::COLLINEAR && on_segment(a,b,d)) || + (t4 == igl::predicates::Orientation::COLLINEAR && on_segment(c,d,a))) + return true; + + // ordinary case + return (t1 != t3 && t2 != t4); +} + +#ifdef IGL_STATIC_LIBRARY +template bool igl::predicates::segment_segment_intersect >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +#endif diff --git a/vendor/libigl/include/igl/predicates/segment_segment_intersect.h b/vendor/libigl/include/igl/predicates/segment_segment_intersect.h new file mode 100644 index 0000000000000000000000000000000000000000..4c1ac1ee126fbb4b9e3001404523b20e0bad8f14 --- /dev/null +++ b/vendor/libigl/include/igl/predicates/segment_segment_intersect.h @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Hanxiao Shen +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_PREDICATES_SEGMENT_SEGMENT_INTERSECT_H +#define IGL_PREDICATES_SEGMENT_SEGMENT_INTERSECT_H + +#include +#include +#include "predicates.h" +namespace igl +{ + namespace predicates + { + + // Given two segments in 2d test whether they intersect each other + // using predicates orient2d + // + // Inputs: + // A: 1st endpoint of segment 1 + // B: 2st endpoint of segment 1 + // C: 1st endpoint of segment 2 + // D: 2st endpoint of segment 2 + // Returns true if they intersect + + template + IGL_INLINE bool segment_segment_intersect( + // input: + const Eigen::MatrixBase& A, + const Eigen::MatrixBase& B, + const Eigen::MatrixBase& C, + const Eigen::MatrixBase& D + ); + + } +} +#ifndef IGL_STATIC_LIBRARY +# include "segment_segment_intersect.cpp" +#endif +#endif //IGL_PREDICATES_SEGMENT_SEGMENT_INTERSECT_H diff --git a/vendor/libigl/include/igl/print_vector.cpp b/vendor/libigl/include/igl/print_vector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b47753216f013ed7c26ce2dca500b8ff7e7c2d42 --- /dev/null +++ b/vendor/libigl/include/igl/print_vector.cpp @@ -0,0 +1,59 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "print_vector.h" +#include +#include + + +template +IGL_INLINE void igl::print_vector( std::vector& v) +{ + using namespace std; + for (int i=0; i +IGL_INLINE void igl::print_vector( std::vector< std::vector >& v) +{ + using namespace std; + for (int i=0; i +IGL_INLINE void igl::print_vector( std::vector< std::vector< std::vector > >& v) +{ + using namespace std; + for (int m=0; m +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "procrustes.h" +#include "polar_svd.h" +#include "polar_dec.h" + +template < + typename DerivedX, + typename DerivedY, + typename Scalar, + typename DerivedR, + typename DerivedT> +IGL_INLINE void igl::procrustes( + const Eigen::MatrixBase& X, + const Eigen::MatrixBase& Y, + bool includeScaling, + bool includeReflections, + Scalar& scale, + Eigen::PlainObjectBase& R, + Eigen::PlainObjectBase& t) +{ + using namespace Eigen; + assert (X.rows() == Y.rows() && "Same number of points"); + assert(X.cols() == Y.cols() && "Points have same dimensions"); + + // Center data + const Matrix Xmean = X.colwise().mean(); + const Matrix Ymean = Y.colwise().mean(); + Matrix XC + = X.rowwise() - Xmean.transpose(); + Matrix YC + = Y.rowwise() - Ymean.transpose(); + + // Scale + scale = 1.; + if (includeScaling) + { + double scaleX = XC.norm() / XC.rows(); + double scaleY = YC.norm() / YC.rows(); + scale = scaleY/scaleX; + XC *= scale; + assert (std::abs(XC.norm() / XC.rows() - scaleY) < 1e-8); + } + + // Rotation + Matrix S = XC.transpose() * YC; + Matrix T; + if (includeReflections) + { + polar_dec(S,R,T); + }else + { + polar_svd(S,R,T); + } +// R.transposeInPlace(); + + // Translation + t = Ymean - scale*R.transpose()*Xmean; +} + + +template < + typename DerivedX, + typename DerivedY, + typename Scalar, + int DIM, + int TType> +IGL_INLINE void igl::procrustes( + const Eigen::MatrixBase& X, + const Eigen::MatrixBase& Y, + bool includeScaling, + bool includeReflections, + Eigen::Transform& T) +{ + using namespace Eigen; + double scale; + MatrixXd R; + VectorXd t; + procrustes(X,Y,includeScaling,includeReflections,scale,R,t); + + // Combine + T = Translation(t) * R * Scaling(scale); +} + +template < + typename DerivedX, + typename DerivedY, + typename DerivedR, + typename DerivedT> +IGL_INLINE void igl::procrustes( + const Eigen::MatrixBase& X, + const Eigen::MatrixBase& Y, + bool includeScaling, + bool includeReflections, + Eigen::PlainObjectBase& S, + Eigen::PlainObjectBase& t) +{ + double scale; + procrustes(X,Y,includeScaling,includeReflections,scale,S,t); + S *= scale; +} + +template < + typename DerivedX, + typename DerivedY, + typename DerivedR, + typename DerivedT> +IGL_INLINE void igl::procrustes( + const Eigen::MatrixBase& X, + const Eigen::MatrixBase& Y, + Eigen::PlainObjectBase& R, + Eigen::PlainObjectBase& t) +{ + procrustes(X,Y,false,false,R,t); +} + +template < + typename DerivedX, + typename DerivedY, + typename Scalar, + typename DerivedT> +IGL_INLINE void igl::procrustes( + const Eigen::MatrixBase& X, + const Eigen::MatrixBase& Y, + Eigen::Rotation2D& R, + Eigen::PlainObjectBase& t) +{ + using namespace Eigen; + assert (X.cols() == 2 && Y.cols() == 2 && "Points must have dimension 2"); + Matrix2d Rmat; + procrustes(X,Y,false,false,Rmat,t); + R.fromRotationMatrix(Rmat); +} + +#ifdef IGL_STATIC_LIBRARY +template void igl::procrustes, Eigen::Matrix, double, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, bool, bool, double&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/project_isometrically_to_plane.h b/vendor/libigl/include/igl/project_isometrically_to_plane.h new file mode 100644 index 0000000000000000000000000000000000000000..6447ebcbf22156652ea76bf5556bf2c6e79eedea --- /dev/null +++ b/vendor/libigl/include/igl/project_isometrically_to_plane.h @@ -0,0 +1,49 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_PROJECT_ISOMETRICALLY_TO_PLANE_H +#define IGL_PROJECT_ISOMETRICALLY_TO_PLANE_H +#include "igl_inline.h" + +#include +#include + + +namespace igl +{ + // Project each triangle to the plane + // + // [U,UF,I] = project_isometrically_to_plane(V,F) + // + // Inputs: + // V #V by 3 list of vertex positions + // F #F by 3 list of mesh indices + // Outputs: + // U #F*3 by 2 list of triangle positions + // UF #F by 3 list of mesh indices into U + // I #V by #F*3 such that I(i,j) = 1 implies U(j,:) corresponds to V(i,:) + // + template < + typename DerivedV, + typename DerivedF, + typename DerivedU, + typename DerivedUF, + typename Scalar> + IGL_INLINE void project_isometrically_to_plane( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & U, + Eigen::PlainObjectBase & UF, + Eigen::SparseMatrix& I); +} + +#ifndef IGL_STATIC_LIBRARY +# include "project_isometrically_to_plane.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/projection_constraint.cpp b/vendor/libigl/include/igl/projection_constraint.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fb05398f9d151461c9dca71613166a80ef1da979 --- /dev/null +++ b/vendor/libigl/include/igl/projection_constraint.cpp @@ -0,0 +1,50 @@ +#include "projection_constraint.h" + +template < + typename DerivedUV, + typename DerivedM, + typename DerivedVP, + typename DerivedA, + typename DerivedB> +void igl::projection_constraint( + const Eigen::MatrixBase & UV, + const Eigen::MatrixBase & _M, + const Eigen::MatrixBase & VP, + Eigen::PlainObjectBase & A, + Eigen::PlainObjectBase & B) +{ + typedef typename DerivedA::Scalar Scalar; + const Scalar u = UV(0); + const Scalar v = UV(1); + const Scalar cu = VP(0); + const Scalar cv = VP(1); + const Scalar w = VP(2); + const Scalar h = VP(3); + // u = cu + w*(0.5 + 0.5*((M.row(0)*X) / (M.row(3)*X) )) + // u-cu = w*(0.5 + 0.5*((M.row(0)*X) / (M.row(3)*X) )) + // (u-cu)/w = 0.5 + 0.5*((M.row(0)*X) / (M.row(3)*X) ) + // (u-cu)/w - 0.5 = 0.5*((M.row(0)*X) / (M.row(3)*X) ) + // 2.*(u-cu)/w - 1 = ((M.row(0)*X) / (M.row(3)*X) ) + // (2.*(u - cu)/w - 1) * M.row(3)*X = M.row(0)*X + // (2.*(u - cu)/w - 1) * M.row(3)*X - M.row(0)*X = 0 + // (2.*(u - cu)/w - 1) * (M.block(3,0,1,3)*x + M(3,3)) - M.block(0,0,1,3)*x - M(0,3) = 0 + // (2.*(u - cu)/w - 1) * (M.block(3,0,1,3)*x + M(3,3)) - M.block(0,0,1,3)*x = M(0,3) + // ((2.*(u - cu)/w - 1) * M.block(3,0,1,3) - M.block(0,0,1,3))*x = M(0,3) - (2.*(u - cu)/w - 1)*M(3,3) + Eigen::Matrix M = _M.template cast(); + A.resize(2,3); + A<< + ((2.*(u - cu)/w - 1.) * M.block(3,0,1,3) - M.block(0,0,1,3)), + ((2.*(v - cv)/h - 1.) * M.block(3,0,1,3) - M.block(1,0,1,3)); + B.resize(2,1); + B<< + M(0,3) - (2.*(u - cu)/w - 1.)*M(3,3), + M(1,3) - (2.*(v - cv)/h - 1.)*M(3,3); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::projection_constraint, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::projection_constraint, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/qslim.h b/vendor/libigl/include/igl/qslim.h new file mode 100644 index 0000000000000000000000000000000000000000..a85ad7918b26bb05e48e58bf6fb0333d52c2580e --- /dev/null +++ b/vendor/libigl/include/igl/qslim.h @@ -0,0 +1,45 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_QSLIM_H +#define IGL_QSLIM_H +#include "igl_inline.h" +#include +namespace igl +{ + + // Decimate (simplify) a triangle mesh in nD according to the paper + // "Simplifying Surfaces with Color and Texture using Quadric Error Metrics" + // by [Garland and Heckbert, 1987] (technically a followup to qslim). The + // mesh can have open boundaries but should be edge-manifold. + // + // Inputs: + // V #V by dim list of vertex positions. Assumes that vertices with + // infinite coordinates are "points at infinity" being used to close up + // boundary edges with faces. This allows special subspace quadrice for + // boundary edges: There should never be more than one "point at + // infinity" in a single triangle. + // F #F by 3 list of triangle indices into V + // max_m desired number of output faces + // Outputs: + // U #U by dim list of output vertex posistions (can be same ref as V) + // G #G by 3 list of output face indices into U (can be same ref as F) + // J #G list of indices into F of birth face + // I #U list of indices into V of birth vertices + IGL_INLINE bool qslim( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const size_t max_m, + Eigen::MatrixXd & U, + Eigen::MatrixXi & G, + Eigen::VectorXi & J, + Eigen::VectorXi & I); +} +#ifndef IGL_STATIC_LIBRARY +# include "qslim.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/quad_grid.cpp b/vendor/libigl/include/igl/quad_grid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4aa403461b08f820d958efe960fcd7b4aec96562 --- /dev/null +++ b/vendor/libigl/include/igl/quad_grid.cpp @@ -0,0 +1,97 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "quad_grid.h" +#include "grid.h" + +template< + typename DerivedV, + typename DerivedQ, + typename DerivedE> +IGL_INLINE void igl::quad_grid( + const int nx, + const int ny, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & Q, + Eigen::PlainObjectBase & E) +{ + grid(Eigen::Vector2i(nx,ny),V); + return igl::quad_grid(nx,ny,Q,E); +} + +template< + typename DerivedQ, + typename DerivedE> +IGL_INLINE void igl::quad_grid( + const int nx, + const int ny, + Eigen::PlainObjectBase & Q, + Eigen::PlainObjectBase & E) +{ + Eigen::MatrixXi I(nx,ny); + Q.resize( (nx-1)*(ny-1),4); + E.resize((nx-1)*ny + (ny-1)*nx,2); + { + int v = 0; + int q = 0; + int e = 0; + // Ordered to match igl::grid + for(int y = 0;y0) + { + E(e,0) = I(x,y); + E(e,1) = I(x,y-1); + e++; + } + // Add a horizontal edge + if(x>0) + { + E(e,0) = I(x,y); + E(e,1) = I(x-1,y); + e++; + } + // Add two triangles + if(x>0 && y>0) + { + // -1,0----0,0 + // | / | + // | / | + // | / | + // | / | + // -1,-1---0,-1 + Q(q,0) = I(x-0,y-0); + Q(q,1) = I(x-1,y-0); + Q(q,2) = I(x-1,y-1); + Q(q,3) = I(x-0,y-1); + q++; + //F(f,2) = I(x-0,y-0); + //F(f,1) = I(x-1,y-0); + //F(f,0) = I(x-1,y-1); + //f++; + //F(f,2) = I(x-0,y-0); + //F(f,1) = I(x-1,y-1); + //F(f,0) = I(x-0,y-1); + //f++; + } + } + } + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::quad_grid, Eigen::Matrix, Eigen::Matrix >(int, int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/quat_to_mat.cpp b/vendor/libigl/include/igl/quat_to_mat.cpp new file mode 100644 index 0000000000000000000000000000000000000000..22ec07b94126f9b0cacc8931a724a1044d010e48 --- /dev/null +++ b/vendor/libigl/include/igl/quat_to_mat.cpp @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "quat_to_mat.h" + +template +IGL_INLINE void igl::quat_to_mat(const Q_type * quat, Q_type * mat) +{ + Q_type yy2 = 2.0f * quat[1] * quat[1]; + Q_type xy2 = 2.0f * quat[0] * quat[1]; + Q_type xz2 = 2.0f * quat[0] * quat[2]; + Q_type yz2 = 2.0f * quat[1] * quat[2]; + Q_type zz2 = 2.0f * quat[2] * quat[2]; + Q_type wz2 = 2.0f * quat[3] * quat[2]; + Q_type wy2 = 2.0f * quat[3] * quat[1]; + Q_type wx2 = 2.0f * quat[3] * quat[0]; + Q_type xx2 = 2.0f * quat[0] * quat[0]; + mat[0*4+0] = - yy2 - zz2 + 1.0f; + mat[0*4+1] = xy2 + wz2; + mat[0*4+2] = xz2 - wy2; + mat[0*4+3] = 0; + mat[1*4+0] = xy2 - wz2; + mat[1*4+1] = - xx2 - zz2 + 1.0f; + mat[1*4+2] = yz2 + wx2; + mat[1*4+3] = 0; + mat[2*4+0] = xz2 + wy2; + mat[2*4+1] = yz2 - wx2; + mat[2*4+2] = - xx2 - yy2 + 1.0f; + mat[2*4+3] = 0; + mat[3*4+0] = mat[3*4+1] = mat[3*4+2] = 0; + mat[3*4+3] = 1; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::quat_to_mat(double const*, double*); +// generated by autoexplicit.sh +template void igl::quat_to_mat(float const*, float*); +#endif diff --git a/vendor/libigl/include/igl/ramer_douglas_peucker.h b/vendor/libigl/include/igl/ramer_douglas_peucker.h new file mode 100644 index 0000000000000000000000000000000000000000..dcfe47e857479cfee3675b6911d42836c720e65f --- /dev/null +++ b/vendor/libigl/include/igl/ramer_douglas_peucker.h @@ -0,0 +1,49 @@ +#ifndef IGL_RAMER_DOUGLAS_PEUCKER_H +#define IGL_RAMER_DOUGLAS_PEUCKER_H +#include "igl_inline.h" +#include +namespace igl +{ + // Ramer-Douglas-Peucker piecewise-linear curve simplification. + // + // Inputs: + // P #P by dim ordered list of vertices along the curve + // tol tolerance (maximal euclidean distance allowed between the new line + // and a vertex) + // Outputs: + // S #S by dim ordered list of points along the curve + // J #S list of indices into P so that S = P(J,:) + template + IGL_INLINE void ramer_douglas_peucker( + const Eigen::MatrixBase & P, + const typename DerivedP::Scalar tol, + Eigen::PlainObjectBase & S, + Eigen::PlainObjectBase & J); + // Run (Ramer-)Duglass-Peucker curve simplification but keep track of where + // every point on the original curve maps to on the simplified curve. + // + // Inputs: + // P #P by dim list of points, (use P([1:end 1],:) for loops) + // tol DP tolerance + // Outputs: + // S #S by dim list of points along simplified curve + // J #S indices into P of simplified points + // Q #P by dim list of points mapping along simplified curve + // + template < + typename DerivedP, + typename DerivedS, + typename DerivedJ, + typename DerivedQ> + IGL_INLINE void ramer_douglas_peucker( + const Eigen::MatrixBase & P, + const typename DerivedP::Scalar tol, + Eigen::PlainObjectBase & S, + Eigen::PlainObjectBase & J, + Eigen::PlainObjectBase & Q); + +} +#ifndef IGL_STATIC_LIBRARY +# include "ramer_douglas_peucker.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/random_points_on_mesh.cpp b/vendor/libigl/include/igl/random_points_on_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..de552e60677ac00e7830fe998ead1fd06cde5b19 --- /dev/null +++ b/vendor/libigl/include/igl/random_points_on_mesh.cpp @@ -0,0 +1,120 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "random_points_on_mesh.h" +#include "doublearea.h" +#include "cumsum.h" +#include "histc.h" +#include +#include + +template +IGL_INLINE void igl::random_points_on_mesh( + const int n, + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & B, + Eigen::PlainObjectBase & FI) +{ + using namespace Eigen; + using namespace std; + typedef typename DerivedV::Scalar Scalar; + typedef Matrix VectorXs; + VectorXs A; + doublearea(V,F,A); + // Should be traingle mesh. Although Turk's method 1 generalizes... + assert(F.cols() == 3); + VectorXs C; + VectorXs A0(A.size()+1); + A0(0) = 0; + A0.bottomRightCorner(A.size(),1) = A; + // Even faster would be to use the "Alias Table Method" + cumsum(A0,1,C); + const Scalar Cmax = C(C.size()-1); + assert(Cmax > 0 && "Total surface area should be positive"); + // Why is this more accurate than `C /= C(C.size()-1)` ? + for(int i = 0;i= 0); + assert(R.maxCoeff() <= 1); + histc(R,C,FI); + FI = FI.array().min(F.rows() - 1); // fix the bin when R(i) == 1 exactly + const VectorXs S = (VectorXs::Random(n,1).array() + 1.)/2.; + const VectorXs T = (VectorXs::Random(n,1).array() + 1.)/2.; + B.resize(n,3); + B.col(0) = 1.-T.array().sqrt(); + B.col(1) = (1.-S.array()) * T.array().sqrt(); + B.col(2) = S.array() * T.array().sqrt(); +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedB, + typename DerivedFI, + typename DerivedX> +IGL_INLINE void igl::random_points_on_mesh( + const int n, + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & B, + Eigen::PlainObjectBase & FI, + Eigen::PlainObjectBase & X) +{ + random_points_on_mesh(n,V,F,B,FI); + X = DerivedX::Zero(B.rows(),V.cols()); + for(int x = 0;x +IGL_INLINE void igl::random_points_on_mesh( + const int n, + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + Eigen::SparseMatrix & B, + Eigen::PlainObjectBase & FI) +{ + using namespace Eigen; + using namespace std; + Matrix BC; + random_points_on_mesh(n,V,F,BC,FI); + vector > BIJV; + BIJV.reserve(n*3); + for(int s = 0;s= 0); + const int v = F(FI(s),c); + BIJV.push_back(Triplet(s,v,BC(s,c))); + } + } + B.resize(n,V.rows()); + B.reserve(n*3); + B.setFromTriplets(BIJV.begin(),BIJV.end()); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::random_points_on_mesh, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::random_points_on_mesh, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::random_points_on_mesh, Eigen::Matrix, float, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::SparseMatrix&, Eigen::PlainObjectBase >&); +template void igl::random_points_on_mesh, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::random_points_on_mesh, Eigen::Matrix, double, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::SparseMatrix&, Eigen::PlainObjectBase >&); +template void igl::random_points_on_mesh, Eigen::Matrix, double, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::SparseMatrix&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/readBF.cpp b/vendor/libigl/include/igl/readBF.cpp new file mode 100644 index 0000000000000000000000000000000000000000..03099ea7e1a731e581e8ce127869e6f11c5eaef6 --- /dev/null +++ b/vendor/libigl/include/igl/readBF.cpp @@ -0,0 +1,114 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "readBF.h" +#include "list_to_matrix.h" +#include +#include +#include +#include +#include +template < + typename DerivedWI, + typename DerivedP, + typename DerivedO> +IGL_INLINE bool igl::readBF( + const std::string & filename, + Eigen::PlainObjectBase & WI, + Eigen::PlainObjectBase & P, + Eigen::PlainObjectBase & O) +{ + using namespace std; + ifstream is(filename); + if(!is.is_open()) + { + return false; + } + string line; + std::vector vWI; + std::vector vP; + std::vector > vO; + while(getline(is, line)) + { + int wi,p; + double cx,cy,cz; + if(sscanf(line.c_str(), "%d %d %lg %lg %lg",&wi,&p,&cx,&cy,&cz) != 5) + { + return false; + } + vWI.push_back(wi); + vP.push_back(p); + vO.push_back({cx,cy,cz}); + } + list_to_matrix(vWI,WI); + list_to_matrix(vP,P); + list_to_matrix(vO,O); + return true; +} + +template < + typename DerivedWI, + typename DerivedbfP, + typename DerivedO, + typename DerivedC, + typename DerivedBE, + typename DerivedP> +IGL_INLINE bool igl::readBF( + const std::string & filename, + Eigen::PlainObjectBase & WI, + Eigen::PlainObjectBase & bfP, + Eigen::PlainObjectBase & offsets, + Eigen::PlainObjectBase & C, + Eigen::PlainObjectBase & BE, + Eigen::PlainObjectBase & P) +{ + using namespace Eigen; + using namespace std; + if(!readBF(filename,WI,bfP,offsets)) + { + return false; + } + + C.resize(WI.rows(),3); + vector computed(C.rows(),false); + // better not be cycles in bfP + std::function locate_tip; + locate_tip = + [&offsets,&computed,&bfP,&locate_tip,&C](const int w)->Eigen::RowVector3d + { + if(w<0) return Eigen::RowVector3d(0,0,0); + if(computed[w]) return C.row(w); + computed[w] = true; + return C.row(w) = locate_tip(bfP(w)) + offsets.row(w); + }; + int num_roots = (bfP.array() == -1).count(); + BE.resize(WI.rows()-num_roots,2); + P.resize(BE.rows()); + for(int c = 0;c=0); + // weight associated with this bone + const int wi = WI(c); + if(wi >= 0) + { + // index into C + const int p = bfP(c); + assert(p >= 0 && "No weights for roots allowed"); + // index into BE + const int pwi = WI(p); + P(wi) = pwi; + BE(wi,0) = p; + BE(wi,1) = c; + } + } + return true; +} + +#ifdef IGL_STATIC_LIBRARY +template bool igl::readBF, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/readMESH.h b/vendor/libigl/include/igl/readMESH.h new file mode 100644 index 0000000000000000000000000000000000000000..b9b76303516c09242f54815812e19127f2091ed7 --- /dev/null +++ b/vendor/libigl/include/igl/readMESH.h @@ -0,0 +1,78 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_READMESH_H +#define IGL_READMESH_H +#include "igl_inline.h" + +#include +#include +#include +#include + +namespace igl +{ + // load a tetrahedral volume mesh from a .mesh file + // + // Templates: + // Scalar type for positions and vectors (will be read as double and cast + // to Scalar) + // Index type for indices (will be read as int and cast to Index) + // Input: + // mesh_file_name path of .mesh file + // Outputs: + // V double matrix of vertex positions #V by 3 + // T #T list of tet indices into vertex positions + // F #F list of face indices into vertex positions + // + // Known bugs: Holes and regions are not supported + template + IGL_INLINE bool readMESH( + const std::string mesh_file_name, + std::vector > & V, + std::vector > & T, + std::vector > & F); + // Inputs: + // mesh_file pointer to already opened .mesh file + // Outputs: + // mesh_file closed file + template + IGL_INLINE bool readMESH( + FILE * mesh_file, + std::vector > & V, + std::vector > & T, + std::vector > & F); + + // Input: + // mesh_file_name path of .mesh file + // Outputs: + // V eigen double matrix #V by 3 + // T eigen int matrix #T by 4 + // F eigen int matrix #F by 3 + template + IGL_INLINE bool readMESH( + const std::string mesh_file_name, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& T, + Eigen::PlainObjectBase& F); + // Inputs: + // mesh_file pointer to already opened .mesh file + // Outputs: + // mesh_file closed file + template + IGL_INLINE bool readMESH( + FILE * mesh_file, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& T, + Eigen::PlainObjectBase& F); +} + +#ifndef IGL_STATIC_LIBRARY +# include "readMESH.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/readOBJ.cpp b/vendor/libigl/include/igl/readOBJ.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8694e69a517f94830aef488ce8afb1073bb3e2f5 --- /dev/null +++ b/vendor/libigl/include/igl/readOBJ.cpp @@ -0,0 +1,439 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "readOBJ.h" + +#include "list_to_matrix.h" +#include "max_size.h" +#include "min_size.h" +#include "polygon_corners.h" +#include "polygons_to_triangles.h" + +#include +#include +#include +#include +#include + +template +IGL_INLINE bool igl::readOBJ( + const std::string obj_file_name, + std::vector > & V, + std::vector > & TC, + std::vector > & N, + std::vector > & F, + std::vector > & FTC, + std::vector > & FN) +{ + // Open file, and check for error + FILE * obj_file = fopen(obj_file_name.c_str(),"r"); + if(NULL==obj_file) + { + fprintf(stderr,"IOError: %s could not be opened...\n", + obj_file_name.c_str()); + return false; + } + std::vector> FM; + return igl::readOBJ(obj_file,V,TC,N,F,FTC,FN, FM); +} + +template +IGL_INLINE bool igl::readOBJ( + const std::string obj_file_name, + std::vector > & V, + std::vector > & TC, + std::vector > & N, + std::vector > & F, + std::vector > & FTC, + std::vector > & FN, + std::vector> &FM) +{ + // Open file, and check for error + FILE * obj_file = fopen(obj_file_name.c_str(),"r"); + if(NULL==obj_file) + { + fprintf(stderr,"IOError: %s could not be opened...\n", + obj_file_name.c_str()); + return false; + } + return igl::readOBJ(obj_file,V,TC,N,F,FTC,FN,FM); +} + +template +IGL_INLINE bool igl::readOBJ( + FILE * obj_file, + std::vector > & V, + std::vector > & TC, + std::vector > & N, + std::vector > & F, + std::vector > & FTC, + std::vector > & FN, + std::vector> &FM) +{ + // File open was successful so clear outputs + V.clear(); + TC.clear(); + N.clear(); + F.clear(); + FTC.clear(); + FN.clear(); + + // variables and constants to assist parsing the .obj file + // Constant strings to compare against + std::string v("v"); + std::string vn("vn"); + std::string vt("vt"); + std::string f("f"); + std::string tic_tac_toe("#"); +#ifndef IGL_LINE_MAX +# define IGL_LINE_MAX 2048 +#endif + +#ifndef MATERIAL_LINE_MAX +# define MATERIAL_LINE_MAX 2048 +#endif + + char line[IGL_LINE_MAX]; + char currentmaterialref[MATERIAL_LINE_MAX] = ""; + bool FMwasinit = false; + int line_no = 1, previous_face_no=0, current_face_no = 0; + while (fgets(line, IGL_LINE_MAX, obj_file) != NULL) + { + char type[IGL_LINE_MAX]; + // Read first word containing type + if(sscanf(line, "%s",type) == 1) + { + // Get pointer to rest of line right after type + char * l = &line[strlen(type)]; + if(type == v) + { + std::istringstream ls(&line[1]); + std::vector vertex{ std::istream_iterator(ls), std::istream_iterator() }; + + if (vertex.size() < 3) + { + fprintf(stderr, + "Error: readOBJ() vertex on line %d should have at least 3 coordinates", + line_no); + fclose(obj_file); + return false; + } + + V.push_back(vertex); + }else if(type == vn) + { + double x[3]; + int count = + sscanf(l,"%lf %lf %lf\n",&x[0],&x[1],&x[2]); + if(count != 3) + { + fprintf(stderr, + "Error: readOBJ() normal on line %d should have 3 coordinates", + line_no); + fclose(obj_file); + return false; + } + std::vector normal(count); + for(int i = 0;i tex(count); + for(int i = 0;iint + { + return i<0 ? i+V.size() : i-1; + }; + const auto & shift_t = [&TC](const int i)->int + { + return i<0 ? i+TC.size() : i-1; + }; + const auto & shift_n = [&N](const int i)->int + { + return i<0 ? i+N.size() : i-1; + }; + std::vector f; + std::vector ftc; + std::vector fn; + // Read each "word" after type + char word[IGL_LINE_MAX]; + int offset; + while(sscanf(l,"%s%n",word,&offset) == 1) + { + // adjust offset + l += offset; + // Process word + long int i,it,in; + if(sscanf(word,"%ld/%ld/%ld",&i,&it,&in) == 3) + { + f.push_back(shift(i)); + ftc.push_back(shift_t(it)); + fn.push_back(shift_n(in)); + }else if(sscanf(word,"%ld/%ld",&i,&it) == 2) + { + f.push_back(shift(i)); + ftc.push_back(shift_t(it)); + }else if(sscanf(word,"%ld//%ld",&i,&in) == 2) + { + f.push_back(shift(i)); + fn.push_back(shift_n(in)); + }else if(sscanf(word,"%ld",&i) == 1) + { + f.push_back(shift(i)); + }else + { + fprintf(stderr, + "Error: readOBJ() face on line %d has invalid element format\n", + line_no); + fclose(obj_file); + return false; + } + } + if( + (f.size()>0 && fn.size() == 0 && ftc.size() == 0) || + (f.size()>0 && fn.size() == f.size() && ftc.size() == 0) || + (f.size()>0 && fn.size() == 0 && ftc.size() == f.size()) || + (f.size()>0 && fn.size() == f.size() && ftc.size() == f.size())) + { + // No matter what add each type to lists so that lists are the + // correct lengths + F.push_back(f); + FTC.push_back(ftc); + FN.push_back(fn); + current_face_no++; + }else + { + fprintf(stderr, + "Error: readOBJ() face on line %d has invalid format\n", line_no); + fclose(obj_file); + return false; + } + }else if(strlen(type) >= 1 && strcmp("usemtl",type)==0 ) + { + if(FMwasinit){ + FM.push_back(std::make_tuple(currentmaterialref,previous_face_no,current_face_no-1)); + previous_face_no = current_face_no; + } + else{ + FMwasinit=true; + } + sscanf(l, "%s\n", currentmaterialref); + } + else if(strlen(type) >= 1 && (type[0] == '#' || + type[0] == 'g' || + type[0] == 's' || + strcmp("mtllib",type)==0)) + { + //ignore comments or other shit + }else + { + //ignore any other lines + fprintf(stderr, + "Warning: readOBJ() ignored non-comment line %d:\n %s", + line_no, + line); + } + }else + { + // ignore empty line + } + line_no++; + } + if(strcmp(currentmaterialref,"")!=0) + FM.push_back(std::make_tuple(currentmaterialref,previous_face_no,current_face_no-1)); + fclose(obj_file); + + assert(F.size() == FN.size()); + assert(F.size() == FTC.size()); + + return true; +} + +template +IGL_INLINE bool igl::readOBJ( + const std::string obj_file_name, + std::vector > & V, + std::vector > & F) +{ + std::vector > TC,N; + std::vector > FTC,FN; + std::vector> FM; + + return readOBJ(obj_file_name,V,TC,N,F,FTC,FN); +} + +template < + typename DerivedV, + typename DerivedTC, + typename DerivedCN, + typename DerivedF, + typename DerivedFTC, + typename DerivedFN> +IGL_INLINE bool igl::readOBJ( + const std::string str, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& TC, + Eigen::PlainObjectBase& CN, + Eigen::PlainObjectBase& F, + Eigen::PlainObjectBase& FTC, + Eigen::PlainObjectBase& FN) +{ + std::vector > vV,vTC,vN; + std::vector > vF,vFTC,vFN; + bool success = igl::readOBJ(str,vV,vTC,vN,vF,vFTC,vFN); + if(!success) + { + // readOBJ(str,vV,vTC,vN,vF,vFTC,vFN) should have already printed an error + // message to stderr + return false; + } + bool V_rect = igl::list_to_matrix(vV,V); + const char * format = "Failed to cast %s to matrix: min (%d) != max (%d)\n"; + if(!V_rect) + { + printf(format,"V",igl::min_size(vV),igl::max_size(vV)); + return false; + } + bool F_rect = igl::list_to_matrix(vF,F); + if(!F_rect) + { + printf(format,"F",igl::min_size(vF),igl::max_size(vF)); + return false; + } + if(!vN.empty()) + { + bool VN_rect = igl::list_to_matrix(vN,CN); + if(!VN_rect) + { + printf(format,"CN",igl::min_size(vN),igl::max_size(vN)); + return false; + } + } + + if(!vFN.empty() && !vFN[0].empty()) + { + bool FN_rect = igl::list_to_matrix(vFN,FN); + if(!FN_rect) + { + printf(format,"FN",igl::min_size(vFN),igl::max_size(vFN)); + return false; + } + } + + if(!vTC.empty()) + { + + bool T_rect = igl::list_to_matrix(vTC,TC); + if(!T_rect) + { + printf(format,"TC",igl::min_size(vTC),igl::max_size(vTC)); + return false; + } + } + if(!vFTC.empty()&& !vFTC[0].empty()) + { + + bool FTC_rect = igl::list_to_matrix(vFTC,FTC); + if(!FTC_rect) + { + printf(format,"FTC",igl::min_size(vFTC),igl::max_size(vFTC)); + return false; + } + } + return true; +} + +template +IGL_INLINE bool igl::readOBJ( + const std::string str, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& F) +{ + std::vector > vV,vTC,vN; + std::vector > vF,vFTC,vFN; + bool success = igl::readOBJ(str,vV,vTC,vN,vF,vFTC,vFN); + if(!success) + { + // readOBJ(str,vV,vTC,vN,vF,vFTC,vFN) should have already printed an error + // message to stderr + return false; + } + bool V_rect = igl::list_to_matrix(vV,V); + if(!V_rect) + { + // igl::list_to_matrix(vV,V) already printed error message to std err + return false; + } + bool F_rect = igl::list_to_matrix(vF,F); + if(!F_rect) + { + // igl::list_to_matrix(vF,F) already printed error message to std err + return false; + } + return true; +} + +template +IGL_INLINE bool igl::readOBJ( + const std::string str, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& I, + Eigen::PlainObjectBase& C) +{ + // we should flip this so that the base implementation uses arrays. + std::vector > vV,vTC,vN; + std::vector > vF,vFTC,vFN; + bool success = igl::readOBJ(str,vV,vTC,vN,vF,vFTC,vFN); + if(!success) + { + // readOBJ(str,vV,vTC,vN,vF,vFTC,vFN) should have already printed an error + // message to stderr + return false; + } + if(!igl::list_to_matrix(vV,V)) + { + return false; + } + igl::polygon_corners(vF,I,C); + return true; +} + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::readOBJ, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readOBJ(std::basic_string, std::allocator >, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&); +template bool igl::readOBJ(std::basic_string, std::allocator >, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&, std::vector, std::allocator >, int, int>, std::allocator, std::allocator >, int, int> > >&); +template bool igl::readOBJ(std::basic_string, std::allocator >, std::vector >, std::allocator > > >&, std::vector >, std::allocator > > >&); +template bool igl::readOBJ, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readOBJ, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readOBJ, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readOBJ, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readOBJ, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/readOBJ.h b/vendor/libigl/include/igl/readOBJ.h new file mode 100644 index 0000000000000000000000000000000000000000..926010eb5b0205d51bc172a8ac9c6764aad99e64 --- /dev/null +++ b/vendor/libigl/include/igl/readOBJ.h @@ -0,0 +1,143 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef IGL_READOBJ_H +#define IGL_READOBJ_H +#include "igl_inline.h" +// History: +// return type changed from void to bool Alec 18 Sept 2011 +// added pure vector of vectors version that has much more support Alec 31 Oct +// 2011 + +#ifndef IGL_NO_EIGEN +# include +#endif +#include +#include +#include + +namespace igl +{ + // Read a mesh from an ascii obj file, filling in vertex positions, normals + // and texture coordinates. Mesh may have faces of any number of degree + // + // Templates: + // Scalar type for positions and vectors (will be read as double and cast + // to Scalar) + // Index type for indices (will be read as int and cast to Index) + // Inputs: + // str path to .obj file + // Outputs: + // V double matrix of vertex positions #V by 3 + // TC double matrix of texture coordinats #TC by 2 + // N double matrix of corner normals #N by 3 + // F #F list of face indices into vertex positions + // FTC #F list of face indices into vertex texture coordinates + // FN #F list of face indices into vertex normals + // Returns true on success, false on errors + template + IGL_INLINE bool readOBJ( + const std::string obj_file_name, + std::vector > & V, + std::vector > & TC, + std::vector > & N, + std::vector > & F, + std::vector > & FTC, + std::vector > & FN); + // Read a mesh from an ascii obj file, filling in vertex positions, normals + // and texture coordinates. Mesh may have faces of any number of degree + // + // Templates: + // Scalar type for positions and vectors (will be read as double and cast + // to Scalar) + // Index type for indices (will be read as int and cast to Index) + // Inputs: + // str path to .obj file + // Outputs: + // V double matrix of vertex positions #V by 3 + // TC double matrix of texture coordinats #TC by 2 + // N double matrix of corner normals #N by 3 + // F #F list of face indices into vertex positions + // FTC #F list of face indices into vertex texture coordinates + // FN #F list of face indices into vertex normals + // FM #tuple list containing (vertex index, normal index, texture coordinates index, material) + // Returns true on success, false on errors + template + IGL_INLINE bool readOBJ( + const std::string obj_file_name, + std::vector > & V, + std::vector > & TC, + std::vector > & N, + std::vector > & F, + std::vector > & FTC, + std::vector > & FN, + std::vector> &FM + ); + + // Inputs: + // obj_file pointer to already opened .obj file + // Outputs: + // obj_file closed file + template + IGL_INLINE bool readOBJ( + FILE * obj_file, + std::vector > & V, + std::vector > & TC, + std::vector > & N, + std::vector > & F, + std::vector > & FTC, + std::vector > & FN, + std::vector> &FM); + // Just V and F + template + IGL_INLINE bool readOBJ( + const std::string obj_file_name, + std::vector > & V, + std::vector > & F); + // Eigen Wrappers. These will return true only if the data is perfectly + // "rectangular": All faces are the same degree, all have the same number of + // textures/normals etc. + template < + typename DerivedV, + typename DerivedTC, + typename DerivedCN, + typename DerivedF, + typename DerivedFTC, + typename DerivedFN> + IGL_INLINE bool readOBJ( + const std::string str, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& TC, + Eigen::PlainObjectBase& CN, + Eigen::PlainObjectBase& F, + Eigen::PlainObjectBase& FTC, + Eigen::PlainObjectBase& FN); + template + IGL_INLINE bool readOBJ( + const std::string str, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& F); + // Outputs: + // I #I vectorized list of polygon corner indices into rows of some matrix V + // C #P+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of + // the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of + // the ith polygon + template + IGL_INLINE bool readOBJ( + const std::string str, + Eigen::PlainObjectBase& V, + Eigen::PlainObjectBase& I, + Eigen::PlainObjectBase& C); + +} + +#ifndef IGL_STATIC_LIBRARY +# include "readOBJ.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/readPLY.h b/vendor/libigl/include/igl/readPLY.h new file mode 100644 index 0000000000000000000000000000000000000000..ca57b0292e3a5a4a56449fb3a8c72acdb3676b92 --- /dev/null +++ b/vendor/libigl/include/igl/readPLY.h @@ -0,0 +1,221 @@ +#ifndef IGL_READPLY_H +#define IGL_READPLY_H +#include +#include +#include +#include +#include "tinyply.h" + +namespace igl +{ +template < + typename DerivedV, + typename DerivedF + > +IGL_INLINE bool readPLY( + FILE *fp, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F + ); + + +// Read triangular mesh from ply file, filling in vertex positions, normals + // and texture coordinates, if available + // also read additional properties associated with vertex,faces and edges + // and file comments + // + // Templates: + // Derived from Eigen matrix parameters + // Inputs: + // ply_stream ply file input stream + // Outputs: + // V (#V,3) matrix of vertex positions + // F (#F,3) list of face indices into vertex positions + // E (#E,2) list of edge indices into vertex positions + // N (#V,3) list of normals + // UV (#V,2) list of texture coordinates + // VD (#V,*) additional vertex data + // Vheader (#V) list of vertex data headers + // FD (#F,*) additional face data + // Fheader (#F) list of face data headers + // ED (#E,*) additional edge data + // Eheader (#E) list of edge data headers + // comments (*) file comments + // Returns true on success, false on errors + template < + typename DerivedV, + typename DerivedF, + typename DerivedE, + typename DerivedN, + typename DerivedUV, + typename DerivedVD, + typename DerivedFD, + typename DerivedED + > + bool readPLY( + std::istream & ply_stream, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & N, + Eigen::PlainObjectBase & UV, + + Eigen::PlainObjectBase & VD, + std::vector & Vheader, + Eigen::PlainObjectBase & FD, + std::vector & Fheader, + Eigen::PlainObjectBase & ED, + std::vector & Eheader, + std::vector & comments + ); + + // Read triangular mesh from ply file, filling in vertex positions, normals + // and texture coordinates, if available + // also read additional properties associated with vertex,faces and edges + // and file comments + // + // Templates: + // Derived from Eigen matrix parameters + // Inputs: + // ply_file ply file name + // Outputs: + // V (#V,3) matrix of vertex positions + // F (#F,3) list of face indices into vertex positions + // E (#E,2) list of edge indices into vertex positions + // N (#V,3) list of normals + // UV (#V,2) list of texture coordinates + // VD (#V,*) additional vertex data + // Vheader (#V) list of vertex data headers + // FD (#F,*) additional face data + // Fheader (#F) list of face data headers + // ED (#E,*) additional edge data + // Eheader (#E) list of edge data headers + // comments (*) file comments + // Returns true on success, false on errors + template < + typename DerivedV, + typename DerivedF, + typename DerivedE, + typename DerivedN, + typename DerivedUV, + typename DerivedVD, + typename DerivedFD, + typename DerivedED + > + bool readPLY( + const std::string& ply_file, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & N, + Eigen::PlainObjectBase & UV, + + Eigen::PlainObjectBase & VD, + std::vector & VDheader, + + Eigen::PlainObjectBase & FD, + std::vector & FDheader, + + Eigen::PlainObjectBase & ED, + std::vector & EDheader, + std::vector & comments + ); + + + // Read triangular mesh from ply file, filling in vertex positions, normals + // and texture coordinates, if available + // also read additional properties associated with vertex,faces and edges + // and file comments + // + // Templates: + // Derived from Eigen matrix parameters + // Inputs: + // ply_file ply file name + // Outputs: + // V (#V,3) matrix of vertex positions + // F (#F,3) list of face indices into vertex positions + // N (#V,3) list of normals + // UV (#V,2) list of texture coordinates + // VD (#V,*) additional vertex data + // Vheader (#V) list of vertex data headers + // Returns true on success, false on errors + template < + typename DerivedV, + typename DerivedF, + typename DerivedN, + typename DerivedUV, + typename DerivedVD + > + bool readPLY( + const std::string & filename, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & N, + Eigen::PlainObjectBase & UV, + Eigen::PlainObjectBase & VD, + std::vector & Vheader + ); + + // Read triangular mesh from ply file, filling in vertex positions, normals + // and texture coordinates, if available + // also read additional properties associated with vertex,faces and edges + // and file comments + // + // Templates: + // Derived from Eigen matrix parameters + // Inputs: + // ply_file ply file name + // Outputs: + // V (#V,3) matrix of vertex positions + // F (#F,3) list of face indices into vertex positions + // E (#E,2) list of edge indices into vertex positions + // N (#V,3) list of normals + // UV (#V,2) list of texture coordinates + // VD (#V,*) additional vertex data + // Vheader (#V) list of vertex data headers + // Returns true on success, false on errors + template < + typename DerivedV, + typename DerivedF, + typename DerivedE, + typename DerivedN, + typename DerivedUV + > + bool readPLY( + const std::string & filename, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & E, + Eigen::PlainObjectBase & N, + Eigen::PlainObjectBase & UV + ); + + + template < + typename DerivedV, + typename DerivedF + > + bool readPLY( + const std::string & filename, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F + ); + + template < + typename DerivedV, + typename DerivedF, + typename DerivedE + > + bool readPLY( + const std::string & filename, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & E + ); + +} + +#ifndef IGL_STATIC_LIBRARY +# include "readPLY.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/readSTL.cpp b/vendor/libigl/include/igl/readSTL.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1dd1ddde32fc83ef74c0b7491e4db5765e96e2e3 --- /dev/null +++ b/vendor/libigl/include/igl/readSTL.cpp @@ -0,0 +1,327 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Alec Jacobson +// Copyright (C) 2018 Qingnan Zhou +// Copyright (C) 2020 Jérémie Dumas +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "readSTL.h" +#include "list_to_matrix.h" +#include "string_utils.h" +#include "read_file_binary.h" +#include "FileMemoryStream.h" + +#include + +namespace igl { + +template +IGL_INLINE bool readSTL(std::istream &input, + Eigen::PlainObjectBase &V, + Eigen::PlainObjectBase &F, + Eigen::PlainObjectBase &N) { + std::vector> vV; + std::vector> vN; + std::vector> vF; + if (!readSTL(input, vV, vF, vN)) { + return false; + } + + if (!list_to_matrix(vV, V)) { + return false; + } + + if (!list_to_matrix(vF, F)) { + return false; + } + + if (!list_to_matrix(vN, N)) { + return false; + } + return true; +} + +IGL_INLINE bool is_stl_binary(std::istream &input) { + std::streampos start_pos = input.tellg(); + + constexpr size_t HEADER_SIZE = 80; + char header[HEADER_SIZE]; + input.read(header, HEADER_SIZE); + if (!starts_with(header, "solid")) { + input.seekg(start_pos); + return true; + } + if (!input.good()) { + input.seekg(start_pos); + return false; + } + + // Check if filesize matches the number of faces claimed. + char buf[4]; + input.read(buf, 4); + size_t num_faces = *reinterpret_cast(buf); + input.seekg(0, input.end); + size_t file_size = input.tellg(); + + input.seekg(start_pos); + + if (file_size == 80 + 4 + (4 * 12 + 2) * num_faces) { + return true; + } else { + return false; + } +} + +template +IGL_INLINE bool read_stl_ascii(std::istream &input, + std::vector> &V, + std::vector> &F, + std::vector> &N) { + constexpr size_t LINE_SIZE = 256; + char line[LINE_SIZE]; + bool success = true; + + if (!input) { + throw std::runtime_error("Failed to open file"); + } + + // skip header line. + input.getline(line, LINE_SIZE); + + auto parse_ascii_normal = [&N](const char *line) { + double x, y, z; + size_t n = sscanf(line, " facet normal %lf %lf %lf", &x, &y, &z); + assert(n == 3); + if (n != 3) { + return false; + } + + N.push_back({{static_cast(x), static_cast(y), + static_cast(z)}}); + return true; + }; + + auto parse_ascii_vertex = [&V](const char *line) { + double x, y, z; + size_t n = sscanf(line, " vertex %lf %lf %lf", &x, &y, &z); + assert(n == 3); + if (n != 3) { + return false; + } + + V.push_back({{static_cast(x), static_cast(y), + static_cast(z)}}); + return true; + }; + + auto parse_ascii_facet = [&parse_ascii_vertex, &parse_ascii_normal](std::istream &fin) { + constexpr size_t LINE_SIZE = 256; + constexpr size_t WORD_SIZE = 128; + char line[LINE_SIZE]; + char first_word[WORD_SIZE]; + const char *face_begin = "facet"; + const char *face_end = "endfacet"; + const char *loop_begin = "outer"; + const char *loop_end = "endloop"; + const char *vertex_flag = "vertex"; + + bool reading_facet = false; + bool reading_loop = false; + bool success = true; + size_t num_vts = 0; + while (!fin.eof()) { + fin.getline(line, LINE_SIZE); + size_t n = sscanf(line, " %s", first_word); + if (n == 0) + continue; + if (starts_with(first_word, face_begin)) { + success = parse_ascii_normal(line); + assert(success); + reading_facet = true; + } else if (starts_with(first_word, face_end)) { + assert(reading_facet); + reading_facet = false; + } else if (starts_with(first_word, loop_begin)) { + reading_loop = true; + } else if (starts_with(first_word, loop_end)) { + assert(reading_loop); + reading_loop = false; + } else if (starts_with(first_word, vertex_flag)) { + assert(reading_facet); + assert(reading_loop); + success = parse_ascii_vertex(line); + assert(success); + num_vts += 1; + } + if (!success) { + return false; + } + if (!reading_facet) { + break; + } + } + if (num_vts == 0) { + return true; + } + assert(num_vts == 3); + if (num_vts != 3) { + std::cerr << "Warning: mesh contain face made of " << num_vts + << " vertices" << std::endl; + return false; + } + return true; + }; + + while (!input.eof()) { + success = parse_ascii_facet(input); + if (!success) { + return false; + } + } + + F.resize(V.size() / 3); + for (size_t f = 0; f < F.size(); ++f) { + auto v = static_cast(f * 3); + F[f] = {{v, v + 1, v + 2}}; + } + return success; +} + +template +IGL_INLINE bool read_stl_binary(std::istream &input, + std::vector> &V, + std::vector> &F, + std::vector> &N) { + if (!input) { + throw std::runtime_error("Failed to open file"); + } + + constexpr size_t FLOAT_SIZE = sizeof(float); + static_assert(FLOAT_SIZE == 4, "float type is not 4 bytes"); + constexpr size_t LINE_SIZE = 256; + char buf[LINE_SIZE]; + + // 80 bytes header, no data significance. + input.read(buf, 80); + if (!input.good()) { + throw std::runtime_error("Unable to parse STL header."); + } + + input.read(buf, 4); + const size_t num_faces = *reinterpret_cast(buf); + if (!input.good()) { + throw std::runtime_error("Unable to parse STL number of faces."); + } + + for (size_t i = 0; i < num_faces; i++) { + // Parse normal + input.read(buf, FLOAT_SIZE * 3); + auto nx = static_cast(*reinterpret_cast(buf)); + auto ny = static_cast(*reinterpret_cast(buf + FLOAT_SIZE)); + auto nz = + static_cast(*reinterpret_cast(buf + FLOAT_SIZE * 2)); + assert(input.good()); + + // vertex 1 + input.read(buf, FLOAT_SIZE * 3); + auto v1x = static_cast(*reinterpret_cast(buf)); + auto v1y = static_cast(*reinterpret_cast(buf + FLOAT_SIZE)); + auto v1z = + static_cast(*reinterpret_cast(buf + FLOAT_SIZE * 2)); + assert(input.good()); + + // vertex 2 + input.read(buf, FLOAT_SIZE * 3); + auto v2x = static_cast(*reinterpret_cast(buf)); + auto v2y = static_cast(*reinterpret_cast(buf + FLOAT_SIZE)); + auto v2z = + static_cast(*reinterpret_cast(buf + FLOAT_SIZE * 2)); + assert(input.good()); + + // vertex 3 + input.read(buf, FLOAT_SIZE * 3); + auto v3x = static_cast(*reinterpret_cast(buf)); + auto v3y = static_cast(*reinterpret_cast(buf + FLOAT_SIZE)); + auto v3z = + static_cast(*reinterpret_cast(buf + FLOAT_SIZE * 2)); + assert(input.good()); + + // attribute (2 bytes), not sure what purpose they serve. + input.read(buf, 2); + + N.push_back({{nx, ny, nz}}); + V.push_back({{v1x, v1y, v1z}}); + V.push_back({{v2x, v2y, v2z}}); + V.push_back({{v3x, v3y, v3z}}); + + assert(input.good()); + if (!input.good()) { + std::stringstream err_msg; + err_msg << "Failed to parse face " << i << " from STL file"; + throw std::runtime_error(err_msg.str()); + } + } + std::for_each(V.begin(), V.end(), [](const std::array &v) { + for (auto x : v) { + if (!std::isfinite(x)) { + throw std::runtime_error("NaN or Inf detected in input file."); + } + } + }); + + if (!V.empty()) { + F.resize(V.size() / 3); + for (size_t f = 0; f < F.size(); ++f) { + auto v = static_cast(f * 3); + F[f] = {{v, v + 1, v + 2}}; + } + } + + return true; +} + +template +IGL_INLINE bool readSTL(std::istream &input, + std::vector> &V, + std::vector> &F, + std::vector> &N) { + bool success = false; + if (is_stl_binary(input)) { + success = read_stl_binary(input, V, F, N); + } else { + success = read_stl_ascii(input, V, F, N); + } + return success; +} + +template +IGL_INLINE bool readSTL( + FILE * fp, + Eigen::PlainObjectBase & V, + Eigen::PlainObjectBase & F, + Eigen::PlainObjectBase & N) +{ + std::vector fileBufferBytes; + read_file_binary(fp,fileBufferBytes); + FileMemoryStream stream((char*)fileBufferBytes.data(), fileBufferBytes.size()); + return readSTL(stream, V, F, N); +} + +} // namespace igl + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template bool igl::readSTL, Eigen::Matrix, Eigen::Matrix >(FILE*, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/readTGF.cpp b/vendor/libigl/include/igl/readTGF.cpp new file mode 100644 index 0000000000000000000000000000000000000000..814395b301aabd14806c7cf9517b9396f62c265b --- /dev/null +++ b/vendor/libigl/include/igl/readTGF.cpp @@ -0,0 +1,200 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "readTGF.h" + +#include + +IGL_INLINE bool igl::readTGF( + const std::string tgf_filename, + std::vector > & C, + std::vector > & E, + std::vector & P, + std::vector > & BE, + std::vector > & CE, + std::vector > & PE) +{ + using namespace std; + // clear output + C.clear(); + E.clear(); + P.clear(); + BE.clear(); + CE.clear(); + PE.clear(); + + FILE * tgf_file = fopen(tgf_filename.c_str(),"r"); + if(NULL==tgf_file) + { + printf("IOError: %s could not be opened\n",tgf_filename.c_str()); + return false; + } + + bool reading_vertices = true; + bool reading_edges = true; + const int MAX_LINE_LENGTH = 500; + char line[MAX_LINE_LENGTH]; + // read until seeing end of file + while(fgets(line,MAX_LINE_LENGTH,tgf_file)!=NULL) + { + // comment signifies end of vertices, next line is start of edges + if(line[0] == '#') + { + if(reading_vertices) + { + reading_vertices = false; + reading_edges = true; + }else if(reading_edges) + { + reading_edges = false; + } + // process vertex line + }else if(reading_vertices) + { + int index; + vector position(3); + int count = + sscanf(line,"%d %lg %lg %lg", + &index, + &position[0], + &position[1], + &position[2]); + if(count != 4) + { + fprintf(stderr,"Error: readTGF.h: bad format in vertex line\n"); + fclose(tgf_file); + return false; + } + // index is ignored since vertices must already be in order + C.push_back(position); + }else if(reading_edges) + { + vector edge(2); + int is_BE = 0; + int is_PE = 0; + int is_CE = 0; + int count = sscanf(line,"%d %d %d %d %d\n", + &edge[0], + &edge[1], + &is_BE, + &is_PE, + &is_CE); + if(count<2) + { + fprintf(stderr,"Error: readTGF.h: bad format in edge line\n"); + fclose(tgf_file); + return false; + } + // .tgf is one indexed + edge[0]--; + edge[1]--; + E.push_back(edge); + if(is_BE == 1) + { + BE.push_back(edge); + } + if(is_PE == 1) + { + // PE should index P + fprintf(stderr, + "Warning: readTGF.h found pseudo edges but does not support " + "them\n"); + } + if(is_CE == 1) + { + // CE should index P + fprintf(stderr, + "Warning: readTGF.h found cage edges but does not support them\n"); + } + }else + { + // ignore faces + } + } + fclose(tgf_file); + // Construct P, indices not in BE + for(int i = 0;i<(int)C.size();i++) + { + bool in_edge = false; + for(int j = 0;j<(int)BE.size();j++) + { + if(i == BE[j][0] || i == BE[j][1]) + { + in_edge = true; + break; + } + } + if(!in_edge) + { + P.push_back(i); + } + } + return true; +} + +#ifndef IGL_NO_EIGEN +#include "list_to_matrix.h" + +IGL_INLINE bool igl::readTGF( + const std::string tgf_filename, + Eigen::MatrixXd & C, + Eigen::MatrixXi & E, + Eigen::VectorXi & P, + Eigen::MatrixXi & BE, + Eigen::MatrixXi & CE, + Eigen::MatrixXi & PE) +{ + std::vector > vC; + std::vector > vE; + std::vector vP; + std::vector > vBE; + std::vector > vCE; + std::vector > vPE; + bool success = readTGF(tgf_filename,vC,vE,vP,vBE,vCE,vPE); + if(!success) + { + return false; + } + + if(!list_to_matrix(vC,C)) + { + return false; + } + if(!list_to_matrix(vE,E)) + { + return false; + } + if(!list_to_matrix(vP,P)) + { + return false; + } + if(!list_to_matrix(vBE,BE)) + { + return false; + } + if(!list_to_matrix(vCE,CE)) + { + return false; + } + if(!list_to_matrix(vPE,PE)) + { + return false; + } + + return true; +} + +IGL_INLINE bool igl::readTGF( + const std::string tgf_filename, + Eigen::MatrixXd & C, + Eigen::MatrixXi & E) +{ + Eigen::VectorXi P; + Eigen::MatrixXi BE,CE,PE; + return readTGF(tgf_filename,C,E,P,BE,CE,PE); +} +#endif diff --git a/vendor/libigl/include/igl/read_file_binary.cpp b/vendor/libigl/include/igl/read_file_binary.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d86c5ac9d3125e582e60a3b5d0642109e61a865c --- /dev/null +++ b/vendor/libigl/include/igl/read_file_binary.cpp @@ -0,0 +1,30 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Jérémie Dumas +// Copyright (C) 2021 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "read_file_binary.h" + +#include + +IGL_INLINE void igl::read_file_binary( + FILE *fp, + std::vector &fileBufferBytes) +{ + if (!ferror(fp)) + { + fseek(fp, 0, SEEK_END); + size_t sizeBytes = ftell(fp); + fseek(fp, 0, SEEK_SET); + fileBufferBytes.resize(sizeBytes); + if(fread((char*)fileBufferBytes.data(), 1, sizeBytes, fp) == sizeBytes) + { + fclose(fp); + return; + } + } + throw std::runtime_error("error reading from file"); +} diff --git a/vendor/libigl/include/igl/redux.h b/vendor/libigl/include/igl/redux.h new file mode 100644 index 0000000000000000000000000000000000000000..21356dab20ae544bfff46932307e3786584217fb --- /dev/null +++ b/vendor/libigl/include/igl/redux.h @@ -0,0 +1,70 @@ +#ifndef IGL_REDUX_H +#define IGL_REDUX_H +#include +#include +namespace igl +{ + // REDUX Perform reductions on the rows or columns of a SparseMatrix. This is + // _similar_ to DenseBase::redux, but different in two important ways: + // 1. (unstored) Zeros are **not** "visited", however if the first element + // in the column/row does not appear in the first row/column then the + // reduction is assumed to start with zero. In this way, "any", "all", + // "count"(non-zeros) work as expected. This means it is **not** possible + // to use this to count (implicit) zeros. + // 2. This redux is more powerful in the sense that A and B may have + // different types. This makes it possible to count the number of + // non-zeros in a SparseMatrix A into a VectorXi B. + // + // Inputs: + // A m by n sparse matrix + // dim dimension along which to sum (1 or 2) + // func function handle with the prototype `X(Y a, I i, J j, Z b)` where a + // is the running value, b is A(i,j) + // Output: + // S n-long sparse vector (if dim == 1) + // or + // S m-long sparse vector (if dim == 2) + template + inline void redux( + const Eigen::SparseMatrix & A, + const int dim, + const Func & func, + Eigen::PlainObjectBase & B); +} + +// Implementation + +#include "for_each.h" + +template +inline void igl::redux( + const Eigen::SparseMatrix & A, + const int dim, + const Func & func, + Eigen::PlainObjectBase & B) +{ + typedef typename Eigen::SparseMatrix::StorageIndex Index; + assert((dim == 1 || dim == 2) && "dim must be 2 or 1"); + // Get size of input + int m = A.rows(); + int n = A.cols(); + // resize output + B = DerivedB::Zero(dim==1?n:m); + const auto func_wrap = [&func,&B,&dim](const Index i, const Index j, const AType v) + { + if(dim == 1) + { + B(j) = i == 0? v : func(B(j),v); + }else + { + B(i) = j == 0? v : func(B(i),v); + } + }; + for_each(A,func_wrap); +} + + +//#ifndef IGL_STATIC_LIBRARY +//# include "redux.cpp" +//#endif +#endif diff --git a/vendor/libigl/include/igl/remesh_along_isoline.h b/vendor/libigl/include/igl/remesh_along_isoline.h new file mode 100644 index 0000000000000000000000000000000000000000..ea9ce0cdaacf08b8b5e91c59cbb220397ad3053e --- /dev/null +++ b/vendor/libigl/include/igl/remesh_along_isoline.h @@ -0,0 +1,81 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_REMESH_ALONG_ISOLINE_H +#define IGL_REMESH_ALONG_ISOLINE_H +#include "igl_inline.h" + +#include +#include + +namespace igl +{ + // Given a triangle mesh and a scalar field, remesh so that a given isovalue + // of the scalar field follows (new) edges of the output mesh. Effectively + // running "marching triangles" on mesh, but not in any coherent order. The + // output mesh should be as manifold as the input. + // + // Inputs: + // V #V by dim list of mesh vertex positions + // F #F by 3 list of mesh triangle indices into V + // S #V by 1 list of scalar field + // val value of S to remesh along + // Outputs: + // U #U by dim list of mesh vertex positions #U>=#V + // G #G by 3 list of mesh triangle indices into U, #G>=#F + // SU #U list of scalar field values over new mesh + // J #G list of indices into F revealing birth triangles + // BC #U by #V sparse matrix of barycentric coordinates so that U = BC*V + // L #G list of bools whether scalar field in triangle below or above val + template < + typename DerivedV, + typename DerivedF, + typename DerivedS, + typename DerivedU, + typename DerivedG, + typename DerivedJ, + typename BCtype, + typename DerivedSU, + typename DerivedL> + IGL_INLINE void remesh_along_isoline( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & S, + const typename DerivedS::Scalar val, + Eigen::PlainObjectBase & U, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & SU, + Eigen::PlainObjectBase & J, + Eigen::SparseMatrix & BC, + Eigen::PlainObjectBase & L); + // Input: + // n number of vertices (#V) + template < + typename DerivedF, + typename DerivedS, + typename DerivedG, + typename DerivedJ, + typename BCtype, + typename DerivedSU, + typename DerivedL> + IGL_INLINE void remesh_along_isoline( + const int n, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & S, + const typename DerivedS::Scalar val, + Eigen::PlainObjectBase & G, + Eigen::PlainObjectBase & SU, + Eigen::PlainObjectBase & J, + Eigen::SparseMatrix & BC, + Eigen::PlainObjectBase & L); +} + +#ifndef IGL_STATIC_LIBRARY +# include "remesh_along_isoline.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/reorder.h b/vendor/libigl/include/igl/reorder.h new file mode 100644 index 0000000000000000000000000000000000000000..50f7d7b0fbd78c5370ba9bdaa590652827348489 --- /dev/null +++ b/vendor/libigl/include/igl/reorder.h @@ -0,0 +1,34 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_REORDER_H +#define IGL_REORDER_H +#include "igl_inline.h" +#include +// For size_t +#include +#include + +namespace igl +{ + // Act like matlab's Y = X(I) for std vectors + // where I contains a vector of indices so that after, + // Y[j] = X[I[j]] for index j + // this implies that Y.size() == I.size() + // X and Y are allowed to be the same reference + template< class T > + IGL_INLINE void reorder( + const std::vector & unordered, + std::vector const & index_map, + std::vector & ordered); +} + +#ifndef IGL_STATIC_LIBRARY +# include "reorder.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/repmat.h b/vendor/libigl/include/igl/repmat.h new file mode 100644 index 0000000000000000000000000000000000000000..1509875aaec5e3af446b6fbecc51043ed41dba00 --- /dev/null +++ b/vendor/libigl/include/igl/repmat.h @@ -0,0 +1,53 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_REPMAT_H +#define IGL_REPMAT_H +#include "igl_inline.h" + +#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET +#include +#include + +namespace igl +{ + // At least for Dense matrices this is replaced by `replicate` e.g., dst = src.replicate(n,m); + // http://forum.kde.org/viewtopic.php?f=74&t=90876#p173517 + + // Ideally this is a super overloaded function that behaves just like + // matlab's repmat + + // Replicate and tile a matrix + // + // Templates: + // T should be a eigen matrix primitive type like int or double + // Inputs: + // A m by n input matrix + // r number of row-direction copies + // c number of col-direction copies + // Outputs: + // B r*m by c*n output matrix + // + template + IGL_INLINE void repmat( + const Eigen::MatrixBase & A, + const int r, + const int c, + Eigen::PlainObjectBase & B); + template + IGL_INLINE void repmat( + const Eigen::SparseMatrix & A, + const int r, + const int c, + Eigen::SparseMatrix & B); +} + +#ifndef IGL_STATIC_LIBRARY +# include "repmat.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/rigid_alignment.cpp b/vendor/libigl/include/igl/rigid_alignment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fdff2ddc0c7f8414701bfb3970fba8c27067817e --- /dev/null +++ b/vendor/libigl/include/igl/rigid_alignment.cpp @@ -0,0 +1,97 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "rigid_alignment.h" +#include "polar_svd.h" +#include +#include +#include +#include + +template < + typename DerivedX, + typename DerivedP, + typename DerivedN, + typename DerivedR, + typename Derivedt +> +IGL_INLINE void igl::rigid_alignment( + const Eigen::MatrixBase & _X, + const Eigen::MatrixBase & P, + const Eigen::MatrixBase & N, + Eigen::PlainObjectBase & R, + Eigen::PlainObjectBase & t) +{ + typedef typename DerivedX::Scalar Scalar; + typedef Eigen::Matrix MatrixXS; + typedef Eigen::Matrix VectorXS; + typedef Eigen::Matrix Matrix3S; + const int k = _X.rows(); + VectorXS Z = VectorXS::Zero(k,1); + VectorXS I = VectorXS::Ones(k,1); + + DerivedX X = _X; + R = DerivedR::Identity(3,3); + t = Derivedt::Zero(1,3); + // See gptoolbox, each iter could be O(1) instead of O(k) + const int max_iters = 5; + for(int iters = 0;iters > NNIJV; + for(int i = 0;i NN(k,k*3); + NN.setFromTriplets(NNIJV.begin(),NNIJV.end()); + A = (NN * A).eval(); + B = (NN * B).eval(); + VectorXS u = (A.transpose() * A).ldlt().solve(A.transpose() * B); + Derivedt ti = u.tail(3).transpose(); + + Matrix3S W; + W<< + 0, u(2),-u(1), + -u(2), 0, u(0), + u(1),-u(0), 0; + // strayed from a perfect rotation. Correct it. + const double x = u.head(3).stableNorm(); + DerivedR Ri; + if(x == 0) + { + Ri = DerivedR::Identity(3,3); + }else + { + Ri = + DerivedR::Identity(3,3) + + sin(x)/x*W + + (1.0-cos(x))/(x*x)*W*W; + } + + R = (R*Ri).eval(); + t = (t*Ri + ti).eval(); + X = ((_X*R).rowwise()+t).eval(); + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::rigid_alignment, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/rotate_vectors.cpp b/vendor/libigl/include/igl/rotate_vectors.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b236d79e693c8ad0747482dbe30a06a6418129d8 --- /dev/null +++ b/vendor/libigl/include/igl/rotate_vectors.cpp @@ -0,0 +1,37 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "rotate_vectors.h" +IGL_INLINE Eigen::MatrixXd igl::rotate_vectors( + const Eigen::MatrixXd& V, + const Eigen::VectorXd& A, + const Eigen::MatrixXd& B1, + const Eigen::MatrixXd& B2) +{ + Eigen::MatrixXd RV(V.rows(),V.cols()); + + for (unsigned i=0; i + +namespace igl +{ + // Given 2 vectors centered on origin calculate the rotation matrix from + // first to the second + // + // Inputs: + // v0 3D column vector + // v1 3D column vector + // Output: + // 3 by 3 rotation matrix that takes v0 to v1 + // + template + IGL_INLINE Eigen::Matrix rotation_matrix_from_directions( + const Eigen::Matrix v0, + const Eigen::Matrix v1); +} + +#ifndef IGL_STATIC_LIBRARY +#include "rotation_matrix_from_directions.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/round.cpp b/vendor/libigl/include/igl/round.cpp new file mode 100644 index 0000000000000000000000000000000000000000..acde47316bc80eba01863a2c27f324bd0b22d289 --- /dev/null +++ b/vendor/libigl/include/igl/round.cpp @@ -0,0 +1,49 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "round.h" +#include + + +// http://stackoverflow.com/a/485549 +template +IGL_INLINE DerivedX igl::round(const DerivedX r) +{ + return (r > 0.0) ? std::floor(r + 0.5) : std::ceil(r - 0.5); +} + +template < typename DerivedX, typename DerivedY> +IGL_INLINE void igl::round( + const Eigen::PlainObjectBase& X, + Eigen::PlainObjectBase& Y) +{ + Y.resizeLike(X); + // loop over rows + for(int i = 0;i, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::round, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::round, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::round, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::round, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::round, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::round, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/sample_edges.cpp b/vendor/libigl/include/igl/sample_edges.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a20df14261b8043177fd1e0cd66f4f2f0e4a3e74 --- /dev/null +++ b/vendor/libigl/include/igl/sample_edges.cpp @@ -0,0 +1,33 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "sample_edges.h" + +IGL_INLINE void igl::sample_edges( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & E, + const int k, + Eigen::MatrixXd & S) +{ + using namespace Eigen; + // Resize output + S.resize(V.rows() + k * E.rows(),V.cols()); + // Copy V at front of S + S.block(0,0,V.rows(),V.cols()) = V; + + // loop over edges + for(int i = 0;i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "scalar_to_cr_vector_gradient.h" + +#include "orient_halfedges.h" + +#include "doublearea.h" +#include "squared_edge_lengths.h" + + +template +IGL_INLINE void +igl::scalar_to_cr_vector_gradient( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const Eigen::MatrixBase& E, + const Eigen::MatrixBase& oE, + Eigen::SparseMatrix& G) +{ + Eigen::Matrix + l_sq; + squared_edge_lengths(V, F, l_sq); + scalar_to_cr_vector_gradient_intrinsic(F, l_sq, E, oE, G); +} + +template +IGL_INLINE void +igl::scalar_to_cr_vector_gradient( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + Eigen::PlainObjectBase& E, + Eigen::PlainObjectBase& oE, + Eigen::SparseMatrix& G) +{ + if(E.rows()!=F.rows() || E.cols()!=F.cols() || oE.rows()!=F.rows() || + oE.cols()!=F.cols()) { + orient_halfedges(F, E, oE); + } + + const Eigen::PlainObjectBase& cE = E; + const Eigen::PlainObjectBase& coE = oE; + + scalar_to_cr_vector_gradient(V, F, cE, coE, G); +} + + +template +IGL_INLINE void +igl::scalar_to_cr_vector_gradient_intrinsic( + const Eigen::MatrixBase& F, + const Eigen::MatrixBase& l_sq, + const Eigen::MatrixBase& E, + const Eigen::MatrixBase& oE, + Eigen::SparseMatrix& G) +{ + Eigen::Matrix + dA; + DerivedL_sq l_sqrt = l_sq.array().sqrt().matrix(); + doublearea(l_sqrt, dA); + scalar_to_cr_vector_gradient_intrinsic(F, l_sq, dA, E, oE, G); +} + + +template +IGL_INLINE void +igl::scalar_to_cr_vector_gradient_intrinsic( + const Eigen::MatrixBase& F, + const Eigen::MatrixBase& l_sq, + const Eigen::MatrixBase& dA, + const Eigen::MatrixBase& E, + const Eigen::MatrixBase& oE, + Eigen::SparseMatrix& G) +{ + assert(F.cols()==3 && "Faces have three vertices"); + assert(E.rows()==F.rows() && E.cols()==F.cols() && oE.rows()==F.rows() && + oE.cols()==F.cols() && "Wrong dimension in edge vectors"); + + const Eigen::Index m = F.rows(); + const typename DerivedF::Scalar n = F.maxCoeff() + 1; + const typename DerivedE::Scalar nE = E.maxCoeff() + 1; + + std::vector > tripletList; + tripletList.reserve(5*3*m); + for(Eigen::Index f=0; f, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, double>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::SparseMatrix&); +#endif diff --git a/vendor/libigl/include/igl/seam_edges.h b/vendor/libigl/include/igl/seam_edges.h new file mode 100644 index 0000000000000000000000000000000000000000..15c82826cfe01e2a3b022f27294ab4e55b895a3a --- /dev/null +++ b/vendor/libigl/include/igl/seam_edges.h @@ -0,0 +1,64 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Yotam Gingold +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_SEAM_EDGES_H +#define IGL_SEAM_EDGES_H +#include "igl_inline.h" +#include +namespace igl +{ + // Finds all UV-space boundaries of a mesh. + // + // Inputs: + // V #V by dim list of positions of the input mesh. + // TC #TC by 2 list of 2D texture coordinates of the input mesh + // F #F by 3 list of triange indices into V representing a + // manifold-with-boundary triangle mesh + // FTC #F by 3 list of indices into TC for each corner + // Outputs: + // seams Edges where the forwards and backwards directions have different + // texture coordinates, as a #seams-by-4 matrix of indices. Each row is + // organized as [ forward_face_index, forward_face_vertex_index, + // backwards_face_index, backwards_face_vertex_index ] such that one side + // of the seam is the edge: + // F[ seams( i, 0 ), seams( i, 1 ) ], F[ seams( i, 0 ), (seams( i, 1 ) + 1) % 3 ] + // and the other side is the edge: + // F[ seams( i, 2 ), seams( i, 3 ) ], F[ seams( i, 2 ), (seams( i, 3 ) + 1) % 3 ] + // boundaries Edges with only one incident triangle, as a #boundaries-by-2 + // matrix of indices. Each row is organized as + // [ face_index, face_vertex_index ] + // such that the edge is: + // F[ boundaries( i, 0 ), boundaries( i, 1 ) ], F[ boundaries( i, 0 ), (boundaries( i, 1 ) + 1) % 3 ] + // foldovers Edges where the two incident triangles fold over each other + // in UV-space, as a #foldovers-by-4 matrix of indices. + // Each row is organized as [ forward_face_index, forward_face_vertex_index, + // backwards_face_index, backwards_face_vertex_index ] + // such that one side of the foldover is the edge: + // F[ foldovers( i, 0 ), foldovers( i, 1 ) ], F[ foldovers( i, 0 ), (foldovers( i, 1 ) + 1) % 3 ] + // and the other side is the edge: + // F[ foldovers( i, 2 ), foldovers( i, 3 ) ], F[ foldovers( i, 2 ), (foldovers( i, 3 ) + 1) % 3 ] + template < + typename DerivedV, + typename DerivedTC, + typename DerivedF, + typename DerivedFTC, + typename Derivedseams, + typename Derivedboundaries, + typename Derivedfoldovers> + IGL_INLINE void seam_edges( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& TC, + const Eigen::PlainObjectBase& F, + const Eigen::PlainObjectBase& FTC, + Eigen::PlainObjectBase& seams, + Eigen::PlainObjectBase& boundaries, + Eigen::PlainObjectBase& foldovers); +} +#ifndef IGL_STATIC_LIBRARY +# include "seam_edges.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/setxor.cpp b/vendor/libigl/include/igl/setxor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dde66f207bd8a933c77a8cc6b2444e0da3c73850 --- /dev/null +++ b/vendor/libigl/include/igl/setxor.cpp @@ -0,0 +1,33 @@ +#include "setxor.h" +#include "setdiff.h" +#include "setunion.h" +#include "slice.h" + +template < + typename DerivedA, + typename DerivedB, + typename DerivedC, + typename DerivedIA, + typename DerivedIB> +IGL_INLINE void igl::setxor( + const Eigen::MatrixBase & A, + const Eigen::MatrixBase & B, + Eigen::PlainObjectBase & C, + Eigen::PlainObjectBase & IA, + Eigen::PlainObjectBase & IB) +{ + DerivedC AB,BA; + DerivedIA IAB,IBA; + setdiff(A,B,AB,IAB); + setdiff(B,A,BA,IBA); + setunion(AB,BA,C,IA,IB); + slice(IAB,DerivedIA(IA),IA); + slice(IBA,DerivedIB(IB),IB); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::setxor, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::setxor, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/slice.cpp b/vendor/libigl/include/igl/slice.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0a0d1bcdda5251fcc30cc2b7663b0d813f4d775f --- /dev/null +++ b/vendor/libigl/include/igl/slice.cpp @@ -0,0 +1,268 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "slice.h" +#include "colon.h" + +#include + +template < + typename TX, + typename TY, + typename DerivedR, + typename DerivedC> +IGL_INLINE void igl::slice( + const Eigen::SparseMatrix &X, + const Eigen::DenseBase &R, + const Eigen::DenseBase &C, + Eigen::SparseMatrix &Y) +{ + int xm = X.rows(); + int xn = X.cols(); + int ym = R.size(); + int yn = C.size(); + + // special case when R or C is empty + if (ym == 0 || yn == 0) + { + Y.resize(ym, yn); + return; + } + + assert(R.minCoeff() >= 0); + assert(R.maxCoeff() < xm); + assert(C.minCoeff() >= 0); + assert(C.maxCoeff() < xn); + + // Build reindexing maps for columns and rows + std::vector> RI; + RI.resize(xm); + for (int i = 0; i < ym; i++) + { + RI[R(i)].push_back(i); + } + std::vector> CI; + CI.resize(xn); + for (int i = 0; i < yn; i++) + { + CI[C(i)].push_back(i); + } + + // Take a guess at the number of nonzeros (this assumes uniform distribution + // not banded or heavily diagonal) + std::vector> entries; + entries.reserve((X.nonZeros()/(X.rows()*X.cols())) * (ym*yn)); + + // Iterate over outside + for (int k = 0; k < X.outerSize(); ++k) + { + // Iterate over inside + for (typename Eigen::SparseMatrix::InnerIterator it(X, k); it; ++it) + { + for (auto rit = RI[it.row()].begin(); rit != RI[it.row()].end(); rit++) + { + for (auto cit = CI[it.col()].begin(); cit != CI[it.col()].end(); cit++) + { + entries.emplace_back(*rit, *cit, it.value()); + } + } + } + } + Y.resize(ym, yn); + Y.setFromTriplets(entries.begin(), entries.end()); +} + +template +IGL_INLINE void igl::slice( + const MatX &X, + const Eigen::DenseBase &R, + const int dim, + MatY &Y) +{ + Eigen::Matrix C; + switch (dim) + { + case 1: + // boring base case + if (X.cols() == 0) + { + Y.resize(R.size(), 0); + return; + } + igl::colon(0, X.cols() - 1, C); + return slice(X, R, C, Y); + case 2: + // boring base case + if (X.rows() == 0) + { + Y.resize(0, R.size()); + return; + } + igl::colon(0, X.rows() - 1, C); + return slice(X, C, R, Y); + default: + assert(false && "Unsupported dimension"); + return; + } +} + +template < + typename DerivedX, + typename DerivedR, + typename DerivedC, + typename DerivedY> +IGL_INLINE void igl::slice( + const Eigen::DenseBase &X, + const Eigen::DenseBase &R, + const Eigen::DenseBase &C, + Eigen::PlainObjectBase &Y) +{ +#ifndef NDEBUG + int xm = X.rows(); + int xn = X.cols(); +#endif + int ym = R.size(); + int yn = C.size(); + + // special case when R or C is empty + if (ym == 0 || yn == 0) + { + Y.resize(ym, yn); + return; + } + + assert(R.minCoeff() >= 0); + assert(R.maxCoeff() < xm); + assert(C.minCoeff() >= 0); + assert(C.maxCoeff() < xn); + + // Resize output + Y.resize(ym, yn); + // loop over output rows, then columns + for (int i = 0; i < ym; i++) + { + for (int j = 0; j < yn; j++) + { + Y(i, j) = X(R(i, 0), C(j, 0)); + } + } +} + +template +IGL_INLINE void igl::slice( + const Eigen::DenseBase &X, + const Eigen::DenseBase &R, + Eigen::PlainObjectBase &Y) +{ + // phony column indices + Eigen::Matrix C; + C.resize(1); + C(0) = 0; + return igl::slice(X, R, C, Y); +} + +template +IGL_INLINE DerivedX igl::slice( + const Eigen::DenseBase &X, + const Eigen::DenseBase &R) +{ + DerivedX Y; + igl::slice(X, R, Y); + return Y; +} + +template +IGL_INLINE DerivedX igl::slice( + const Eigen::DenseBase &X, + const Eigen::DenseBase &R, + const int dim) +{ + DerivedX Y; + igl::slice(X, R, dim, Y); + return Y; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template Eigen::Matrix igl::slice, Eigen::Matrix >(Eigen::DenseBase > const&, Eigen::DenseBase > const&); +template Eigen::Matrix igl::slice, Eigen::Matrix >(Eigen::DenseBase > const&, Eigen::DenseBase > const&); +// generated by autoexplicit.sh +template void igl::slice, Eigen::Block, -1, 1, true>, Eigen::Matrix >(Eigen::Matrix const&, Eigen::DenseBase, -1, 1, true> > const&, int, Eigen::Matrix&); +// generated by autoexplicit.sh +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::DenseBase > const&, Eigen::DenseBase > const&, Eigen::DenseBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::slice, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::DenseBase > const&, int, Eigen::Matrix&); +// generated by autoexplicit.sh +template void igl::slice, Eigen::Block, -1, 1, true>, Eigen::Matrix >(Eigen::Matrix const&, Eigen::DenseBase, -1, 1, true> > const&, int, Eigen::Matrix&); +// generated by autoexplicit.sh +template void igl::slice const, -1>, Eigen::Block, -1, 1, true>, Eigen::Matrix >(Eigen::VectorBlock const, -1> const&, Eigen::DenseBase, -1, 1, true> > const&, int, Eigen::Matrix&); +// generated by autoexplicit.sh +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::DenseBase > const&, Eigen::DenseBase > const&, Eigen::DenseBase > const&, Eigen::PlainObjectBase >&); +template Eigen::Matrix igl::slice, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, int); +template Eigen::Matrix igl::slice, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &); +template Eigen::Matrix igl::slice, Eigen::Matrix >(Eigen::DenseBase > const&, Eigen::DenseBase > const&, int); +template void igl::slice, Eigen::Matrix, Eigen::Array >(Eigen::Array const&, Eigen::DenseBase > const&, int, Eigen::Array&); +template void igl::slice, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix>(Eigen::Matrix const &, Eigen::DenseBase> const &, int, Eigen::Matrix &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::PlainObjectBase>>(Eigen::Matrix const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::DenseBase > const&, int, Eigen::Matrix&); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::DenseBase > const&, Eigen::DenseBase > const&, Eigen::DenseBase > const&, Eigen::PlainObjectBase >&); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::DenseBase > const&, int, Eigen::Matrix&); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::DenseBase > const&, int, Eigen::Matrix&); +template void igl::slice, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::PlainObjectBase>>(Eigen::Matrix const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Block const, -1, 1, true>>(Eigen::DenseBase> const &, Eigen::DenseBase const, -1, 1, true>> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix>(Eigen::DenseBase> const &, Eigen::DenseBase> const &, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::Matrix>(Eigen::Matrix const &, Eigen::DenseBase> const &, int, Eigen::Matrix &); +template void igl::slice, Eigen::Matrix, Eigen::PlainObjectBase>>(Eigen::Matrix const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::PlainObjectBase>>(Eigen::Matrix const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice >, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::Matrix&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::Matrix&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::Matrix&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::PlainObjectBase > >(Eigen::MatrixBase > const&, Eigen::DenseBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice >, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::DenseBase > const&, int, Eigen::Matrix&); +template void igl::slice>, Eigen::Matrix, Eigen::PlainObjectBase>>(Eigen::PlainObjectBase> const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice>, Eigen::Matrix, Eigen::PlainObjectBase>>(Eigen::PlainObjectBase> const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice>, Eigen::Matrix, Eigen::PlainObjectBase>>(Eigen::PlainObjectBase> const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice>, Eigen::Matrix, Eigen::PlainObjectBase>>(Eigen::PlainObjectBase> const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice, Eigen::Matrix, Eigen::SparseMatrix>(Eigen::SparseMatrix const &, Eigen::DenseBase> const &, int, Eigen::SparseMatrix &); +template void igl::slice, Eigen::Array, Eigen::SparseMatrix >(Eigen::SparseMatrix const&, Eigen::DenseBase > const&, int, Eigen::SparseMatrix&); +template void igl::slice, Eigen::Matrix, Eigen::SparseMatrix>(Eigen::SparseMatrix const &, Eigen::DenseBase> const &, int, Eigen::SparseMatrix &); +template void igl::slice, Eigen::Matrix, Eigen::SparseMatrix>(Eigen::SparseMatrix const &, Eigen::DenseBase> const &, int, Eigen::SparseMatrix &); +template void igl::slice, Eigen::Matrix, Eigen::SparseMatrix>(Eigen::SparseMatrix const &, Eigen::DenseBase> const &, int, Eigen::SparseMatrix &); + +#ifdef WIN32 +template void igl::slice >,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::PlainObjectBase > >(class Eigen::DenseBase > const &,class Eigen::DenseBase > const &,int,class Eigen::PlainObjectBase > &); +template void igl::slice >,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::PlainObjectBase > >(class Eigen::MatrixBase > const &,class Eigen::DenseBase > const &,int,class Eigen::PlainObjectBase > &); +template void igl::slice, Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, Eigen::PlainObjectBase>>(Eigen::Matrix<__int64, -1, 1, 0, -1, 1> const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +template void igl::slice>, Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, Eigen::PlainObjectBase>>(Eigen::PlainObjectBase> const &, Eigen::DenseBase> const &, int, Eigen::PlainObjectBase> &); +#endif + +#endif diff --git a/vendor/libigl/include/igl/slice_into.cpp b/vendor/libigl/include/igl/slice_into.cpp new file mode 100644 index 0000000000000000000000000000000000000000..733ef67d38ef689d47533a16948330352087739e --- /dev/null +++ b/vendor/libigl/include/igl/slice_into.cpp @@ -0,0 +1,141 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "slice_into.h" +#include "colon.h" + +// Bug in unsupported/Eigen/SparseExtra needs iostream first +#include +#include + +template +IGL_INLINE void igl::slice_into( + const Eigen::SparseMatrix& X, + const Eigen::MatrixBase & R, + const Eigen::MatrixBase & C, + Eigen::SparseMatrix& Y) +{ + +#ifndef NDEBUG + int xm = X.rows(); + int xn = X.cols(); + assert(R.size() == xm); + assert(C.size() == xn); + int ym = Y.rows(); + int yn = Y.cols(); + assert(R.minCoeff() >= 0); + assert(R.maxCoeff() < ym); + assert(C.minCoeff() >= 0); + assert(C.maxCoeff() < yn); +#endif + + // create temporary dynamic sparse matrix + Eigen::DynamicSparseMatrix dyn_Y(Y); + // Iterate over outside + for(int k=0; k::InnerIterator it (X,k); it; ++it) + { + dyn_Y.coeffRef(R(it.row()),C(it.col())) = it.value(); + } + } + Y = Eigen::SparseMatrix(dyn_Y); +} + +template +IGL_INLINE void igl::slice_into( + const Eigen::MatrixBase & X, + const Eigen::MatrixBase & R, + const Eigen::MatrixBase & C, + Eigen::PlainObjectBase & Y) +{ + + int xm = X.rows(); + int xn = X.cols(); +#ifndef NDEBUG + assert(R.size() == xm); + assert(C.size() == xn); + int ym = Y.rows(); + int yn = Y.cols(); + assert(R.minCoeff() >= 0); + assert(R.maxCoeff() < ym); + assert(C.minCoeff() >= 0); + assert(C.maxCoeff() < yn); +#endif + + // Build reindexing maps for columns and rows, -1 means not in map + Eigen::Matrix RI; + RI.resize(xm); + for(int i = 0;i +IGL_INLINE void igl::slice_into( + const MatX & X, + const Eigen::MatrixBase & R, + const int dim, + MatY& Y) +{ + Eigen::Matrix C; + switch(dim) + { + case 1: + assert(R.size() == X.rows()); + // boring base case + if(X.cols() == 0) + { + return; + } + igl::colon(0,X.cols()-1,C); + return slice_into(X,R,C,Y); + case 2: + assert(R.size() == X.cols()); + // boring base case + if(X.rows() == 0) + { + return; + } + igl::colon(0,X.rows()-1,C); + return slice_into(X,C,R,Y); + default: + assert(false && "Unsupported dimension"); + return; + } +} + +template +IGL_INLINE void igl::slice_into( + const Eigen::MatrixBase & X, + const Eigen::MatrixBase & R, + Eigen::PlainObjectBase & Y) +{ + // phony column indices + Eigen::Matrix C; + C.resize(1); + C(0) = 0; + return igl::slice_into(X,R,C,Y); +} + +#ifdef IGL_STATIC_LIBRARY +template void igl::slice_into, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::slice_into, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::slice_into >(Eigen::SparseMatrix const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::SparseMatrix&); +template void igl::slice_into, Eigen::PlainObjectBase >, Eigen::Matrix >(Eigen::Matrix const&, Eigen::MatrixBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice_into, Eigen::PlainObjectBase >, Eigen::Matrix >(Eigen::Matrix const&, Eigen::MatrixBase > const&, int, Eigen::PlainObjectBase >&); +template void igl::slice_into, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::MatrixBase > const&, int, Eigen::Matrix&); +template void igl::slice_into, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::MatrixBase > const&, int, Eigen::Matrix&); +template void igl::slice_into, Eigen::SparseMatrix, Eigen::Matrix >(Eigen::SparseMatrix const&, Eigen::MatrixBase > const&, int, Eigen::SparseMatrix&); +template void igl::slice_into, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::slice_into, Eigen::Matrix, Eigen::MatrixWrapper > >(Eigen::Matrix const&, Eigen::MatrixBase > > const&, int, Eigen::Matrix&); +#endif diff --git a/vendor/libigl/include/igl/snap_to_canonical_view_quat.cpp b/vendor/libigl/include/igl/snap_to_canonical_view_quat.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9fb01724c5b62c40b8c965f1147301dc7443e3c8 --- /dev/null +++ b/vendor/libigl/include/igl/snap_to_canonical_view_quat.cpp @@ -0,0 +1,117 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "snap_to_canonical_view_quat.h" + +#include "canonical_quaternions.h" +#include "normalize_quat.h" + +#include +#include + +// Note: For the canonical view quaternions it should be completely possible to +// determine this anaylitcally. That is the max_distance should be a +// theoretical known value +// Also: I'm not sure it matters in this case, but. We are dealing with +// quaternions on the 4d unit sphere, but measuring distance in general 4d +// space (i.e. not geodesics on the sphere). Probably something with angles +// would be better. +template +IGL_INLINE bool igl::snap_to_canonical_view_quat( + const Q_type* q, + const Q_type threshold, + Q_type* s) +{ + // Copy input into output + // CANNOT use std::copy here according to: + // http://www.cplusplus.com/reference/algorithm/copy/ + s[0] = q[0]; + s[1] = q[1]; + s[2] = q[2]; + s[3] = q[3]; + + // Normalize input quaternion + Q_type qn[4]; + bool valid_len = + igl::normalize_quat(q,qn); + // If normalizing valid then don't bother + if(!valid_len) + { + return false; + } + + // 0.290019 + const Q_type MAX_DISTANCE = 0.4; + Q_type min_distance = 2*MAX_DISTANCE; + int min_index = -1; + double min_sign = 0; + // loop over canonical view quaternions + for(double sign = -1;sign<=1;sign+=2) + { + for(int i = 0; i(i,j))* + (qn[j]-sign*igl::CANONICAL_VIEW_QUAT(i,j)); + } + if(min_distance > distance) + { + min_distance = distance; + min_index = i; + min_sign = sign; + } + } + } + + if(MAX_DISTANCE < min_distance) + { + fprintf( + stderr, + "ERROR: found new max MIN_DISTANCE: %g\n" + "PLEASE update snap_to_canonical_quat()", + min_distance); + } + + assert(min_distance < MAX_DISTANCE); + assert(min_index >= 0); + + if( min_distance/MAX_DISTANCE <= threshold) + { + // loop over coordinates + for(int j = 0;j<4;j++) + { + s[j] = min_sign*igl::CANONICAL_VIEW_QUAT(min_index,j); + } + return true; + } + return false; +} + +template +IGL_INLINE bool igl::snap_to_canonical_view_quat( + const Eigen::Quaternion & q, + const double threshold, + Eigen::Quaternion & s) +{ + return snap_to_canonical_view_quat( + q.coeffs().data(),threshold,s.coeffs().data()); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::snap_to_canonical_view_quat(const double*, double, double*); +// generated by autoexplicit.sh +template bool igl::snap_to_canonical_view_quat(const float*, float, float*); +template bool igl::snap_to_canonical_view_quat(Eigen::Quaternion const&, double, Eigen::Quaternion&); +template bool igl::snap_to_canonical_view_quat(Eigen::Quaternion const&, double, Eigen::Quaternion&); +#endif diff --git a/vendor/libigl/include/igl/sortrows.h b/vendor/libigl/include/igl/sortrows.h new file mode 100644 index 0000000000000000000000000000000000000000..a1e5db77f603612864a883b879b8018212974d8b --- /dev/null +++ b/vendor/libigl/include/igl/sortrows.h @@ -0,0 +1,47 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_SORTROWS_H +#define IGL_SORTROWS_H +#include "igl_inline.h" + +#include +#include +namespace igl +{ + // Act like matlab's [Y,I] = sortrows(X) + // + // Templates: + // DerivedX derived scalar type, e.g. MatrixXi or MatrixXd + // DerivedI derived integer type, e.g. MatrixXi + // Inputs: + // X m by n matrix whose entries are to be sorted + // ascending sort ascending (true, matlab default) or descending (false) + // Outputs: + // Y m by n matrix whose entries are sorted (**should not** be same + // reference as X) + // I m list of indices so that + // Y = X(I,:); + template + IGL_INLINE void sortrows( + const Eigen::DenseBase& X, + const bool ascending, + Eigen::PlainObjectBase& Y, + Eigen::PlainObjectBase& I); + template + IGL_INLINE void sortrows( + const Eigen::DenseBase& X, + const bool ascending, + Eigen::PlainObjectBase& Y); +} + +#ifndef IGL_STATIC_LIBRARY +# include "sortrows.cpp" +#endif + +#endif + diff --git a/vendor/libigl/include/igl/sparse_cached.h b/vendor/libigl/include/igl/sparse_cached.h new file mode 100644 index 0000000000000000000000000000000000000000..c5a66c99fdc9859ef546003ebbb4fba0cef8b16e --- /dev/null +++ b/vendor/libigl/include/igl/sparse_cached.h @@ -0,0 +1,85 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2017 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_SPARSE_CACHED_H +#define IGL_SPARSE_CACHED_H +#include "igl_inline.h" +#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET +#include +#include +namespace igl +{ + // Build a sparse matrix from list of indices and values (I,J,V), similarly to + // the sparse function in matlab. Divides the construction in two phases, one + // for fixing the sparsity pattern, and one to populate it with values. Compared to + // igl::sparse, this version is slower for the first time (since it requires a + // precomputation), but faster to the subsequent evaluations. + // + // Templates: + // IndexVector list of indices, value should be non-negative and should + // expect to be cast to an index. Must implement operator(i) to retrieve + // ith element + // ValueVector list of values, value should be expect to be cast to type + // T. Must implement operator(i) to retrieve ith element + // T should be a eigen sparse matrix primitive type like int or double + // Input: + // I nnz vector of row indices of non zeros entries in X + // J nnz vector of column indices of non zeros entries in X + // V nnz vector of non-zeros entries in X + // Optional: + // m number of rows + // n number of cols + // Outputs: + // X m by n matrix of type T whose entries are to be found + // + // Example: + // Eigen::SparseMatrix A; + // std::vector > IJV; + // slim_buildA(IJV); + // if (A.rows() == 0) + // { + // A = Eigen::SparseMatrix(rows,cols); + // igl::sparse_cached_precompute(IJV,A,A_data); + // } + // else + // igl::sparse_cached(IJV,s.A,s.A_data); + + template + IGL_INLINE void sparse_cached_precompute( + const Eigen::MatrixBase & I, + const Eigen::MatrixBase & J, + Eigen::VectorXi& data, + Eigen::SparseMatrix& X + ); + + template + IGL_INLINE void sparse_cached_precompute( + const std::vector >& triplets, + Eigen::VectorXi& data, + Eigen::SparseMatrix& X + ); + + template + IGL_INLINE void sparse_cached( + const std::vector >& triplets, + const Eigen::VectorXi& data, + Eigen::SparseMatrix& X); + + template + IGL_INLINE void sparse_cached( + const Eigen::MatrixBase& V, + const Eigen::VectorXi& data, + Eigen::SparseMatrix& X + ); + +} + +#ifndef IGL_STATIC_LIBRARY +# include "sparse_cached.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/sparse_voxel_grid.cpp b/vendor/libigl/include/igl/sparse_voxel_grid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c88883ad840b428e6f30cf90777b36909d44aa06 --- /dev/null +++ b/vendor/libigl/include/igl/sparse_voxel_grid.cpp @@ -0,0 +1,202 @@ +#include "sparse_voxel_grid.h" + +#include +#include +#include + + +template +IGL_INLINE void igl::sparse_voxel_grid(const Eigen::MatrixBase& p0, + const Func& scalarFunc, + const double eps, + const int expected_number_of_cubes, + Eigen::PlainObjectBase& CS, + Eigen::PlainObjectBase& CV, + Eigen::PlainObjectBase& CI) +{ + typedef typename DerivedV::Scalar ScalarV; + typedef typename DerivedS::Scalar ScalarS; + typedef typename DerivedI::Scalar ScalarI; + typedef Eigen::Matrix VertexRowVector; + typedef Eigen::Matrix IndexRowVector; + + + struct IndexRowVectorHash { + std::size_t operator()(const Eigen::RowVector3i& key) const { + std::size_t seed = 0; + std::hash hasher; + for (int i = 0; i < 3; i++) { + seed ^= hasher(key[i]) + 0x9e3779b9 + (seed<<6) + (seed>>2); // Copied from boost::hash_combine + } + return seed; + } + }; + + auto sgn = [](ScalarS val) -> int { + return (ScalarS(0) < val) - (val < ScalarS(0)); + }; + + ScalarV half_eps = 0.5 * eps; + + std::vector CI_vector; + std::vector CV_vector; + std::vector CS_vector; + CI_vector.reserve(expected_number_of_cubes); + CV_vector.reserve(8 * expected_number_of_cubes); + CS_vector.reserve(8 * expected_number_of_cubes); + + // Track visisted neighbors + std::unordered_map visited; + visited.reserve(6 * expected_number_of_cubes); + visited.max_load_factor(0.5); + + // BFS Queue + std::vector queue; + queue.reserve(expected_number_of_cubes * 8); + queue.push_back(Eigen::RowVector3i(0, 0, 0)); + + while (queue.size() > 0) + { + Eigen::RowVector3i pi = queue.back(); + queue.pop_back(); + if(visited.count(pi)){ continue; } + + VertexRowVector ctr = p0 + eps*pi.cast(); // R^3 center of this cube + + // X, Y, Z basis vectors, and array of neighbor offsets used to construct cubes + const Eigen::RowVector3i bx(1, 0, 0), by(0, 1, 0), bz(0, 0, -1); + const std::array neighbors = { + bx, -bx, by, -by, bz, -bz, + by-bz, -by+bz, // 1-2 4-7 + bx+by, -bx-by, // 0-1 7-6 + by+bz, -by-bz, // 0-3 6-5 + by-bx, -by+bx, // 2-3 5-4 + bx-bz, -bx+bz, // 1-5 3-7 + bx+bz, -bx-bz, // 0-4 2-6 + -bx+by+bz, bx-by-bz, // 3 5 + bx+by+bz, -bx-by-bz, // 0 6 + bx+by-bz, -bx-by+bz, //1 7 + -bx+by-bz, bx-by+bz, // 2 4, + }; + + // Compute the position of the cube corners and the scalar values at those corners + // + // Cube corners are ordered y-x-z, so their xyz offsets are: + // + // +++ + // ++- + // -+- + // -++ + // +-+ + // +-- + // --- + // --+ + std::array cubeCorners = { + ctr+half_eps*(bx+by+bz).cast(), ctr+half_eps*(bx+by-bz).cast(), ctr+half_eps*(-bx+by-bz).cast(), ctr+half_eps*(-bx+by+bz).cast(), + ctr+half_eps*(bx-by+bz).cast(), ctr+half_eps*(bx-by-bz).cast(), ctr+half_eps*(-bx-by-bz).cast(), ctr+half_eps*(-bx-by+bz).cast() + }; + std::array cubeScalars; + for (int i = 0; i < 8; i++) { cubeScalars[i] = scalarFunc(cubeCorners[i]); } + + // If this cube doesn't intersect the surface, disregard it + bool validCube = false; + int sign = sgn(cubeScalars[0]); + for (int i = 1; i < 8; i++) { + if (sign != sgn(cubeScalars[i])) { + validCube = true; + break; + } + } + if (!validCube) { + continue; + } + + // Add the cube vertices and indices to the output arrays if they are not there already + IndexRowVector cube; + uint8_t vertexAlreadyAdded = 0; // This is a bimask. If a bit is 1, it has been visited already by the BFS + constexpr std::array zv = { + (1 << 0) | (1 << 1) | (1 << 4) | (1 << 5), + (1 << 2) | (1 << 3) | (1 << 6) | (1 << 7), + (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3), + (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7), + (1 << 0) | (1 << 3) | (1 << 4) | (1 << 7), + (1 << 1) | (1 << 2) | (1 << 5) | (1 << 6), + (1 << 1) | (1 << 2), + (1 << 4) | (1 << 7), + (1 << 0) | (1 << 1), + (1 << 6) | (1 << 7), + (1 << 0) | (1 << 3), + (1 << 5) | (1 << 6), + (1 << 2) | (1 << 3), + (1 << 4) | (1 << 5), + (1 << 1) | (1 << 5), + (1 << 3) | (1 << 7), + (1 << 0) | (1 << 4), + (1 << 2) | (1 << 6), + (1 << 3), (1 << 5), // diagonals + (1 << 0), (1 << 6), + (1 << 1), (1 << 7), + (1 << 2), (1 << 4), + }; + constexpr std::array, 26> zvv {{ + {{0, 1, 4, 5}}, {{3, 2, 7, 6}}, {{0, 1, 2, 3}}, + {{4, 5, 6, 7}}, {{0, 3, 4, 7}}, {{1, 2, 5, 6}}, + {{-1,-1,1,2}}, {{-1,-1,4,7}}, {{-1,-1,0,1}},{{-1,-1,7,6}}, + {{-1,-1,0,3}}, {{-1,-1,5,6}}, {{-1,-1,2,3}}, {{-1,-1,5,4}}, + {{-1,-1,1,5}}, {{-1,-1,3,7}}, {{-1,-1,0,4}}, {{-1,-1,2,6}}, + {{-1,-1,-1,3}}, {{-1,-1,-1,5}}, {{-1,-1,-1,0}}, {{-1,-1,-1,6}}, + {{-1,-1,-1,1}}, {{-1,-1,-1,7}}, {{-1,-1,-1,2}}, {{-1,-1,-1,4}} }}; + + for (int n = 0; n < 26; n++) { // For each neighbor, check the hash table to see if its been added before + Eigen::RowVector3i nkey = pi + neighbors[n]; + auto nbr = visited.find(nkey); + if (nbr != visited.end()) { // We've already visited this neighbor, use references to its vertices instead of duplicating them + vertexAlreadyAdded |= zv[n]; + for (int i = 0; i < 4; i++) + { + if (zvv[n][i]!=-1) + { + cube[zvv[n][i]] = CI_vector[nbr->second][zvv[n % 2 == 0 ? n + 1 : n - 1][i]]; + } + } + } else { + queue.push_back(nkey); // Otherwise, we have not visited the neighbor, put it in the BFS queue + } + } + + for (int i = 0; i < 8; i++) { // Add new, non-visited,2 vertices to the arrays + if (0 == ((1 << i) & vertexAlreadyAdded)) { + cube[i] = CS_vector.size(); + CV_vector.push_back(cubeCorners[i]); + CS_vector.push_back(cubeScalars[i]); + } + } + + visited[pi] = CI_vector.size(); + CI_vector.push_back(cube); + } + + CV.conservativeResize(CV_vector.size(), 3); + CS.conservativeResize(CS_vector.size(), 1); + CI.conservativeResize(CI_vector.size(), 8); + // If you pass in column-major matrices, this is going to be slooooowwwww + for (int i = 0; i < CV_vector.size(); i++) { + CV.row(i) = CV_vector[i]; + } + for (int i = 0; i < CS_vector.size(); i++) { + CS(i) = CS_vector[i]; + } + for (int i = 0; i < CI_vector.size(); i++) { + CI.row(i) = CI_vector[i]; + } +} + + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::sparse_voxel_grid, std::function const&)>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, std::function const&)> const&, double, int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::sparse_voxel_grid, class std::function const &)>, class Eigen::Matrix, class Eigen::Matrix, class Eigen::Matrix >(class Eigen::MatrixBase > const &, class std::function const &)> const &, double, int, class Eigen::PlainObjectBase > &, class Eigen::PlainObjectBase > &, class Eigen::PlainObjectBase > &); +template void igl::sparse_voxel_grid, std::function const&)>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, std::function const&)> const&, double, int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::sparse_voxel_grid, std::function const&)>, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, std::function const&)> const&, double, int, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/speye.cpp b/vendor/libigl/include/igl/speye.cpp new file mode 100644 index 0000000000000000000000000000000000000000..54af00c71bb76c154dbb97fabc2f862e583d2c84 --- /dev/null +++ b/vendor/libigl/include/igl/speye.cpp @@ -0,0 +1,35 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "speye.h" + +template +IGL_INLINE void igl::speye(const int m, const int n, Eigen::SparseMatrix & I) +{ + // size of diagonal + int d = (m(m,n); + I.reserve(d); + for(int i = 0;i +IGL_INLINE void igl::speye(const int n, Eigen::SparseMatrix & I) +{ + return igl::speye(n,n,I); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::speye(int, Eigen::SparseMatrix&); +template void igl::speye >(int, int, Eigen::SparseMatrix, 0, int>&); +#endif diff --git a/vendor/libigl/include/igl/speye.h b/vendor/libigl/include/igl/speye.h new file mode 100644 index 0000000000000000000000000000000000000000..4c2425571300be613a6cbd096b85cd578e83f7ff --- /dev/null +++ b/vendor/libigl/include/igl/speye.h @@ -0,0 +1,42 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_SPEYE_H +#define IGL_SPEYE_H +#include "igl_inline.h" + +#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET +#include + +namespace igl +{ + // Builds an m by n sparse identity matrix like matlab's speye function + // Templates: + // T should be a eigen sparse matrix primitive type like int or double + // Inputs: + // m number of rows + // n number of cols + // Outputs: + // I m by n sparse matrix with 1's on the main diagonal + template + IGL_INLINE void speye(const int n,const int m, Eigen::SparseMatrix & I); + // Builds an n by n sparse identity matrix like matlab's speye function + // Templates: + // T should be a eigen sparse matrix primitive type like int or double + // Inputs: + // n number of rows and cols + // Outputs: + // I n by n sparse matrix with 1's on the main diagonal + template + IGL_INLINE void speye(const int n, Eigen::SparseMatrix & I); +} + +#ifndef IGL_STATIC_LIBRARY +# include "speye.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/svd3x3.cpp b/vendor/libigl/include/igl/svd3x3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dd65e0cf3e60f7836f77aa11343d01f703825c73 --- /dev/null +++ b/vendor/libigl/include/igl/svd3x3.cpp @@ -0,0 +1,69 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "svd3x3.h" + +#include +#include + +#define USE_SCALAR_IMPLEMENTATION +#undef USE_SSE_IMPLEMENTATION +#undef USE_AVX_IMPLEMENTATION +#define COMPUTE_U_AS_MATRIX +#define COMPUTE_V_AS_MATRIX +#include "Singular_Value_Decomposition_Preamble.hpp" + +#pragma runtime_checks( "u", off ) // disable runtime asserts on xor eax,eax type of stuff (doesn't always work, disable explicitly in compiler settings) +template +IGL_INLINE void igl::svd3x3(const Eigen::Matrix& A, Eigen::Matrix &U, Eigen::Matrix &S, Eigen::Matrix&V) +{ + // this code only supports the scalar version (otherwise we'd need to pass arrays of matrices) + +#include "Singular_Value_Decomposition_Kernel_Declarations.hpp" + + ENABLE_SCALAR_IMPLEMENTATION(Sa11.f=A(0,0);) ENABLE_SSE_IMPLEMENTATION(Va11=_mm_loadu_ps(a11);) ENABLE_AVX_IMPLEMENTATION(Va11=_mm256_loadu_ps(a11);) + ENABLE_SCALAR_IMPLEMENTATION(Sa21.f=A(1,0);) ENABLE_SSE_IMPLEMENTATION(Va21=_mm_loadu_ps(a21);) ENABLE_AVX_IMPLEMENTATION(Va21=_mm256_loadu_ps(a21);) + ENABLE_SCALAR_IMPLEMENTATION(Sa31.f=A(2,0);) ENABLE_SSE_IMPLEMENTATION(Va31=_mm_loadu_ps(a31);) ENABLE_AVX_IMPLEMENTATION(Va31=_mm256_loadu_ps(a31);) + ENABLE_SCALAR_IMPLEMENTATION(Sa12.f=A(0,1);) ENABLE_SSE_IMPLEMENTATION(Va12=_mm_loadu_ps(a12);) ENABLE_AVX_IMPLEMENTATION(Va12=_mm256_loadu_ps(a12);) + ENABLE_SCALAR_IMPLEMENTATION(Sa22.f=A(1,1);) ENABLE_SSE_IMPLEMENTATION(Va22=_mm_loadu_ps(a22);) ENABLE_AVX_IMPLEMENTATION(Va22=_mm256_loadu_ps(a22);) + ENABLE_SCALAR_IMPLEMENTATION(Sa32.f=A(2,1);) ENABLE_SSE_IMPLEMENTATION(Va32=_mm_loadu_ps(a32);) ENABLE_AVX_IMPLEMENTATION(Va32=_mm256_loadu_ps(a32);) + ENABLE_SCALAR_IMPLEMENTATION(Sa13.f=A(0,2);) ENABLE_SSE_IMPLEMENTATION(Va13=_mm_loadu_ps(a13);) ENABLE_AVX_IMPLEMENTATION(Va13=_mm256_loadu_ps(a13);) + ENABLE_SCALAR_IMPLEMENTATION(Sa23.f=A(1,2);) ENABLE_SSE_IMPLEMENTATION(Va23=_mm_loadu_ps(a23);) ENABLE_AVX_IMPLEMENTATION(Va23=_mm256_loadu_ps(a23);) + ENABLE_SCALAR_IMPLEMENTATION(Sa33.f=A(2,2);) ENABLE_SSE_IMPLEMENTATION(Va33=_mm_loadu_ps(a33);) ENABLE_AVX_IMPLEMENTATION(Va33=_mm256_loadu_ps(a33);) + +#include "Singular_Value_Decomposition_Main_Kernel_Body.hpp" + + ENABLE_SCALAR_IMPLEMENTATION(U(0,0)=Su11.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u11,Vu11);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u11,Vu11);) + ENABLE_SCALAR_IMPLEMENTATION(U(1,0)=Su21.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u21,Vu21);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u21,Vu21);) + ENABLE_SCALAR_IMPLEMENTATION(U(2,0)=Su31.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u31,Vu31);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u31,Vu31);) + ENABLE_SCALAR_IMPLEMENTATION(U(0,1)=Su12.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u12,Vu12);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u12,Vu12);) + ENABLE_SCALAR_IMPLEMENTATION(U(1,1)=Su22.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u22,Vu22);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u22,Vu22);) + ENABLE_SCALAR_IMPLEMENTATION(U(2,1)=Su32.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u32,Vu32);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u32,Vu32);) + ENABLE_SCALAR_IMPLEMENTATION(U(0,2)=Su13.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u13,Vu13);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u13,Vu13);) + ENABLE_SCALAR_IMPLEMENTATION(U(1,2)=Su23.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u23,Vu23);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u23,Vu23);) + ENABLE_SCALAR_IMPLEMENTATION(U(2,2)=Su33.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u33,Vu33);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u33,Vu33);) + + ENABLE_SCALAR_IMPLEMENTATION(V(0,0)=Sv11.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v11,Vv11);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v11,Vv11);) + ENABLE_SCALAR_IMPLEMENTATION(V(1,0)=Sv21.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v21,Vv21);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v21,Vv21);) + ENABLE_SCALAR_IMPLEMENTATION(V(2,0)=Sv31.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v31,Vv31);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v31,Vv31);) + ENABLE_SCALAR_IMPLEMENTATION(V(0,1)=Sv12.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v12,Vv12);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v12,Vv12);) + ENABLE_SCALAR_IMPLEMENTATION(V(1,1)=Sv22.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v22,Vv22);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v22,Vv22);) + ENABLE_SCALAR_IMPLEMENTATION(V(2,1)=Sv32.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v32,Vv32);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v32,Vv32);) + ENABLE_SCALAR_IMPLEMENTATION(V(0,2)=Sv13.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v13,Vv13);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v13,Vv13);) + ENABLE_SCALAR_IMPLEMENTATION(V(1,2)=Sv23.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v23,Vv23);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v23,Vv23);) + ENABLE_SCALAR_IMPLEMENTATION(V(2,2)=Sv33.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v33,Vv33);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v33,Vv33);) + + ENABLE_SCALAR_IMPLEMENTATION(S(0,0)=Sa11.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma1,Va11);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma1,Va11);) + ENABLE_SCALAR_IMPLEMENTATION(S(1,0)=Sa22.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma2,Va22);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma2,Va22);) + ENABLE_SCALAR_IMPLEMENTATION(S(2,0)=Sa33.f;) ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma3,Va33);) ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma3,Va33);) +} +#pragma runtime_checks( "u", restore ) + +// forced instantiation +template void igl::svd3x3(const Eigen::Matrix& A, Eigen::Matrix &U, Eigen::Matrix &S, Eigen::Matrix&V); +template void igl::svd3x3(Eigen::Matrix const&, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&); +// doesn't even make sense with double because this SVD code is only single precision anyway... diff --git a/vendor/libigl/include/igl/swept_volume_signed_distance.h b/vendor/libigl/include/igl/swept_volume_signed_distance.h new file mode 100644 index 0000000000000000000000000000000000000000..86074fb6749cea69ae6041030dd52af09f076b26 --- /dev/null +++ b/vendor/libigl/include/igl/swept_volume_signed_distance.h @@ -0,0 +1,64 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_SWEPT_VOLUME_SIGNED_DISTANCE_H +#define IGL_SWEPT_VOLUME_SIGNED_DISTANCE_H +#include "igl_inline.h" +#include +#include +#include +namespace igl +{ + // Compute the signed distance to a sweep surface of a mesh under-going + // an arbitrary motion V(t) discretely sampled at `steps`-many moments in + // time at a grid. + // + // Inputs: + // V #V by 3 list of mesh positions in reference pose + // F #F by 3 list of triangle indices [0,n) + // transform function handle so that transform(t) returns the rigid + // transformation at time t∈[0,1] + // steps number of time steps: steps=3 --> t∈{0,0.5,1} + // GV #GV by 3 list of evaluation point grid positions + // res 3-long resolution of GV grid + // h edge-length of grid + // isolevel isolevel to "focus" on; grid positions far enough away from + // isolevel (based on h) will get approximate values). Set + // isolevel=infinity to get good values everywhere (slow and + // unnecessary if just trying to extract isolevel-level set). + // S0 #GV initial values (will take minimum with these), can be same + // as S) + // Outputs: + // S #GV list of signed distances + IGL_INLINE void swept_volume_signed_distance( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const std::function & transform, + const size_t & steps, + const Eigen::MatrixXd & GV, + const Eigen::RowVector3i & res, + const double h, + const double isolevel, + const Eigen::VectorXd & S0, + Eigen::VectorXd & S); + IGL_INLINE void swept_volume_signed_distance( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const std::function & transform, + const size_t & steps, + const Eigen::MatrixXd & GV, + const Eigen::RowVector3i & res, + const double h, + const double isolevel, + Eigen::VectorXd & S); + } + +#ifndef IGL_STATIC_LIBRARY +# include "swept_volume_signed_distance.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/triangle/cdt.cpp b/vendor/libigl/include/igl/triangle/cdt.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cbe1b3e1a12cc5708650a301fd0395dab7884964 --- /dev/null +++ b/vendor/libigl/include/igl/triangle/cdt.cpp @@ -0,0 +1,58 @@ +#include "cdt.h" +#include "../bounding_box.h" +#include "../triangle/triangulate.h" +#include "../remove_duplicate_vertices.h" +#include "../remove_unreferenced.h" +#include "../slice_mask.h" + +template < + typename DerivedV, + typename DerivedE, + typename DerivedWV, + typename DerivedWF, + typename DerivedWE, + typename DerivedJ> +IGL_INLINE void igl::triangle::cdt( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & E, + const std::string & flags, + Eigen::PlainObjectBase & WV, + Eigen::PlainObjectBase & WF, + Eigen::PlainObjectBase & WE, + Eigen::PlainObjectBase & J) +{ + assert(V.cols() == 2); + assert(E.cols() == 2); + typedef typename DerivedV::Scalar Scalar; + typedef Eigen::Matrix MatrixX2S; + //MatrixX2S BV; + //Eigen::MatrixXi BE; + //igl::bounding_box(V,BV,BE); + //WV.resize(V.rows()+BV.rows(),2); + //WV<, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::triangle::cdt, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/triangle/cdt.h b/vendor/libigl/include/igl/triangle/cdt.h new file mode 100644 index 0000000000000000000000000000000000000000..9f513e8533e6de3eb504909d980e3bc7b647983a --- /dev/null +++ b/vendor/libigl/include/igl/triangle/cdt.h @@ -0,0 +1,54 @@ +#ifndef IGL_TRIANGLE_CDT_H +#define IGL_TRIANGLE_CDT_H + +#include "../igl_inline.h" +#include + +namespace igl +{ + namespace triangle + { + // CDT Construct the constrained delaunay triangulation of the convex hull + // of a given set of points and segments in 2D. This differs from a direct + // call to triangulate because it will preprocess the input to remove + // duplicates and return an adjusted segment list on the output. + // + // + // BACKGROUND_MESH Construct a background mesh for a (messy) texture mesh with + // cosntraint edges that are about to deform. + // + // Inputs: + // V #V by 2 list of texture mesh vertices + // E #E by 2 list of constraint edge indices into V + // flags string of triangle flags should contain "-c" unless the + // some subset of segments are known to enclose all other + // points/segments. + // Outputs: + // WV #WV by 2 list of background mesh vertices + // WF #WF by 2 list of background mesh triangle indices into WV + // WE #WE by 2 list of constraint edge indices into WV (might be smaller + // than E because degenerate constraints have been removed) + // J #V list of indices into WF/WE for each vertex in V + // + template < + typename DerivedV, + typename DerivedE, + typename DerivedWV, + typename DerivedWF, + typename DerivedWE, + typename DerivedJ> + IGL_INLINE void cdt( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & E, + const std::string & flags, + Eigen::PlainObjectBase & WV, + Eigen::PlainObjectBase & WF, + Eigen::PlainObjectBase & WE, + Eigen::PlainObjectBase & J); + } +} + +#ifndef IGL_STATIC_LIBRARY +#include "cdt.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/triangle/scaf.cpp b/vendor/libigl/include/igl/triangle/scaf.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5341858b4a1a16c0e9f4453eb1167a540f1b7220 --- /dev/null +++ b/vendor/libigl/include/igl/triangle/scaf.cpp @@ -0,0 +1,730 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Zhongshi Jiang +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "scaf.h" +#include "triangulate.h" + +#include +#include +#include +#include +#include +#include "../PI.h" +#include "../Timer.h" +#include "../boundary_loop.h" +#include "../cat.h" +#include "../doublearea.h" +#include "../flip_avoiding_line_search.h" +#include "../flipped_triangles.h" +#include "../grad.h" +#include "../harmonic.h" +#include "../local_basis.h" +#include "../map_vertices_to_circle.h" +#include "../polar_svd.h" +#include "../slice.h" +#include "../slice_into.h" +#include "../slim.h" +#include "../mapping_energy_with_jacobians.h" + +#include +#include +#include +#include +namespace igl +{ +namespace triangle +{ +namespace scaf +{ +IGL_INLINE void update_scaffold(igl::triangle::SCAFData &s) +{ + s.mv_num = s.m_V.rows(); + s.mf_num = s.m_T.rows(); + + s.v_num = s.w_uv.rows(); + s.sf_num = s.s_T.rows(); + + s.sv_num = s.v_num - s.mv_num; + s.f_num = s.sf_num + s.mf_num; + + s.s_M = Eigen::VectorXd::Constant(s.sf_num, s.scaffold_factor); +} + +IGL_INLINE void adjusted_grad(Eigen::MatrixXd &V, + Eigen::MatrixXi &F, + double area_threshold, + Eigen::SparseMatrix &Dx, + Eigen::SparseMatrix &Dy, + Eigen::SparseMatrix &Dz) +{ + Eigen::VectorXd M; + igl::doublearea(V, F, M); + std::vector degen; + for (int i = 0; i < M.size(); i++) + if (M(i) < area_threshold) + degen.push_back(i); + + Eigen::SparseMatrix G; + igl::grad(V, F, G); + + Dx = G.topRows(F.rows()); + Dy = G.block(F.rows(), 0, F.rows(), V.rows()); + Dz = G.bottomRows(F.rows()); + + // handcraft uniform gradient for faces area falling below threshold. + double sin60 = std::sin(igl::PI / 3); + double cos60 = std::cos(igl::PI / 3); + double deno = std::sqrt(sin60 * area_threshold); + Eigen::MatrixXd standard_grad(3, 3); + standard_grad << -sin60 / deno, sin60 / deno, 0, + -cos60 / deno, -cos60 / deno, 1 / deno, + 0, 0, 0; + + for (auto k : degen) + for (int j = 0; j < 3; j++) + { + Dx.coeffRef(k, F(k, j)) = standard_grad(0, j); + Dy.coeffRef(k, F(k, j)) = standard_grad(1, j); + Dz.coeffRef(k, F(k, j)) = standard_grad(2, j); + } +} + +IGL_INLINE void compute_scaffold_gradient_matrix(SCAFData &s, + Eigen::SparseMatrix &D1, + Eigen::SparseMatrix &D2) +{ + using namespace Eigen; + Eigen::SparseMatrix G; + MatrixXi F_s = s.s_T; + int vn = s.v_num; + MatrixXd V = MatrixXd::Zero(vn, 3); + V.leftCols(2) = s.w_uv; + + double min_bnd_edge_len = INFINITY; + int acc_bnd = 0; + for (int i = 0; i < s.bnd_sizes.size(); i++) + { + int current_size = s.bnd_sizes[i]; + + for (int e = acc_bnd; e < acc_bnd + current_size - 1; e++) + { + min_bnd_edge_len = (std::min)(min_bnd_edge_len, + (s.w_uv.row(s.internal_bnd(e)) - + s.w_uv.row(s.internal_bnd(e + 1))) + .squaredNorm()); + } + min_bnd_edge_len = (std::min)(min_bnd_edge_len, + (s.w_uv.row(s.internal_bnd(acc_bnd)) - + s.w_uv.row(s.internal_bnd(acc_bnd + current_size - 1))) + .squaredNorm()); + acc_bnd += current_size; + } + + double area_threshold = min_bnd_edge_len / 4.0; + Eigen::SparseMatrix Dx, Dy, Dz; + adjusted_grad(V, F_s, area_threshold, Dx, Dy, Dz); + + MatrixXd F1, F2, F3; + igl::local_basis(V, F_s, F1, F2, F3); + D1 = F1.col(0).asDiagonal() * Dx + F1.col(1).asDiagonal() * Dy + + F1.col(2).asDiagonal() * Dz; + D2 = F2.col(0).asDiagonal() * Dx + F2.col(1).asDiagonal() * Dy + + F2.col(2).asDiagonal() * Dz; +} + +IGL_INLINE void mesh_improve(igl::triangle::SCAFData &s) +{ + using namespace Eigen; + MatrixXd m_uv = s.w_uv.topRows(s.mv_num); + MatrixXd V_bnd; + V_bnd.resize(s.internal_bnd.size(), 2); + for (int i = 0; i < s.internal_bnd.size(); i++) // redoing step 1. + { + V_bnd.row(i) = m_uv.row(s.internal_bnd(i)); + } + + if (s.rect_frame_V.size() == 0) + { + Matrix2d ob; // = rect_corners; + { + VectorXd uv_max = m_uv.colwise().maxCoeff(); + VectorXd uv_min = m_uv.colwise().minCoeff(); + VectorXd uv_mid = (uv_max + uv_min) / 2.; + + Eigen::Array2d scaf_range(3, 3); + ob.row(0) = uv_mid.array() + scaf_range * ((uv_min - uv_mid).array()); + ob.row(1) = uv_mid.array() + scaf_range * ((uv_max - uv_mid).array()); + } + Vector2d rect_len; + rect_len << ob(1, 0) - ob(0, 0), ob(1, 1) - ob(0, 1); + int frame_points = 5; + + s.rect_frame_V.resize(4 * frame_points, 2); + for (int i = 0; i < frame_points; i++) + { + // 0,0;0,1 + s.rect_frame_V.row(i) << ob(0, 0), ob(0, 1) + i * rect_len(1) / frame_points; + // 0,0;1,1 + s.rect_frame_V.row(i + frame_points) + << ob(0, 0) + i * rect_len(0) / frame_points, + ob(1, 1); + // 1,0;1,1 + s.rect_frame_V.row(i + 2 * frame_points) << ob(1, 0), ob(1, 1) - i * rect_len(1) / frame_points; + // 1,0;0,1 + s.rect_frame_V.row(i + 3 * frame_points) + << ob(1, 0) - i * rect_len(0) / frame_points, + ob(0, 1); + // 0,0;0,1 + } + s.frame_ids = Eigen::VectorXi::LinSpaced(s.rect_frame_V.rows(), s.mv_num, s.mv_num + s.rect_frame_V.rows()); + } + + // Concatenate Vert and Edge + MatrixXd V; + MatrixXi E; + igl::cat(1, V_bnd, s.rect_frame_V, V); + E.resize(V.rows(), 2); + for (int i = 0; i < E.rows(); i++) + E.row(i) << i, i + 1; + int acc_bs = 0; + for (auto bs : s.bnd_sizes) + { + E(acc_bs + bs - 1, 1) = acc_bs; + acc_bs += bs; + } + E(V.rows() - 1, 1) = acc_bs; + assert(acc_bs == s.internal_bnd.size()); + + MatrixXd H = MatrixXd::Zero(s.component_sizes.size(), 2); + { + int hole_f = 0; + int hole_i = 0; + for (auto cs : s.component_sizes) + { + for (int i = 0; i < 3; i++) + H.row(hole_i) += m_uv.row(s.m_T(hole_f, i)); // redoing step 2 + hole_f += cs; + hole_i++; + } + } + H /= 3.; + + MatrixXd uv2; + igl::triangle::triangulate(V, E, H, std::basic_string("qYYQ"), uv2, s.s_T); + auto bnd_n = s.internal_bnd.size(); + + for (auto i = 0; i < s.s_T.rows(); i++) + for (auto j = 0; j < s.s_T.cols(); j++) + { + auto &x = s.s_T(i, j); + if (x < bnd_n) + x = s.internal_bnd(x); + else + x += m_uv.rows() - bnd_n; + } + + igl::cat(1, s.m_T, s.s_T, s.w_T); + s.w_uv.conservativeResize(m_uv.rows() - bnd_n + uv2.rows(), 2); + s.w_uv.bottomRows(uv2.rows() - bnd_n) = uv2.bottomRows(-bnd_n + uv2.rows()); + + update_scaffold(s); + + // after_mesh_improve + compute_scaffold_gradient_matrix(s, s.Dx_s, s.Dy_s); + + s.Dx_s.makeCompressed(); + s.Dy_s.makeCompressed(); + s.Dz_s.makeCompressed(); + s.Ri_s = MatrixXd::Zero(s.Dx_s.rows(), s.dim * s.dim); + s.Ji_s.resize(s.Dx_s.rows(), s.dim * s.dim); + s.W_s.resize(s.Dx_s.rows(), s.dim * s.dim); +} + +IGL_INLINE void add_new_patch(igl::triangle::SCAFData &s, const Eigen::MatrixXd &V_ref, + const Eigen::MatrixXi &F_ref, + const Eigen::RowVectorXd ¢er, + const Eigen::MatrixXd &uv_init) +{ + using namespace std; + using namespace Eigen; + + assert(uv_init.rows() != 0); + Eigen::VectorXd M; + igl::doublearea(V_ref, F_ref, M); + s.mesh_measure += M.sum() / 2; + + Eigen::VectorXi bnd; + Eigen::MatrixXd bnd_uv; + + std::vector> all_bnds; + igl::boundary_loop(F_ref, all_bnds); + int num_holes = all_bnds.size() - 1; + + s.component_sizes.push_back(F_ref.rows()); + + MatrixXd m_uv = s.w_uv.topRows(s.mv_num); + igl::cat(1, m_uv, uv_init, s.w_uv); + + s.m_M.conservativeResize(s.mf_num + M.size()); + s.m_M.bottomRows(M.size()) = M / 2; + + for (auto cur_bnd : all_bnds) + { + s.internal_bnd.conservativeResize(s.internal_bnd.size() + cur_bnd.size()); + s.internal_bnd.bottomRows(cur_bnd.size()) = Map(cur_bnd.data(), cur_bnd.size()) + s.mv_num; + s.bnd_sizes.push_back(cur_bnd.size()); + } + + s.m_T.conservativeResize(s.mf_num + F_ref.rows(), 3); + s.m_T.bottomRows(F_ref.rows()) = F_ref.array() + s.mv_num; + s.mf_num += F_ref.rows(); + + s.m_V.conservativeResize(s.mv_num + V_ref.rows(), 3); + s.m_V.bottomRows(V_ref.rows()) = V_ref; + s.mv_num += V_ref.rows(); + + s.rect_frame_V = MatrixXd(); + + mesh_improve(s); +} + +IGL_INLINE void compute_jacobians(SCAFData &s, const Eigen::MatrixXd &V_new, bool whole) +{ + auto comp_J2 = [](const Eigen::MatrixXd &uv, + const Eigen::SparseMatrix &Dx, + const Eigen::SparseMatrix &Dy, + Eigen::MatrixXd &Ji) { + // Ji=[D1*u,D2*u,D1*v,D2*v]; + Ji.resize(Dx.rows(), 4); + Ji.col(0) = Dx * uv.col(0); + Ji.col(1) = Dy * uv.col(0); + Ji.col(2) = Dx * uv.col(1); + Ji.col(3) = Dy * uv.col(1); + }; + + Eigen::MatrixXd m_V_new = V_new.topRows(s.mv_num); + comp_J2(m_V_new, s.Dx_m, s.Dy_m, s.Ji_m); + if (whole) + comp_J2(V_new, s.Dx_s, s.Dy_s, s.Ji_s); +} + +IGL_INLINE double compute_energy_from_jacobians(const Eigen::MatrixXd &Ji, + const Eigen::VectorXd &areas, + igl::MappingEnergyType energy_type) +{ + double energy = 0; + if (energy_type == igl::MappingEnergyType::SYMMETRIC_DIRICHLET) + energy = -4; // comply with paper description + return energy + igl::mapping_energy_with_jacobians(Ji, areas, energy_type, 0); +} + +IGL_INLINE double compute_soft_constraint_energy(const SCAFData &s) +{ + double e = 0; + for (auto const &x : s.soft_cons) + e += s.soft_const_p * (x.second - s.w_uv.row(x.first)).squaredNorm(); + + return e; +} + +IGL_INLINE double compute_energy(SCAFData &s, const Eigen::MatrixXd &w_uv, bool whole) +{ + if (w_uv.rows() != s.v_num) + assert(!whole); + compute_jacobians(s, w_uv, whole); + double energy = compute_energy_from_jacobians(s.Ji_m, s.m_M, s.slim_energy); + + if (whole) + energy += compute_energy_from_jacobians(s.Ji_s, s.s_M, s.scaf_energy); + energy += compute_soft_constraint_energy(s); + return energy; +} + +IGL_INLINE void buildAm(const Eigen::VectorXd &sqrt_M, + const Eigen::SparseMatrix &Dx, + const Eigen::SparseMatrix &Dy, + const Eigen::MatrixXd &W, + Eigen::SparseMatrix &Am) +{ + std::vector> IJV; + Eigen::SparseMatrix Dz; + + Eigen::SparseMatrix MDx = sqrt_M.asDiagonal() * Dx; + Eigen::SparseMatrix MDy = sqrt_M.asDiagonal() * Dy; + igl::slim_buildA(MDx, MDy, Dz, W, IJV); + + Am.setFromTriplets(IJV.begin(), IJV.end()); + Am.makeCompressed(); +} + +IGL_INLINE void buildRhs(const Eigen::VectorXd &sqrt_M, + const Eigen::MatrixXd &W, + const Eigen::MatrixXd &Ri, + Eigen::VectorXd &f_rhs) +{ + const int dim = (W.cols() == 4) ? 2 : 3; + const int f_n = W.rows(); + f_rhs.resize(dim * dim * f_n); + + for (int i = 0; i < f_n; i++) + { + auto sqrt_area = sqrt_M(i); + f_rhs(i + 0 * f_n) = sqrt_area * (W(i, 0) * Ri(i, 0) + W(i, 1) * Ri(i, 1)); + f_rhs(i + 1 * f_n) = sqrt_area * (W(i, 0) * Ri(i, 2) + W(i, 1) * Ri(i, 3)); + f_rhs(i + 2 * f_n) = sqrt_area * (W(i, 2) * Ri(i, 0) + W(i, 3) * Ri(i, 1)); + f_rhs(i + 3 * f_n) = sqrt_area * (W(i, 2) * Ri(i, 2) + W(i, 3) * Ri(i, 3)); + } +} + +IGL_INLINE void get_complement(const Eigen::VectorXi &bnd_ids, int v_n, Eigen::ArrayXi &unknown_ids) +{ // get the complement of bnd_ids. + int assign = 0, i = 0; + for (int get = 0; i < v_n && get < bnd_ids.size(); i++) + { + if (bnd_ids(get) == i) + get++; + else + unknown_ids(assign++) = i; + } + while (i < v_n) + unknown_ids(assign++) = i++; + assert(assign + bnd_ids.size() == v_n); +} + +IGL_INLINE void build_surface_linear_system(const SCAFData &s, Eigen::SparseMatrix &L, Eigen::VectorXd &rhs) +{ + using namespace Eigen; + using namespace std; + + const int v_n = s.v_num - (s.frame_ids.size()); + const int dim = s.dim; + const int f_n = s.mf_num; + + // to get the complete A + Eigen::VectorXd sqrtM = s.m_M.array().sqrt(); + Eigen::SparseMatrix A(dim * dim * f_n, dim * v_n); + auto decoy_Dx_m = s.Dx_m; + decoy_Dx_m.conservativeResize(s.W_m.rows(), v_n); + auto decoy_Dy_m = s.Dy_m; + decoy_Dy_m.conservativeResize(s.W_m.rows(), v_n); + buildAm(sqrtM, decoy_Dx_m, decoy_Dy_m, s.W_m, A); + + const VectorXi &bnd_ids = s.fixed_ids; + auto bnd_n = bnd_ids.size(); + if (bnd_n == 0) + { + + Eigen::SparseMatrix At = A.transpose(); + At.makeCompressed(); + + Eigen::SparseMatrix id_m(At.rows(), At.rows()); + id_m.setIdentity(); + + L = At * A; + + Eigen::VectorXd frhs; + buildRhs(sqrtM, s.W_m, s.Ri_m, frhs); + rhs = At * frhs; + } + else + { + MatrixXd bnd_pos; + igl::slice(s.w_uv, bnd_ids, 1, bnd_pos); + ArrayXi known_ids(bnd_ids.size() * dim); + ArrayXi unknown_ids((v_n - bnd_ids.rows()) * dim); + get_complement(bnd_ids, v_n, unknown_ids); + VectorXd known_pos(bnd_ids.size() * dim); + for (int d = 0; d < dim; d++) + { + auto n_b = bnd_ids.rows(); + known_ids.segment(d * n_b, n_b) = bnd_ids.array() + d * v_n; + known_pos.segment(d * n_b, n_b) = bnd_pos.col(d); + unknown_ids.block(d * (v_n - n_b), 0, v_n - n_b, unknown_ids.cols()) = + unknown_ids.topRows(v_n - n_b) + d * v_n; + } + + Eigen::SparseMatrix Au, Ae; + igl::slice(A, unknown_ids, 2, Au); + igl::slice(A, known_ids, 2, Ae); + + Eigen::SparseMatrix Aut = Au.transpose(); + Aut.makeCompressed(); + + L = Aut * Au; + + Eigen::VectorXd frhs; + buildRhs(sqrtM, s.W_m, s.Ri_m, frhs); + + rhs = Aut * (frhs - Ae * known_pos); + } + + // add soft constraints. + for (auto const &x : s.soft_cons) + { + int v_idx = x.first; + + for (int d = 0; d < dim; d++) + { + rhs(d * (v_n) + v_idx) += s.soft_const_p * x.second(d); // rhs + L.coeffRef(d * v_n + v_idx, + d * v_n + v_idx) += s.soft_const_p; // diagonal + } + } +} + +IGL_INLINE void build_scaffold_linear_system(const SCAFData &s, Eigen::SparseMatrix &L, Eigen::VectorXd &rhs) +{ + using namespace Eigen; + + const int f_n = s.W_s.rows(); + const int v_n = s.Dx_s.cols(); + const int dim = s.dim; + + Eigen::VectorXd sqrtM = s.s_M.array().sqrt(); + Eigen::SparseMatrix A(dim * dim * f_n, dim * v_n); + buildAm(sqrtM, s.Dx_s, s.Dy_s, s.W_s, A); + + VectorXi bnd_ids; + igl::cat(1, s.fixed_ids, s.frame_ids, bnd_ids); + + auto bnd_n = bnd_ids.size(); + assert(bnd_n > 0); + MatrixXd bnd_pos; + igl::slice(s.w_uv, bnd_ids, 1, bnd_pos); + + ArrayXi known_ids(bnd_ids.size() * dim); + ArrayXi unknown_ids((v_n - bnd_ids.rows()) * dim); + + get_complement(bnd_ids, v_n, unknown_ids); + + VectorXd known_pos(bnd_ids.size() * dim); + for (int d = 0; d < dim; d++) + { + auto n_b = bnd_ids.rows(); + known_ids.segment(d * n_b, n_b) = bnd_ids.array() + d * v_n; + known_pos.segment(d * n_b, n_b) = bnd_pos.col(d); + unknown_ids.block(d * (v_n - n_b), 0, v_n - n_b, unknown_ids.cols()) = + unknown_ids.topRows(v_n - n_b) + d * v_n; + } + Eigen::VectorXd sqrt_M = s.s_M.array().sqrt(); + + // manual slicing for A(:, unknown/known)' + Eigen::SparseMatrix Au, Ae; + igl::slice(A, unknown_ids, 2, Au); + igl::slice(A, known_ids, 2, Ae); + + Eigen::SparseMatrix Aut = Au.transpose(); + Aut.makeCompressed(); + + L = Aut * Au; + + Eigen::VectorXd frhs; + buildRhs(sqrtM, s.W_s, s.Ri_s, frhs); + + rhs = Aut * (frhs - Ae * known_pos); +} + +IGL_INLINE void build_weighted_arap_system(SCAFData &s, Eigen::SparseMatrix &L, Eigen::VectorXd &rhs) +{ + // fixed frame solving: + // x_e as the fixed frame, x_u for unknowns (mesh + unknown scaffold) + // min ||(A_u*x_u + A_e*x_e) - b||^2 + // => A_u'*A_u*x_u = Au'* (b - A_e*x_e) := Au'* b_u + // + // separate matrix build: + // min ||A_m x_m - b_m||^2 + ||A_s x_all - b_s||^2 + soft + proximal + // First change dimension of A_m to fit for x_all + // (Not just at the end, since x_all is flattened along dimensions) + // L = A_m'*A_m + A_s'*A_s + soft + proximal + // rhs = A_m'* b_m + A_s' * b_s + soft + proximal + // + Eigen::SparseMatrix L_m, L_s; + Eigen::VectorXd rhs_m, rhs_s; + build_surface_linear_system(s, L_m, rhs_m); // complete Am, with soft + build_scaffold_linear_system(s, L_s, rhs_s); // complete As, without proximal + + L = L_m + L_s; + rhs = rhs_m + rhs_s; + L.makeCompressed(); +} + +IGL_INLINE void solve_weighted_arap(SCAFData &s, Eigen::MatrixXd &uv) +{ + using namespace Eigen; + using namespace std; + int dim = s.dim; + igl::Timer timer; + timer.start(); + + VectorXi bnd_ids; + igl::cat(1, s.fixed_ids, s.frame_ids, bnd_ids); + const auto v_n = s.v_num; + const auto bnd_n = bnd_ids.size(); + assert(bnd_n > 0); + MatrixXd bnd_pos; + igl::slice(s.w_uv, bnd_ids, 1, bnd_pos); + + ArrayXi known_ids(bnd_n * dim); + ArrayXi unknown_ids((v_n - bnd_n) * dim); + + get_complement(bnd_ids, v_n, unknown_ids); + + VectorXd known_pos(bnd_ids.size() * dim); + for (int d = 0; d < dim; d++) + { + auto n_b = bnd_ids.rows(); + known_ids.segment(d * n_b, n_b) = bnd_ids.array() + d * v_n; + known_pos.segment(d * n_b, n_b) = bnd_pos.col(d); + unknown_ids.block(d * (v_n - n_b), 0, v_n - n_b, unknown_ids.cols()) = + unknown_ids.topRows(v_n - n_b) + d * v_n; + } + + Eigen::SparseMatrix L; + Eigen::VectorXd rhs; + build_weighted_arap_system(s, L, rhs); + + Eigen::VectorXd unknown_Uc((v_n - s.frame_ids.size() - s.fixed_ids.size()) * dim), Uc(dim * v_n); + + SimplicialLDLT> solver; + unknown_Uc = solver.compute(L).solve(rhs); + igl::slice_into(unknown_Uc, unknown_ids.matrix(), 1, Uc); + igl::slice_into(known_pos, known_ids.matrix(), 1, Uc); + + uv = Map>(Uc.data(), v_n, dim); +} + +IGL_INLINE double perform_iteration(SCAFData &s) +{ + Eigen::MatrixXd V_out = s.w_uv; + compute_jacobians(s, V_out, true); + igl::slim_update_weights_and_closest_rotations_with_jacobians(s.Ji_m, s.slim_energy, 0, s.W_m, s.Ri_m); + igl::slim_update_weights_and_closest_rotations_with_jacobians(s.Ji_s, s.scaf_energy, 0, s.W_s, s.Ri_s); + solve_weighted_arap(s, V_out); + std::function whole_E = [&s](Eigen::MatrixXd &uv) { return compute_energy(s, uv, true); }; + + Eigen::MatrixXi w_T; + if (s.m_T.cols() == s.s_T.cols()) + igl::cat(1, s.m_T, s.s_T, w_T); + else + w_T = s.s_T; + return igl::flip_avoiding_line_search( w_T, s.w_uv, V_out, whole_E, -1) / + s.mesh_measure; +} + +} +} +} + +IGL_INLINE void igl::triangle::scaf_precompute( + const Eigen::MatrixXd &V, + const Eigen::MatrixXi &F, + const Eigen::MatrixXd &V_init, + igl::triangle::SCAFData &data, + igl::MappingEnergyType slim_energy, + Eigen::VectorXi &b, + Eigen::MatrixXd &bc, + double soft_p) +{ + Eigen::MatrixXd CN; + Eigen::MatrixXi FN; + igl::triangle::scaf::add_new_patch(data, V, F, Eigen::RowVector2d(0, 0), V_init); + data.soft_const_p = soft_p; + for (int i = 0; i < b.rows(); i++) + data.soft_cons[b(i)] = bc.row(i); + data.slim_energy = slim_energy; + + auto &s = data; + + if (!data.has_pre_calc) + { + int v_n = s.mv_num + s.sv_num; + int f_n = s.mf_num + s.sf_num; + int dim = s.dim; + Eigen::MatrixXd F1, F2, F3; + igl::local_basis(s.m_V, s.m_T, F1, F2, F3); + auto face_proj = [](Eigen::MatrixXd& F){ + std::vector >IJV; + int f_num = F.rows(); + for(int i=0; i(i, i, F(i,0))); + IJV.push_back(Eigen::Triplet(i, i+f_num, F(i,1))); + IJV.push_back(Eigen::Triplet(i, i+2*f_num, F(i,2))); + } + Eigen::SparseMatrix P(f_num, 3*f_num); + P.setFromTriplets(IJV.begin(), IJV.end()); + return P; + }; + Eigen::SparseMatrix G; + igl::grad(s.m_V, s.m_T, G); + s.Dx_m = face_proj(F1) * G; + s.Dy_m = face_proj(F2) * G; + + igl::triangle::scaf::compute_scaffold_gradient_matrix(s, s.Dx_s, s.Dy_s); + + s.Dx_m.makeCompressed(); + s.Dy_m.makeCompressed(); + s.Ri_m = Eigen::MatrixXd::Zero(s.Dx_m.rows(), dim * dim); + s.Ji_m.resize(s.Dx_m.rows(), dim * dim); + s.W_m.resize(s.Dx_m.rows(), dim * dim); + + s.Dx_s.makeCompressed(); + s.Dy_s.makeCompressed(); + s.Ri_s = Eigen::MatrixXd::Zero(s.Dx_s.rows(), dim * dim); + s.Ji_s.resize(s.Dx_s.rows(), dim * dim); + s.W_s.resize(s.Dx_s.rows(), dim * dim); + + data.has_pre_calc = true; + } +} + +IGL_INLINE Eigen::MatrixXd igl::triangle::scaf_solve(igl::triangle::SCAFData &s, int iter_num) +{ + using namespace std; + using namespace Eigen; + s.energy = igl::triangle::scaf::compute_energy(s, s.w_uv, false) / s.mesh_measure; + + for (int it = 0; it < iter_num; it++) + { + s.total_energy = igl::triangle::scaf::compute_energy(s, s.w_uv, true) / s.mesh_measure; + s.rect_frame_V = Eigen::MatrixXd(); + igl::triangle::scaf::mesh_improve(s); + + double new_weight = s.mesh_measure * s.energy / (s.sf_num * 100); + s.scaffold_factor = new_weight; + igl::triangle::scaf::update_scaffold(s); + + s.total_energy = igl::triangle::scaf::perform_iteration(s); + + s.energy = + igl::triangle::scaf::compute_energy(s, s.w_uv, false) / s.mesh_measure; + } + + return s.w_uv.topRows(s.mv_num); +} + +IGL_INLINE void igl::triangle::scaf_system(igl::triangle::SCAFData &s, Eigen::SparseMatrix &L, Eigen::VectorXd &rhs) +{ + s.energy = igl::triangle::scaf::compute_energy(s, s.w_uv, false) / s.mesh_measure; + + s.total_energy = igl::triangle::scaf::compute_energy(s, s.w_uv, true) / s.mesh_measure; + s.rect_frame_V = Eigen::MatrixXd(); + igl::triangle::scaf::mesh_improve(s); + + double new_weight = s.mesh_measure * s.energy / (s.sf_num * 100); + s.scaffold_factor = new_weight; + igl::triangle::scaf::update_scaffold(s); + + igl::triangle::scaf::compute_jacobians(s, s.w_uv, true); + igl::slim_update_weights_and_closest_rotations_with_jacobians(s.Ji_m, s.slim_energy, 0, s.W_m, s.Ri_m); + igl::slim_update_weights_and_closest_rotations_with_jacobians(s.Ji_s, s.scaf_energy, 0, s.W_s, s.Ri_s); + + igl::triangle::scaf::build_weighted_arap_system(s, L, rhs); +} + +#ifdef IGL_STATIC_LIBRARY +#endif diff --git a/vendor/libigl/include/igl/triangle/scaf.h b/vendor/libigl/include/igl/triangle/scaf.h new file mode 100644 index 0000000000000000000000000000000000000000..591c2b58cf28828b01738d615fbacc78d393f4d0 --- /dev/null +++ b/vendor/libigl/include/igl/triangle/scaf.h @@ -0,0 +1,122 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Zhongshi Jiang +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_SCAF_H +#define IGL_SCAF_H + +#include "../slim.h" +#include "../igl_inline.h" +#include "../MappingEnergyType.h" + +namespace igl +{ + namespace triangle + { + // Use a similar interface to igl::slim + // Implement ready-to-use 2D version of the algorithm described in + // SCAF: Simplicial Complex Augmentation Framework for Bijective Maps + // Zhongshi Jiang, Scott Schaefer, Daniele Panozzo, ACM Trancaction on Graphics (Proc. SIGGRAPH Asia 2017) + // For a complete implementation and customized UI, please refer to https://github.com/jiangzhongshi/scaffold-map + + struct SCAFData + { + double scaffold_factor = 10; + igl::MappingEnergyType scaf_energy = igl::MappingEnergyType::SYMMETRIC_DIRICHLET; + igl::MappingEnergyType slim_energy = igl::MappingEnergyType::SYMMETRIC_DIRICHLET; + + // Output + int dim = 2; + double total_energy; // scaffold + isometric + double energy; // objective value + + long mv_num = 0, mf_num = 0; + long sv_num = 0, sf_num = 0; + long v_num{}, f_num = 0; + Eigen::MatrixXd m_V; // input initial mesh V + Eigen::MatrixXi m_T; // input initial mesh F/T + // INTERNAL + Eigen::MatrixXd w_uv; // whole domain uv: mesh + free vertices + Eigen::MatrixXi s_T; // scaffold domain tets: scaffold tets + Eigen::MatrixXi w_T; + + Eigen::VectorXd m_M; // mesh area or volume + Eigen::VectorXd s_M; // scaffold area or volume + Eigen::VectorXd w_M; // area/volume weights for whole + double mesh_measure = 0; // area or volume + double proximal_p = 0; + + Eigen::VectorXi frame_ids; + Eigen::VectorXi fixed_ids; + + std::map soft_cons; + double soft_const_p = 1e4; + + Eigen::VectorXi internal_bnd; + Eigen::MatrixXd rect_frame_V; + // multi-chart support + std::vector component_sizes; + std::vector bnd_sizes; + + // reweightedARAP interior variables. + bool has_pre_calc = false; + Eigen::SparseMatrix Dx_s, Dy_s, Dz_s; + Eigen::SparseMatrix Dx_m, Dy_m, Dz_m; + Eigen::MatrixXd Ri_m, Ji_m, Ri_s, Ji_s; + Eigen::MatrixXd W_m, W_s; + }; + + + // Compute necessary information to start using SCAF + // Inputs: + // V #V by 3 list of mesh vertex positions + // F #F by 3/3 list of mesh faces (triangles/tets) + // data igl::SCAFData + // slim_energy Energy type to minimize + // b list of boundary indices into V (soft constraint) + // bc #b by dim list of boundary conditions (soft constraint) + // soft_p Soft penalty factor (can be zero) + IGL_INLINE void scaf_precompute( + const Eigen::MatrixXd &V, + const Eigen::MatrixXi &F, + const Eigen::MatrixXd &V_init, + triangle::SCAFData &data, + MappingEnergyType slim_energy, + Eigen::VectorXi& b, + Eigen::MatrixXd& bc, + double soft_p); + + // Run iter_num iterations of SCAF, with precomputed data + // Outputs: + // V_o (in SLIMData): #V by dim list of mesh vertex positions + IGL_INLINE Eigen::MatrixXd scaf_solve(triangle::SCAFData &data, int iter_num); + + // Set up the SCAF system L * uv = rhs, without solving it. + // Inputs: + // s: igl::SCAFData. Will be modified by energy and Jacobian computation. + // Outputs: + // L: m by m matrix + // rhs: m by 1 vector + // with m = dim * (#V_mesh + #V_scaf - #V_frame) + IGL_INLINE void scaf_system(triangle::SCAFData &s, Eigen::SparseMatrix &L, Eigen::VectorXd &rhs); + + namespace scaf + { + // Compute SCAF energy + // Inputs: + // s: igl::SCAFData + // w_uv: (#V_mesh + #V_scaf) by dim matrix + // whole: Include scaffold if true + IGL_INLINE double compute_energy(SCAFData &s, const Eigen::MatrixXd &w_uv, bool whole); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "scaf.cpp" +#endif + +#endif //IGL_SCAF_H diff --git a/vendor/libigl/include/igl/triangle/triangulate.cpp b/vendor/libigl/include/igl/triangle/triangulate.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a5a3d9c4cc2cb050a350fd3cf147e07266010b59 --- /dev/null +++ b/vendor/libigl/include/igl/triangle/triangulate.cpp @@ -0,0 +1,178 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "triangulate.h" +#ifdef ANSI_DECLARATORS +# define IGL_PREVIOUSLY_DEFINED_ANSI_DECLARATORS ANSI_DECLARATORS +# undef ANSI_DECLARATORS +#endif +#ifdef REAL +# define IGL_PREVIOUSLY_DEFINED_REAL REAL +# undef REAL +#endif +#ifdef VOID +# define IGL_PREVIOUSLY_DEFINED_VOID VOID +# undef VOID +#endif +#define ANSI_DECLARATORS +#define REAL double +#define VOID int + +#include + +#undef ANSI_DECLARATORS +#ifdef IGL_PREVIOUSLY_DEFINED_ANSI_DECLARATORS +# define ANSI_DECLARATORS IGL_PREVIOUSLY_DEFINED_ANSI_DECLARATORS +#endif + +#undef REAL +#ifdef IGL_PREVIOUSLY_DEFINED_REAL +# define REAL IGL_PREVIOUSLY_DEFINED_REAL +#endif + +#undef VOID +#ifdef IGL_PREVIOUSLY_DEFINED_VOID +# define VOID IGL_PREVIOUSLY_DEFINED_VOID +#endif + +template < + typename DerivedV, + typename DerivedE, + typename DerivedH, + typename DerivedV2, + typename DerivedF2> +IGL_INLINE void igl::triangle::triangulate( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & E, + const Eigen::MatrixBase & H, + const std::string flags, + Eigen::PlainObjectBase & V2, + Eigen::PlainObjectBase & F2) +{ + Eigen::VectorXi VM,EM,VM2,EM2; + return triangulate(V,E,H,VM,EM,flags,V2,F2,VM2,EM2); +} + +template < + typename DerivedV, + typename DerivedE, + typename DerivedH, + typename DerivedVM, + typename DerivedEM, + typename DerivedV2, + typename DerivedF2, + typename DerivedVM2, + typename DerivedEM2> +IGL_INLINE void igl::triangle::triangulate( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & E, + const Eigen::MatrixBase & H, + const Eigen::MatrixBase & VM, + const Eigen::MatrixBase & EM, + const std::string flags, + Eigen::PlainObjectBase & V2, + Eigen::PlainObjectBase & F2, + Eigen::PlainObjectBase & VM2, + Eigen::PlainObjectBase & EM2) +{ + using namespace std; + using namespace Eigen; + + assert( (VM.size() == 0 || V.rows() == VM.size()) && + "Vertex markers must be empty or same size as V"); + assert( (EM.size() == 0 || E.rows() == EM.size()) && + "Segment markers must be empty or same size as E"); + assert(V.cols() == 2); + assert(E.size() == 0 || E.cols() == 2); + assert(H.size() == 0 || H.cols() == 2); + + // Prepare the flags + string full_flags = flags + "pz" + (EM.size() || VM.size() ? "" : "B"); + + typedef Map< Matrix > MapXdr; + typedef Map< Matrix > MapXir; + + // Prepare the input struct + triangulateio in; + in.numberofpoints = V.rows(); + in.pointlist = (double*)calloc(V.size(),sizeof(double)); + { + MapXdr inpl(in.pointlist,V.rows(),V.cols()); + inpl = V.template cast(); + } + + in.numberofpointattributes = 0; + in.pointmarkerlist = (int*)calloc(V.size(),sizeof(int)) ; + for(unsigned i=0;i(); + } + in.segmentmarkerlist = (int*)calloc(E.rows(),sizeof(int)); + for (unsigned i=0;i(); + } + in.numberofregions = 0; + + // Prepare the output struct + triangulateio out; + out.pointlist = NULL; + out.trianglelist = NULL; + out.segmentlist = NULL; + out.segmentmarkerlist = NULL; + out.pointmarkerlist = NULL; + + // Call triangle + ::triangulate(const_cast(full_flags.c_str()), &in, &out, 0); + + // Return the mesh + V2 = MapXdr(out.pointlist,out.numberofpoints,2).cast(); + F2 = MapXir(out.trianglelist,out.numberoftriangles,3).cast(); + if(VM.size()) + { + VM2 = MapXir(out.pointmarkerlist,out.numberofpoints,1).cast(); + } + if(EM.size()) + { + EM2 = MapXir(out.segmentmarkerlist,out.numberofsegments,1).cast(); + } + + // Cleanup in + free(in.pointlist); + free(in.pointmarkerlist); + free(in.segmentlist); + free(in.segmentmarkerlist); + free(in.holelist); + // Cleanup out + free(out.pointlist); + free(out.trianglelist); + free(out.segmentlist); + free(out.segmentmarkerlist); + free(out.pointmarkerlist); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template void igl::triangle::triangulate, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::triangle::triangulate, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::triangle::triangulate, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/triangle/triangulate.h b/vendor/libigl/include/igl/triangle/triangulate.h new file mode 100644 index 0000000000000000000000000000000000000000..90abdac9d27e3562192a6d171cc33dc7d21b43d1 --- /dev/null +++ b/vendor/libigl/include/igl/triangle/triangulate.h @@ -0,0 +1,87 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// Copyright (C) 2017 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_TRIANGLE_TRIANGULATE_H +#define IGL_TRIANGLE_TRIANGULATE_H +#include "../igl_inline.h" +#include +#include + +namespace igl +{ + namespace triangle + { + // Triangulate the interior of a polygon using the triangle library. + // + // Inputs: + // V #V by 2 list of 2D vertex positions + // E #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygon + // H #H by 2 coordinates of points contained inside holes of the polygon + // flags string of options pass to triangle (see triangle documentation) + // Outputs: + // V2 #V2 by 2 coordinates of the vertives of the generated triangulation + // F2 #F2 by 3 list of indices forming the faces of the generated triangulation + // + template < + typename DerivedV, + typename DerivedE, + typename DerivedH, + typename DerivedV2, + typename DerivedF2> + IGL_INLINE void triangulate( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & E, + const Eigen::MatrixBase & H, + const std::string flags, + Eigen::PlainObjectBase & V2, + Eigen::PlainObjectBase & F2); + + // Triangulate the interior of a polygon using the triangle library. + // + // Inputs: + // V #V by 2 list of 2D vertex positions + // E #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygon + // H #H by 2 coordinates of points contained inside holes of the polygon + // M #V list of markers for input vertices + // flags string of options pass to triangle (see triangle documentation) + // Outputs: + // V2 #V2 by 2 coordinates of the vertives of the generated triangulation + // F2 #F2 by 3 list of indices forming the faces of the generated triangulation + // M2 #V2 list of markers for output vertices + // + // TODO: expose the option to prevent Steiner points on the boundary + // + template < + typename DerivedV, + typename DerivedE, + typename DerivedH, + typename DerivedVM, + typename DerivedEM, + typename DerivedV2, + typename DerivedF2, + typename DerivedVM2, + typename DerivedEM2> + IGL_INLINE void triangulate( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & E, + const Eigen::MatrixBase & H, + const Eigen::MatrixBase & VM, + const Eigen::MatrixBase & EM, + const std::string flags, + Eigen::PlainObjectBase & V2, + Eigen::PlainObjectBase & F2, + Eigen::PlainObjectBase & VM2, + Eigen::PlainObjectBase & EM2); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "triangulate.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/unproject_in_mesh.cpp b/vendor/libigl/include/igl/unproject_in_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a16e0b6a1277ddda5d7f80d9b2232ff7a95ad223 --- /dev/null +++ b/vendor/libigl/include/igl/unproject_in_mesh.cpp @@ -0,0 +1,100 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "unproject_in_mesh.h" +#include "unproject_ray.h" +#include "ray_mesh_intersect.h" + +template < typename Derivedobj> + IGL_INLINE int igl::unproject_in_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const std::function< + void( + const Eigen::Vector3f&, + const Eigen::Vector3f&, + std::vector &) + > & shoot_ray, + Eigen::PlainObjectBase & obj, + std::vector & hits) +{ + using namespace std; + using namespace Eigen; + Vector3f s,dir; + unproject_ray(pos,model,proj,viewport,s,dir); + shoot_ray(s,dir,hits); + switch(hits.size()) + { + case 0: + break; + case 1: + { + obj = (s + dir*hits[0].t).cast(); + break; + } + case 2: + default: + { + obj = 0.5*((s + dir*hits[0].t) + (s + dir*hits[1].t)).cast(); + break; + } + } + return hits.size(); +} + +extern "C" +{ +#include "raytri.c" +} + +template < typename DerivedV, typename DerivedF, typename Derivedobj> + IGL_INLINE int igl::unproject_in_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & obj, + std::vector & hits) +{ + using namespace std; + using namespace Eigen; + const auto & shoot_ray = [&V,&F]( + const Eigen::Vector3f& s, + const Eigen::Vector3f& dir, + std::vector & hits) + { + ray_mesh_intersect(s,dir,V,F,hits); + }; + return unproject_in_mesh(pos,model,proj,viewport,shoot_ray,obj,hits); +} + +template < typename DerivedV, typename DerivedF, typename Derivedobj> + IGL_INLINE int igl::unproject_in_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + Eigen::PlainObjectBase & obj) +{ + std::vector hits; + return unproject_in_mesh(pos,model,proj,viewport,V,F,obj,hits); +} +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template int igl::unproject_in_mesh, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, std::vector >&); +template int igl::unproject_in_mesh >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, std::function const&, Eigen::Matrix const&, std::vector >&)> const&, Eigen::PlainObjectBase >&, std::vector >&); +template int igl::unproject_in_mesh >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, std::function const&, Eigen::Matrix const&, std::vector >&)> const&, Eigen::PlainObjectBase >&, std::vector >&); +template int igl::unproject_in_mesh >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, std::function const&, Eigen::Matrix const&, std::vector >&)> const&, Eigen::PlainObjectBase >&, std::vector >&); +template int igl::unproject_in_mesh, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/unproject_onto_mesh.cpp b/vendor/libigl/include/igl/unproject_onto_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..49e81667473427c82f518353a0ace743e3e5abd6 --- /dev/null +++ b/vendor/libigl/include/igl/unproject_onto_mesh.cpp @@ -0,0 +1,81 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "unproject_onto_mesh.h" +#include "unproject.h" +#include "unproject_ray.h" +#include "ray_mesh_intersect.h" +#include + +template < typename DerivedV, typename DerivedF, typename Derivedbc> +IGL_INLINE bool igl::unproject_onto_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + int & fid, + Eigen::PlainObjectBase & bc) +{ + using namespace std; + using namespace Eigen; + const auto & shoot_ray = [&V,&F]( + const Eigen::Vector3f& s, + const Eigen::Vector3f& dir, + igl::Hit & hit)->bool + { + std::vector hits; + if(!ray_mesh_intersect(s,dir,V,F,hits)) + { + return false; + } + hit = hits[0]; + return true; + }; + return unproject_onto_mesh(pos,model,proj,viewport,shoot_ray,fid,bc); +} + +template +IGL_INLINE bool igl::unproject_onto_mesh( + const Eigen::Vector2f& pos, + const Eigen::Matrix4f& model, + const Eigen::Matrix4f& proj, + const Eigen::Vector4f& viewport, + const std::function< + bool( + const Eigen::Vector3f&, + const Eigen::Vector3f&, + igl::Hit &) + > & shoot_ray, + int & fid, + Eigen::PlainObjectBase & bc) +{ + using namespace std; + using namespace Eigen; + Vector3f s,dir; + unproject_ray(pos,model,proj,viewport,s,dir); + Hit hit; + if(!shoot_ray(s,dir,hit)) + { + return false; + } + bc.resize(3, 1); + bc << 1.0-hit.u-hit.v, hit.u, hit.v; + fid = hit.id; + return true; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::unproject_onto_mesh, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template bool igl::unproject_onto_mesh, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int&, Eigen::PlainObjectBase >&); +template bool igl::unproject_onto_mesh, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int&, Eigen::PlainObjectBase >&); +template bool igl::unproject_onto_mesh, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int&, Eigen::PlainObjectBase >&); +#endif diff --git a/vendor/libigl/include/igl/unproject_ray.h b/vendor/libigl/include/igl/unproject_ray.h new file mode 100644 index 0000000000000000000000000000000000000000..2bca6151ccd373a6d46471787ed8b68e7b6da2d3 --- /dev/null +++ b/vendor/libigl/include/igl/unproject_ray.h @@ -0,0 +1,44 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_UNPROJECT_RAY_H +#define IGL_UNPROJECT_RAY_H +#include "igl_inline.h" +#include +namespace igl +{ + // Construct a ray (source point + direction vector) given a screen space + // positions (e.g. mouse) and a model-view projection constellation. + // + // Inputs: + // pos 2d screen-space position (x,y) + // model 4x4 model-view matrix + // proj 4x4 projection matrix + // viewport 4-long viewport vector + // Outputs: + // s source of ray (pos unprojected with z=0) + /// dir direction of ray (d - s) where d is pos unprojected with z=1 + // + template < + typename Derivedpos, + typename Derivedmodel, + typename Derivedproj, + typename Derivedviewport, + typename Deriveds, + typename Deriveddir> + IGL_INLINE void unproject_ray( + const Eigen::MatrixBase & pos, + const Eigen::MatrixBase & model, + const Eigen::MatrixBase & proj, + const Eigen::MatrixBase & viewport, + Eigen::PlainObjectBase & s, + Eigen::PlainObjectBase & dir); +} +#ifndef IGL_STATIC_LIBRARY +# include "unproject_ray.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/upsample.cpp b/vendor/libigl/include/igl/upsample.cpp new file mode 100644 index 0000000000000000000000000000000000000000..483b814f7304a827c2293b71aef87c672a6a8639 --- /dev/null +++ b/vendor/libigl/include/igl/upsample.cpp @@ -0,0 +1,145 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "upsample.h" + +#include "triangle_triangle_adjacency.h" + + +template < + typename DerivedF, + typename SType, + typename DerivedNF> +IGL_INLINE void igl::upsample( + const int n_verts, + const Eigen::MatrixBase& F, + Eigen::SparseMatrix& S, + Eigen::PlainObjectBase& NF) +{ + using namespace std; + using namespace Eigen; + + typedef Eigen::Triplet Triplet_t; + + Eigen::Matrix< typename DerivedF::Scalar,Eigen::Dynamic,Eigen::Dynamic> + FF,FFi; + triangle_triangle_adjacency(F,FF,FFi); + + // TODO: Cache optimization missing from here, it is a mess + + // Compute the number and positions of the vertices to insert (on edges) + Eigen::MatrixXi NI = Eigen::MatrixXi::Constant(FF.rows(),FF.cols(),-1); + Eigen::MatrixXi NIdoubles = Eigen::MatrixXi::Zero(FF.rows(), FF.cols()); + int counter = 0; + + for(int i=0;i tripletList; + + // Fill the odd vertices position + for (int i=0; i VI(6); + VI << F(i,0), F(i,1), F(i,2), NI(i,0) + n_odd, NI(i,1) + n_odd, NI(i,2) + n_odd; + + Eigen::Matrix f0(3), f1(3), f2(3), f3(3); + f0 << VI(0), VI(3), VI(5); + f1 << VI(1), VI(4), VI(3); + f2 << VI(3), VI(4), VI(5); + f3 << VI(4), VI(2), VI(5); + + NF.row((i*4)+0) = f0; + NF.row((i*4)+1) = f1; + NF.row((i*4)+2) = f2; + NF.row((i*4)+3) = f3; + } +} + +template < + typename DerivedV, + typename DerivedF, + typename DerivedNV, + typename DerivedNF> +IGL_INLINE void igl::upsample( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + Eigen::PlainObjectBase& NV, + Eigen::PlainObjectBase& NF, + const int number_of_subdivs) +{ + NV = V; + NF = F; + for(int i=0; iS; + upsample(NV.rows(), tempF, S, NF); + // This .eval is super important + NV = (S*NV).eval(); + } +} + +template < + typename MatV, + typename MatF> +IGL_INLINE void igl::upsample( + MatV& V, + MatF& F, + const int number_of_subdivs) +{ + const MatV V_copy = V; + const MatF F_copy = F; + return upsample(V_copy,F_copy,V,F,number_of_subdivs); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::upsample, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, int); +template void igl::upsample, double, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::SparseMatrix&, Eigen::PlainObjectBase >&); +template void igl::upsample, Eigen::Matrix >(Eigen::Matrix&, Eigen::Matrix&, int); +#endif diff --git a/vendor/libigl/include/igl/upsample.h b/vendor/libigl/include/igl/upsample.h new file mode 100644 index 0000000000000000000000000000000000000000..588f3c5babc558dc37114483371c0c5e08ea68b4 --- /dev/null +++ b/vendor/libigl/include/igl/upsample.h @@ -0,0 +1,82 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_UPSAMPLE_H +#define IGL_UPSAMPLE_H +#include "igl_inline.h" + +#include +#include + +// History: +// changed templates from generic matrices to PlainObjectBase Alec May 7, 2011 +namespace igl +{ + // Subdivide without moving vertices: Given the triangle mesh [V, F], + // where n_verts = V.rows(), computes newV and a sparse matrix S s.t. + // [newV, newF] is the subdivided mesh where newV = S*V. + // + // Inputs: + // n_verts an integer (number of mesh vertices) + // F an m by 3 matrix of integers of triangle faces + // Outputs: + // S a sparse matrix (will become the subdivision matrix) + // newF a matrix containing the new faces + template < + typename DerivedF, + typename SType, + typename DerivedNF> + IGL_INLINE void upsample( + const int n_verts, + const Eigen::MatrixBase& F, + Eigen::SparseMatrix& S, + Eigen::PlainObjectBase& NF); + // Subdivide a mesh without moving vertices: loop subdivision but odd + // vertices stay put and even vertices are just edge midpoints + // + // Templates: + // MatV matrix for vertex positions, e.g. MatrixXd + // MatF matrix for vertex positions, e.g. MatrixXi + // Inputs: + // V #V by dim mesh vertices + // F #F by 3 mesh triangles + // Outputs: + // NV new vertex positions, V is guaranteed to be at top + // NF new list of face indices + // + // NOTE: V should not be the same as NV, + // NOTE: F should not be the same as NF, use other proto + // + // Known issues: + // - assumes (V,F) is edge-manifold. + template < + typename DerivedV, + typename DerivedF, + typename DerivedNV, + typename DerivedNF> + IGL_INLINE void upsample( + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + Eigen::PlainObjectBase& NV, + Eigen::PlainObjectBase& NF, + const int number_of_subdivs = 1); + + // Virtually in place wrapper + template < + typename MatV, + typename MatF> + IGL_INLINE void upsample( + MatV& V, + MatF& F, + const int number_of_subdivs = 1); +} + +#ifndef IGL_STATIC_LIBRARY +# include "upsample.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/vector_area_matrix.cpp b/vendor/libigl/include/igl/vector_area_matrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6bafb887161d8b74dd92969ee23af92ae5518e3c --- /dev/null +++ b/vendor/libigl/include/igl/vector_area_matrix.cpp @@ -0,0 +1,52 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Daniele Panozzo +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "vector_area_matrix.h" +#include "boundary_facets.h" +#include + +// Bug in unsupported/Eigen/SparseExtra needs iostream first +#include +#include + +template +IGL_INLINE void igl::vector_area_matrix( + const Eigen::MatrixBase & F, + Eigen::SparseMatrix& A) +{ + using namespace Eigen; + using namespace std; + + // number of vertices + const int n = F.maxCoeff()+1; + + MatrixXi E; + boundary_facets(F,E); + + //Prepare a vector of triplets to set the matrix + vector > tripletList; + tripletList.reserve(4*E.rows()); + + for(int k = 0; k < E.rows(); k++) + { + int i = E(k,0); + int j = E(k,1); + tripletList.push_back(Triplet(i+n, j, -0.25)); + tripletList.push_back(Triplet(j, i+n, -0.25)); + tripletList.push_back(Triplet(i, j+n, 0.25)); + tripletList.push_back(Triplet(j+n, i, 0.25)); + } + + //Set A from triplets (Eigen will sum triplets with same coordinates) + A.resize(n * 2, n * 2); + A.setFromTriplets(tripletList.begin(), tripletList.end()); +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::vector_area_matrix, double>(Eigen::MatrixBase > const&, Eigen::SparseMatrix&); +#endif diff --git a/vendor/libigl/include/igl/winding_number.cpp b/vendor/libigl/include/igl/winding_number.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6ce082361def2dc26e4cf39c9d21c86586acba55 --- /dev/null +++ b/vendor/libigl/include/igl/winding_number.cpp @@ -0,0 +1,119 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "winding_number.h" +#include "WindingNumberAABB.h" +#include "signed_angle.h" +#include "parallel_for.h" +#include "solid_angle.h" +#include "PI.h" + +#include + +template < + typename DerivedV, + typename DerivedF, + typename DerivedO, + typename DerivedW> +IGL_INLINE void igl::winding_number( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & O, + Eigen::PlainObjectBase & W) +{ + using namespace Eigen; + // make room for output + W.resize(O.rows(),1); + switch(F.cols()) + { + case 2: + { + igl::parallel_for(O.rows(),[&](const int o) + { + W(o) = winding_number(V,F,O.row(o)); + },10000); + return; + } + case 3: + { + WindingNumberAABB< + Eigen::Matrix, + DerivedV, + DerivedF> + hier(V,F); + hier.grow(); + // loop over origins + igl::parallel_for(O.rows(),[&](const int o) + { + W(o) = hier.winding_number(O.row(o)); + },10000); + break; + } + default: assert(false && "Bad simplex size"); break; + } +} + +template < + typename DerivedV, + typename DerivedF, + typename Derivedp> +IGL_INLINE typename DerivedV::Scalar igl::winding_number( + const Eigen::MatrixBase & V, + const Eigen::MatrixBase & F, + const Eigen::MatrixBase & p) +{ + typedef typename DerivedV::Scalar wType; + const int ss = F.cols(); + const int m = F.rows(); + wType w = 0; + for(int f = 0;f, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template void igl::winding_number, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +// generated by autoexplicit.sh +template Eigen::Matrix::Scalar igl::winding_number, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); +#endif diff --git a/vendor/libigl/include/igl/writeBF.h b/vendor/libigl/include/igl/writeBF.h new file mode 100644 index 0000000000000000000000000000000000000000..5ea51f1bc1cbedd10647c46b1a6d87635fe2bcf9 --- /dev/null +++ b/vendor/libigl/include/igl/writeBF.h @@ -0,0 +1,37 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_WRITEBF_H +#define IGL_WRITEBF_H +#include "igl_inline.h" +#include +#include +namespace igl +{ + // Write a bones forest to a file + // + // Input: + // file_name path to .bf bones tree file + // WI #B list of unique weight indices + // P #B list of parent indices into B, -1 for roots + // O #B list of tip offsets + // Returns true on success, false on errors + template < + typename DerivedWI, + typename DerivedP, + typename DerivedO> + IGL_INLINE bool writeBF( + const std::string & filename, + const Eigen::PlainObjectBase & WI, + const Eigen::PlainObjectBase & P, + const Eigen::PlainObjectBase & O); +} + +#ifndef IGL_STATIC_LIBRARY +# include "writeBF.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/writeMSH.h b/vendor/libigl/include/igl/writeMSH.h new file mode 100644 index 0000000000000000000000000000000000000000..0447b27a61722746dbf829cd9c80c3272f064dbd --- /dev/null +++ b/vendor/libigl/include/igl/writeMSH.h @@ -0,0 +1,57 @@ +// high level interface for MshSaver +// +// Copyright (C) 2020 Vladimir Fonov +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_WRITE_MSH_H +#define IGL_WRITE_MSH_H +#include "igl_inline.h" + +#include +#include +#include + +namespace igl +{ + // write triangle surface mesh and tetrahedral volume mesh to .msh file + // Inputs: + // msh - file name + // X eigen double matrix of vertex positions #X by 3 + // Tri #Tri eigen integer matrix of triangular faces indices into vertex positions + // Tet #Tet eigen integer matrix of tetrahedral indices into vertex positions + // TriTag #Tri eigen integer vector of tags associated with surface faces + // TetTag #Tet eigen integer vector of tags associated with volume elements + // XFields #XFields list of strings with field names associated with nodes + // XF #XFields list of eigen double matrices, fields associated with nodes + // EFields #EFields list of strings with field names associated with elements + // TriF #EFields list of eigen double matrices, fields associated with surface elements + // TetF #EFields list of eigen double matrices, fields associated with volume elements + // Known bugs: + // files are always stored in binary format + // file format is 2.2 + // only triangle surface elements and tetrahedral volumetric elements are supported + // only 3D information is supported + // the tag id is duplicated for physical (0) and elementary (1) + // same element fields are expected to be associated with surface elements and volumetric elements + IGL_INLINE bool writeMSH(const std::string &msh, + const Eigen::MatrixXd &X, + const Eigen::MatrixXi &Tri, + const Eigen::MatrixXi &Tet, + const Eigen::MatrixXi &TriTag, + const Eigen::MatrixXi &TetTag, + const std::vector &XFields, + const std::vector &XF, + const std::vector &EFields, + const std::vector &TriF, + const std::vector &TetF + ); + +} + +#ifndef IGL_STATIC_LIBRARY +# include "writeMSH.cpp" +#endif + +#endif //IGL_WRITE_MSH_H diff --git a/vendor/libigl/include/igl/writeOBJ.h b/vendor/libigl/include/igl/writeOBJ.h new file mode 100644 index 0000000000000000000000000000000000000000..218661570a65f834d9d1857d5fc998c9e555fc3a --- /dev/null +++ b/vendor/libigl/include/igl/writeOBJ.h @@ -0,0 +1,72 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_WRITEOBJ_H +#define IGL_WRITEOBJ_H +#include "igl_inline.h" +// History: +// return type changed from void to bool Alec 20 Sept 2011 + +#include +#include +#include + +namespace igl +{ + // Write a mesh in an ascii obj file + // Inputs: + // str path to outputfile + // V #V by 3 mesh vertex positions + // F #F by 3|4 mesh indices into V + // CN #CN by 3 normal vectors + // FN #F by 3|4 corner normal indices into CN + // TC #TC by 2|3 texture coordinates + // FTC #F by 3|4 corner texture coord indices into TC + // Returns true on success, false on error + // + // Known issues: Horrifyingly, this does not have the same order of + // parameters as readOBJ. + template < + typename DerivedV, + typename DerivedF, + typename DerivedCN, + typename DerivedFN, + typename DerivedTC, + typename DerivedFTC> + IGL_INLINE bool writeOBJ( + const std::string str, + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + const Eigen::MatrixBase& CN, + const Eigen::MatrixBase& FN, + const Eigen::MatrixBase& TC, + const Eigen::MatrixBase& FTC); + template + IGL_INLINE bool writeOBJ( + const std::string str, + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F); + + // Write a mesh of mixed tris and quads to an ascii obj file + // Inputs: + // str path to outputfile + // V #V by 3 mesh vertex positions + // F #F std::vector of std::vector of size 3 or 4 mesh indices into V + // Returns true on success, false on error + template + IGL_INLINE bool writeOBJ( + const std::string &str, + const Eigen::MatrixBase& V, + const std::vector >& F); + +} + +#ifndef IGL_STATIC_LIBRARY +# include "writeOBJ.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/write_triangle_mesh.cpp b/vendor/libigl/include/igl/write_triangle_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d10a7dc13227630771756fd4a13f5b36c02db5bb --- /dev/null +++ b/vendor/libigl/include/igl/write_triangle_mesh.cpp @@ -0,0 +1,70 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "write_triangle_mesh.h" +#include "pathinfo.h" +#include "writeMESH.h" +#include "writeOBJ.h" +#include "writeOFF.h" +#include "writePLY.h" +#include "writeSTL.h" +#include "writeWRL.h" + +#include + +template +IGL_INLINE bool igl::write_triangle_mesh( + const std::string str, + const Eigen::MatrixBase& V, + const Eigen::MatrixBase& F, + FileEncoding encoding) +{ + using namespace std; + // dirname, basename, extension and filename + string d,b,e,f; + pathinfo(str,d,b,e,f); + // Convert extension to lower case + std::transform(e.begin(), e.end(), e.begin(), ::tolower); + if(e == "mesh") + { + Eigen::MatrixXi _1; + return writeMESH(str,V,_1,F); + }else if(e == "obj") + { + return writeOBJ(str,V,F); + }else if(e == "off") + { + return writeOFF(str,V,F); + }else if(e == "ply") + { + return writePLY(str,V,F,encoding); + }else if(e == "stl") + { + return writeSTL(str,V,F,encoding); + }else if(e == "wrl") + { + return writeWRL(str,V,F); + }else + { + assert("Unsupported file format"); + cerr<<"Unsupported file format: ."<, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::FileEncoding); +// generated by autoexplicit.sh +template bool igl::write_triangle_mesh, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::FileEncoding); +// generated by autoexplicit.sh +template bool igl::write_triangle_mesh, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::FileEncoding); +// generated by autoexplicit.sh +template bool igl::write_triangle_mesh, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::FileEncoding); +template bool igl::write_triangle_mesh, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::FileEncoding); +#endif diff --git a/vendor/libigl/include/igl/xml/ReAntTweakBarXMLSerialization.h b/vendor/libigl/include/igl/xml/ReAntTweakBarXMLSerialization.h new file mode 100644 index 0000000000000000000000000000000000000000..c43af0c80978bbcdec593aed789e28ecaa4d1326 --- /dev/null +++ b/vendor/libigl/include/igl/xml/ReAntTweakBarXMLSerialization.h @@ -0,0 +1,269 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2013 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_XML_REANTTWEAKBAR_XML_SERIALIZATION_H +#define IGL_XML_REANTTWEAKBAR_XML_SERIALIZATION_H +#include "../igl_inline.h" +#include "serialize_xml.h" + +#undef IGL_HEADER_ONLY +#include "../anttweakbar/ReAntTweakBar.h" + +// Forward declarations +namespace igl +{ + namespace anttweakbar + { + class ReTwBar; + } +}; +namespace tinyxml2 +{ + class XMLDocument; +}; + +namespace igl +{ + namespace xml + { + +// namespace +// { + +// IGL_INLINE bool save_ReAntTweakBar(::igl::anttweakbar::ReTwBar* bar, const char* file_name); +// IGL_INLINE bool save_ReAntTweakBar(::igl::anttweakbar::ReTwBar* bar, tinyxml2::XMLDocument* doc); +// IGL_INLINE bool load_ReAntTweakBar(::igl::anttweakbar::ReTwBar* bar, const char *file_name); +// IGL_INLINE bool load_ReAntTweakBar(::igl::anttweakbar::ReTwBar* bar, tinyxml2::XMLDocument* doc); + + + IGL_INLINE bool save_ReAntTweakBar(::igl::anttweakbar::ReTwBar* bar, const char* file_name) + { + const char * name_chars = TwGetBarName(bar->bar); + std::string name = std::string(name_chars) + "_AntTweakBar"; + + const std::vector< ::igl::anttweakbar::ReTwRWItem>& rw_items = bar->get_rw_items(); + for(std::vector< ::igl::anttweakbar::ReTwRWItem>::const_iterator it = rw_items.begin(); it != rw_items.end(); it++) + { + std::string val = bar->get_value_as_string(it->var,it->type); + //::igl::XMLSerializer::SaveObject(val,it->name,name,file_name,false); + ::igl::serialize_xml(val,it->name,file_name,false,false); + } + + char var[REANTTWEAKBAR_MAX_CB_VAR_SIZE]; + // Print all CB variables + const std::vector< ::igl::anttweakbar::ReTwCBItem>& cb_items = bar->get_cb_items(); + for(std::vector< ::igl::anttweakbar::ReTwCBItem>::const_iterator it = cb_items.begin(); it != cb_items.end(); it++) + { + TwType type = it->type; + //TwSetVarCallback setCallback = it->setCallback; + TwGetVarCallback getCallback = it->getCallback; + void * clientData = it->clientData; + // I'm not sure how to do what I want to do. getCallback needs to be sure + // that it can write to var. So var needs to point to a valid and big + // enough chunk of memory + getCallback(var,clientData); + + std::string val = bar->get_value_as_string(var,type); + //::igl::XMLSerializer::SaveObject(val,it->name,name,file_name,false); + ::igl::serialize_xml(val,it->name,file_name,false,false); + } + + return true; + } + + /*IGL_INLINE bool save_ReAntTweakBar(::igl::anttweakbar::ReTwBar* bar, tinyxml2::XMLDocument* doc) + { + std::vector buffer; + + const char * name_chars = TwGetBarName(bar->bar); + std::string name = std::string(name_chars) + "_AntTweakBar"; + ::igl::XMLSerializer* s = new ::igl::XMLSerializer(name); + + const std::vector< ::igl::anttweakbar::ReTwRWItem>& rw_items = bar->get_rw_items(); + for(std::vector< ::igl::anttweakbar::ReTwRWItem>::const_iterator it = rw_items.begin(); it != rw_items.end(); it++) + { + std::string val = bar->get_value_as_string(it->var,it->type); + char** cval = new char*; // create char* on heap + *cval = new char[val.size()+1]; + buffer.push_back(cval); + strcpy(*cval,val.c_str()); + s->Add(*cval,it->name); + } + + char var[REANTTWEAKBAR_MAX_CB_VAR_SIZE]; + // Print all CB variables + const std::vector< ::igl::anttweakbar::ReTwCBItem>& cb_items = bar->get_cb_items(); + for(std::vector< ::igl::anttweakbar::ReTwCBItem>::const_iterator it = cb_items.begin(); it != cb_items.end(); it++) + { + TwType type = it->type; + //TwSetVarCallback setCallback = it->setCallback; + TwGetVarCallback getCallback = it->getCallback; + void * clientData = it->clientData; + // I'm not sure how to do what I want to do. getCallback needs to be sure + // that it can write to var. So var needs to point to a valid and big + // enough chunk of memory + getCallback(var,clientData); + + std::string val = bar->get_value_as_string(var,type); + char** cval = new char*; // create char* on heap + *cval = new char[val.size()+1]; + buffer.push_back(cval); + strcpy(*cval,val.c_str()); + s->Add(*cval,it->name); + } + + s->SaveToXMLDoc(name,doc); + + // delete pointer buffers + for(unsigned int i=0;ibar); + std::string name = std::string(name_chars) + "_AntTweakBar"; + + const std::vector< ::igl::anttweakbar::ReTwRWItem>& rw_items = bar->get_rw_items(); + for(std::vector< ::igl::anttweakbar::ReTwRWItem>::const_iterator it = rw_items.begin(); it != rw_items.end(); it++) + { + char* val; + //::igl::XMLSerializer::LoadObject(val,it->name,name,file_name); + ::igl::deserialize_xml(val,it->name,file_name); + sscanf(val,"%s %[^\n]",type_str,value_str); + + if(!bar->type_from_string(type_str,type)) + { + printf("ERROR: %s type not found... Skipping...\n",type_str); + continue; + } + + bar->set_value_from_string(it->name.c_str(),type,value_str); + delete[] val; + } + + const std::vector< ::igl::anttweakbar::ReTwCBItem>& cb_items = bar->get_cb_items(); + for(std::vector< ::igl::anttweakbar::ReTwCBItem>::const_iterator it = cb_items.begin(); it != cb_items.end(); it++) + { + char* val; + //::igl::XMLSerializer::LoadObject(val,it->name,name,file_name); + ::igl::deserialize_xml(val,it->name,file_name); + sscanf(val,"%s %[^\n]",type_str,value_str); + + if(!bar->type_from_string(type_str,type)) + { + printf("ERROR: %s type not found... Skipping...\n",type_str); + continue; + } + + bar->set_value_from_string(it->name.c_str(),type,value_str); + delete[] val; + } + + return true; + } + + /*IGL_INLINE bool load_ReAntTweakBar(::igl::anttweakbar::ReTwBar* bar, tinyxml2::XMLDocument* doc) + { + std::map variables; + std::map cbVariables; + + const char * name_chars = TwGetBarName(bar->bar); + std::string name = std::string(name_chars) + "_AntTweakBar"; + ::igl::XMLSerializer* s = new ::igl::XMLSerializer(name); + + std::map::iterator iter; + const std::vector< ::igl::anttweakbar::ReTwRWItem>& rw_items = bar->get_rw_items(); + for(std::vector< ::igl::anttweakbar::ReTwRWItem>::const_iterator it = rw_items.begin(); it != rw_items.end(); it++) + { + variables[it->name] = NULL; + iter = variables.find(it->name); + s->Add(iter->second,iter->first); + } + + // Add all CB variables + const std::vector< ::igl::anttweakbar::ReTwCBItem>& cb_items = bar->get_cb_items(); + for(std::vector< ::igl::anttweakbar::ReTwCBItem>::const_iterator it = cb_items.begin(); it != cb_items.end(); it++) + { + cbVariables[it->name] = NULL; + iter = cbVariables.find(it->name); + s->Add(iter->second,iter->first); + } + + s->LoadFromXMLDoc(doc); + + // Set loaded values + char type_str[REANTTWEAKBAR_MAX_WORD]; + char value_str[REANTTWEAKBAR_MAX_WORD]; + TwType type; + + for(iter = variables.begin(); iter != variables.end(); iter++) + { + if(iter->second == NULL) + { + printf("ERROR: '%s' entry not found... Skipping...\n",iter->first.c_str()); + continue; + } + + sscanf(iter->second,"%s %[^\n]",type_str,value_str); + + if(!bar->type_from_string(type_str,type)) + { + printf("ERROR: Type '%s' of '%s' not found... Skipping...\n",type_str,iter->first.c_str()); + continue; + } + + bar->set_value_from_string(iter->first.c_str(),type,value_str); + } + + for(iter = cbVariables.begin(); iter != cbVariables.end(); iter++) + { + if(iter->second == NULL) + { + printf("ERROR: '%s' entry not found... Skipping...\n",iter->first.c_str()); + continue; + } + + sscanf(iter->second,"%s %[^\n]",type_str,value_str); + + if(!bar->type_from_string(type_str,type)) + { + printf("ERROR: Type '%s' of '%s' not found... Skipping...\n",type_str,iter->first.c_str()); + continue; + } + + bar->set_value_from_string(iter->first.c_str(),type,value_str); + } + + // delete buffers + for(iter = variables.begin(); iter != variables.end(); iter++) + delete[] iter->second; + + for(iter = cbVariables.begin(); iter != cbVariables.end(); iter++) + delete[] iter->second; + + delete s; + + return true; + }*/ + +// } + } +} + +#endif diff --git a/vendor/libigl/include/igl/xml/XMLSerializable.h b/vendor/libigl/include/igl/xml/XMLSerializable.h new file mode 100644 index 0000000000000000000000000000000000000000..6105596439d445a1b5f088d9971c8fe430ad0cbf --- /dev/null +++ b/vendor/libigl/include/igl/xml/XMLSerializable.h @@ -0,0 +1,225 @@ +#ifndef IGL_XML_XMLSERIALIZABLE_H +#define IGL_XML_XMLSERIALIZABLE_H + +#include "serialize_xml.h" +#include "../igl_inline.h" +#include "../serialize.h" + +#include + + +// Interface for xml-serializable class see serialize_xml.h + +// Pretty sure all of these IGL_INLINE should be inline + +namespace igl +{ + namespace xml + { + // interface for user defined types + struct XMLSerializableBase : public SerializableBase + { + virtual void Serialize(std::vector& buffer) const = 0; + virtual void Deserialize(const std::vector& buffer) = 0; + virtual void Serialize(tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element) const = 0; + virtual void Deserialize(const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element) = 0; + }; + + // Convenient interface for user defined types + class XMLSerializable: public XMLSerializableBase + { + private: + + template + struct XMLSerializationObject: public XMLSerializableBase + { + bool Binary; + std::string Name; + T* Object; + + void Serialize(std::vector& buffer) const { + serialize(*Object,Name,buffer); + } + + void Deserialize(const std::vector& buffer) { + deserialize(*Object,Name,buffer); + } + + void Serialize(tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element) const { + serialize_xml(*Object,Name,doc,element,Binary); + } + + void Deserialize(const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element) { + deserialize_xml(*Object,Name,doc,element); + } + }; + + mutable bool initialized; + mutable std::vector objects; + + public: + + // Override this function to add your member variables which should be serialized + IGL_INLINE virtual void InitSerialization() = 0; + + // Following functions can be overridden to handle the specific events. + // Return false to prevent the de-/serialization of an object. + IGL_INLINE virtual bool PreSerialization() const; + IGL_INLINE virtual void PostSerialization() const; + IGL_INLINE virtual bool PreDeserialization(); + IGL_INLINE virtual void PostDeserialization(); + + // Default implementation of XMLSerializableBase interface + IGL_INLINE void Serialize(std::vector& buffer) const; + IGL_INLINE void Deserialize(const std::vector& buffer); + IGL_INLINE void Serialize(tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element) const; + IGL_INLINE void Deserialize(const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element); + + // Default constructor, destructor, assignment and copy constructor + IGL_INLINE XMLSerializable(); + IGL_INLINE XMLSerializable(const XMLSerializable& obj); + IGL_INLINE ~XMLSerializable(); + IGL_INLINE XMLSerializable& operator=(const XMLSerializable& obj); + + // Use this function to add your variables which should be serialized + template + IGL_INLINE void Add(T& obj,std::string name,bool binary = false); + }; + + // IMPLEMENTATION + + IGL_INLINE bool XMLSerializable::PreSerialization() const + { + return true; + } + + IGL_INLINE void XMLSerializable::PostSerialization() const + { + } + + IGL_INLINE bool XMLSerializable::PreDeserialization() + { + return true; + } + + IGL_INLINE void XMLSerializable::PostDeserialization() + { + } + + IGL_INLINE void XMLSerializable::Serialize(std::vector& buffer) const + { + if(this->PreSerialization()) + { + if(initialized == false) + { + objects.clear(); + (const_cast(this))->InitSerialization(); + initialized = true; + } + + for(unsigned int i=0;iSerialize(buffer); + + this->PostSerialization(); + } + } + + IGL_INLINE void XMLSerializable::Deserialize(const std::vector& buffer) + { + if(this->PreDeserialization()) + { + if(initialized == false) + { + objects.clear(); + (const_cast(this))->InitSerialization(); + initialized = true; + } + + for(unsigned int i=0;iDeserialize(buffer); + + this->PostDeserialization(); + } + } + + IGL_INLINE void XMLSerializable::Serialize(tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element) const + { + if(this->PreSerialization()) + { + if(initialized == false) + { + objects.clear(); + (const_cast(this))->InitSerialization(); + initialized = true; + } + + for(unsigned int i=0;iSerialize(doc,element); + + this->PostSerialization(); + } + } + + IGL_INLINE void XMLSerializable::Deserialize(const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element) + { + if(this->PreDeserialization()) + { + if(initialized == false) + { + objects.clear(); + (const_cast(this))->InitSerialization(); + initialized = true; + } + + for(unsigned int i=0;iDeserialize(doc,element); + + this->PostDeserialization(); + } + } + + IGL_INLINE XMLSerializable::XMLSerializable() + { + initialized = false; + } + + IGL_INLINE XMLSerializable::XMLSerializable(const XMLSerializable& obj) + { + initialized = false; + objects.clear(); + } + + IGL_INLINE XMLSerializable::~XMLSerializable() + { + initialized = false; + objects.clear(); + } + + + IGL_INLINE XMLSerializable& XMLSerializable::operator=(const XMLSerializable& obj) + { + if(this != &obj) + { + if(initialized) + { + initialized = false; + objects.clear(); + } + } + return *this; + } + + template + IGL_INLINE void XMLSerializable::Add(T& obj,std::string name,bool binary) + { + XMLSerializationObject* object = new XMLSerializationObject(); + object->Binary = binary; + object->Name = name; + object->Object = &obj; + + objects.push_back(object); + } + + } +} +#endif diff --git a/vendor/libigl/include/igl/xml/serialization_test.skip b/vendor/libigl/include/igl/xml/serialization_test.skip new file mode 100644 index 0000000000000000000000000000000000000000..5888075c40bf61c0757ba5fe6e5905b505c5d9c6 --- /dev/null +++ b/vendor/libigl/include/igl/xml/serialization_test.skip @@ -0,0 +1,489 @@ +// +// Copyright (C) 2014 Christian Schüller +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +//#ifndef IGL_SERIALIZATION_TEST_H +//#define IGL_SERIALIZATION_TEST_H + +//#include +#include "serialize_xml.h" +#include "XMLSerializable.h" + +namespace igl +{ + namespace xml + { + + struct Test1111 + { + }; + + struct Test1 : public XMLSerializable + { + std::string ts; + std::vector tvt; + Test1* tt; + + Test1() + { + tt = NULL; + } + + void InitSerialization() + { + Add(ts,"ts",false); + Add(tvt,"tvt"); + Add(tt,"tt"); + } + }; + + struct Test2: public XMLSerializableBase + { + char tc; + int* ti; + std::vector tvb; + float tf; + + Test2() + { + tc = '1'; + ti = NULL; + tf = 1.0004; + tvb.push_back(2); + tvb.push_back(3); + } + + void Serialize(tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element) const + { + serialize_xml(tc,"tc",doc,element); + serialize_xml(ti,"ti",doc,element); + serialize_xml(tvb,"tvb",doc,element); + } + void Deserialize(const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element) + { + deserialize_xml(tc,"tc",doc,element); + deserialize_xml(ti,"ti",doc,element); + deserialize_xml(tvb,"tvb",doc,element); + } + void Serialize(std::vector& buffer) const + { + serialize(tc,"tc",buffer); + serialize(ti,"ti",buffer); + serialize(tvb,"tvb",buffer); + serialize(tf,"tf",buffer); + } + void Deserialize(const std::vector& buffer) + { + deserialize(tc,"tc",buffer); + deserialize(ti,"ti",buffer); + deserialize(tvb,"tvb",buffer); + deserialize(tf,"tf",buffer); + } + }; + + void serialization_test() + { + std::string file("test"); + + bool tbIn = true,tbOut; + char tcIn = 't',tcOut; + unsigned char tucIn = 'u',tucOut; + short tsIn = 6,tsOut; + int tiIn = -10,tiOut; + unsigned int tuiIn = 10,tuiOut; + float tfIn = 1.0005,tfOut; + double tdIn = 1.000000005,tdOut; + + int* tinpIn = NULL,*tinpOut = NULL; + float* tfpIn = new float,*tfpOut = NULL; + *tfpIn = 1.11101; + + std::string tstrIn("test12345"),tstrOut; + + Test2 tObjIn,tObjOut; + int ti = 2; + tObjIn.ti = &ti; + + + Test1 test1,test2,test3; + test1.ts = "100"; + test2.ts = "200"; + test3.ts = "300"; + + Test1 testA, testC; + testA.tt = &test1; + testA.ts = "test123"; + testA.tvt.push_back(&test2); + testA.tvt.push_back(&test3); + + Test1 testB = testA; + testB.ts = "400"; + testB.tvt.pop_back(); + + std::pair tPairIn(10,true); + std::pair tPairOut; + + std::vector tVector1In ={1,2,3,4,5}; + std::vector tVector1Out; + + std::pair p1(10,1); + std::pair p2(1,0); + std::pair p3(10000,1); + std::vector > tVector2In ={p1,p2,p3}; + std::vector > tVector2Out; + + std::set > tSetIn ={p1,p2,p3}; + std::set > tSetOut; + + std::map tMapIn ={p1,p2,p3}; + std::map tMapOut; + + Eigen::Matrix tDenseMatrixIn; + tDenseMatrixIn << Eigen::Matrix::Random(); + tDenseMatrixIn.coeffRef(0,0) = 1.00001; + Eigen::Matrix tDenseMatrixOut; + + Eigen::Matrix tDenseRowMatrixIn; + tDenseRowMatrixIn << Eigen::Matrix::Random(); + Eigen::Matrix tDenseRowMatrixOut; + + Eigen::SparseMatrix tSparseMatrixIn; + tSparseMatrixIn.resize(3,3); + tSparseMatrixIn.insert(0,0) = 1.3; + tSparseMatrixIn.insert(1,1) = 10.2; + tSparseMatrixIn.insert(2,2) = 100.1; + tSparseMatrixIn.finalize(); + Eigen::SparseMatrix tSparseMatrixOut; + + // binary serialization + + serialize(tbIn,file); + deserialize(tbOut,file); + assert(tbIn == tbOut); + + serialize(tcIn,file); + deserialize(tcOut,file); + assert(tcIn == tcOut); + + serialize(tucIn,file); + deserialize(tucOut,file); + assert(tucIn == tucOut); + + serialize(tsIn,file); + deserialize(tsOut,file); + assert(tsIn == tsOut); + + serialize(tiIn,file); + deserialize(tiOut,file); + assert(tiIn == tiOut); + + serialize(tuiIn,file); + deserialize(tuiOut,file); + assert(tuiIn == tuiOut); + + serialize(tfIn,file); + deserialize(tfOut,file); + assert(tfIn == tfOut); + + serialize(tdIn,file); + deserialize(tdOut,file); + assert(tdIn == tdOut); + + serialize(tinpIn,file); + deserialize(tinpOut,file); + assert(tinpIn == tinpOut); + + serialize(tfpIn,file); + deserialize(tfpOut,file); + assert(*tfpIn == *tfpOut); + tfpOut = NULL; + + serialize(tstrIn,file); + deserialize(tstrOut,file); + assert(tstrIn == tstrOut); + + // updating + serialize(tbIn,"tb",file,true); + serialize(tcIn,"tc",file); + serialize(tiIn,"ti",file); + tiIn++; + serialize(tiIn,"ti",file); + tiIn++; + serialize(tiIn,"ti",file); + deserialize(tbOut,"tb",file); + deserialize(tcOut,"tc",file); + deserialize(tiOut,"ti",file); + assert(tbIn == tbOut); + assert(tcIn == tcOut); + assert(tiIn == tiOut); + + serialize(tsIn,"tsIn",file,true); + serialize(tVector1In,"tVector1In",file); + serialize(tVector2In,"tsIn",file); + deserialize(tVector2Out,"tsIn",file); + for(unsigned int i=0;its == testC.tvt[i]->ts); + assert(testB.tvt[i]->tvt.size() == testC.tvt[i]->tvt.size()); + assert(testB.tvt[i]->tt == testC.tvt[i]->tt); + } + assert(testB.tt->ts == testC.tt->ts); + assert(testB.tt->tvt.size() == testC.tt->tvt.size()); + assert(testB.tt->tt == testC.tt->tt); + testC = Test1(); + + // big data test + /*std::vector > bigDataIn,bigDataOut; + for(unsigned int i=0;i<10000;i++) + { + std::vector v; + for(unsigned int j=0;j<10000;j++) + { + v.push_back(j); + } + bigDataIn.push_back(v); + } + + Timer timer; + timer.start(); + serialize(bigDataIn,file); + timer.stop(); + std::cout << "ser: " << timer.getElapsedTimeInMilliSec() << std::endl; + + timer.start(); + deserialize(bigDataOut,file); + timer.stop(); + std::cout << "des: " << timer.getElapsedTimeInMilliSec() << std::endl; + char c; + std::cin >> c; */ + + // xml serialization + + serialize_xml(tbIn,file); + deserialize_xml(tbOut,file); + assert(tbIn == tbOut); + + serialize_xml(tcIn,file); + deserialize_xml(tcOut,file); + assert(tcIn == tcOut); + + serialize_xml(tucIn,file); + deserialize_xml(tucOut,file); + assert(tucIn == tucOut); + + serialize_xml(tsIn,file); + deserialize_xml(tsOut,file); + assert(tsIn == tsOut); + + serialize_xml(tiIn,file); + deserialize_xml(tiOut,file); + assert(tiIn == tiOut); + + serialize_xml(tuiIn,file); + deserialize_xml(tuiOut,file); + assert(tuiIn == tuiOut); + + serialize_xml(tfIn,file); + deserialize_xml(tfOut,file); + assert(tfIn == tfOut); + + serialize_xml(tdIn,file); + deserialize_xml(tdOut,file); + assert(tdIn == tdOut); + + serialize_xml(tinpIn,file); + deserialize_xml(tinpOut,file); + assert(tinpIn == tinpOut); + + serialize_xml(tfpIn,file); + deserialize_xml(tfpOut,file); + assert(*tfpIn == *tfpOut); + + serialize_xml(tstrIn,file); + deserialize_xml(tstrOut,file); + assert(tstrIn == tstrOut); + + // updating + serialize_xml(tbIn,"tb",file,false,true); + serialize_xml(tcIn,"tc",file); + serialize_xml(tiIn,"ti",file); + tiIn++; + serialize_xml(tiIn,"ti",file); + tiIn++; + serialize_xml(tiIn,"ti",file); + deserialize_xml(tbOut,"tb",file); + deserialize_xml(tcOut,"tc",file); + deserialize_xml(tiOut,"ti",file); + assert(tbIn == tbOut); + assert(tcIn == tcOut); + assert(tiIn == tiOut); + + serialize_xml(tsIn,"tsIn",file,false,true); + serialize_xml(tVector1In,"tVector1In",file); + serialize_xml(tVector2In,"tsIn",file); + deserialize_xml(tVector2Out,"tsIn",file); + for(unsigned int i=0;its == testC.tvt[i]->ts); + assert(testB.tvt[i]->tvt.size() == testC.tvt[i]->tvt.size()); + assert(testB.tvt[i]->tt == testC.tvt[i]->tt); + } + assert(testB.tt->ts == testC.tt->ts); + assert(testB.tt->tvt.size() == testC.tt->tvt.size()); + assert(testB.tt->tt == testC.tt->tt); + + // big data test + /*std::vector > bigDataIn,bigDataOut; + for(unsigned int i=0;i<10000;i++) + { + std::vector v; + for(unsigned int j=0;j<10000;j++) + { + v.push_back(j); + } + bigDataIn.push_back(v); + } + + Timer timer; + timer.start(); + serialize_xml(bigDataIn,"bigDataIn",file,seRIALIZE_BINARY); + timer.stop(); + std::cout << "ser: " << timer.getElapsedTimeInMilliSec() << std::endl; + + timer.start(); + deserialize_xml(bigDataOut,"bigDataIn",file); + timer.stop(); + std::cout << "des: " << timer.getElapsedTimeInMilliSec() << std::endl; + char c; + std::cin >> c;*/ + + std::cout << "All tests run successfully!\n"; + } + } +} + +//#endif diff --git a/vendor/libigl/include/igl/xml/serialize_xml.cpp b/vendor/libigl/include/igl/xml/serialize_xml.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b68b2f73207dac5d2f21912256a1844b7ca6bb0f --- /dev/null +++ b/vendor/libigl/include/igl/xml/serialize_xml.cpp @@ -0,0 +1,912 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2014 Christian Schüller +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include "serialize_xml.h" +#include "../STR.h" +#include "../serialize.h" +#include "XMLSerializable.h" + +#include +#include +#include + +namespace igl +{ + namespace xml + { + template + IGL_INLINE void serialize_xml( + const T& obj, + const std::string& filename) + { + serialize_xml(obj,"object",filename,false,true); + } + + template + IGL_INLINE void serialize_xml( + const T& obj, + const std::string& objectName, + const std::string& filename, + bool binary, + bool overwrite) + { + tinyxml2::XMLDocument* doc = new tinyxml2::XMLDocument(); + + if(overwrite == false) + { + // Check if file exists + tinyxml2::XMLError error = doc->LoadFile(filename.c_str()); + if(error != tinyxml2::XML_SUCCESS) + { + doc->Clear(); + } + } + + tinyxml2::XMLElement* element = doc->FirstChildElement("serialization"); + if(element == NULL) + { + element = doc->NewElement("serialization"); + doc->InsertEndChild(element); + } + + serialize_xml(obj,objectName,doc,element,binary); + + // Save + tinyxml2::XMLError error = doc->SaveFile(filename.c_str()); + if(error != tinyxml2::XML_SUCCESS) + { + doc->PrintError(); + } + + delete doc; + } + + template + IGL_INLINE void serialize_xml( + const T& obj, + const std::string& objectName, + tinyxml2::XMLDocument* doc, + tinyxml2::XMLElement* element, + bool binary) + { + static_assert( + serialization_xml::is_serializable::value, + "'igl::xml::serialize_xml': type is not serializable"); + + std::string name(objectName); + serialization_xml::encodeXMLElementName(name); + + tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + + if(child != NULL) + element->DeleteChild(child); + + child = doc->NewElement(name.c_str()); + element->InsertEndChild(child); + + if(binary) + { + std::vector buffer; + serialize(obj,name,buffer); + std::string data = + serialization_xml::base64_encode( + reinterpret_cast( + buffer.data()),buffer.size()); + + child->SetAttribute("binary",true); + + serialization_xml::serialize(data,doc,element,name); + } + else + { + serialization_xml::serialize(obj,doc,element,name); + } + } + + template + IGL_INLINE void deserialize_xml(T& obj,const std::string& filename) + { + deserialize_xml(obj,"object",filename); + } + + template + IGL_INLINE void deserialize_xml(T& obj,const std::string& objectName,const std::string& filename) + { + tinyxml2::XMLDocument* doc = new tinyxml2::XMLDocument(); + + tinyxml2::XMLError error = doc->LoadFile(filename.c_str()); + if(error != tinyxml2::XML_SUCCESS) + { + std::cerr << "File not found!" << std::endl; + doc->PrintError(); + delete doc; + } + else + { + tinyxml2::XMLElement* element = doc->FirstChildElement("serialization"); + if(element == NULL) + { + std::cerr << "Name of object not found! Initialized with default value." << std::endl; + obj = T(); + } + else + { + deserialize_xml(obj,objectName,doc,element); + } + + delete doc; + } + } + + template + IGL_INLINE void deserialize_xml(T& obj,const std::string& objectName,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element) + { + static_assert(serialization::is_serializable::value,"'igl::xml::deserialize_xml': type is not deserializable"); + + std::string name(objectName); + serialization_xml::encodeXMLElementName(name); + + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child != NULL) + { + bool isBinary = false; + const tinyxml2::XMLAttribute* attr = child->FindAttribute("binary"); + if(attr != NULL) + { + std::string code; + serialization_xml::deserialize(code,doc,element,name); + std::string decoded = serialization_xml::base64_decode(code); + + std::vector buffer; + std::copy(decoded.c_str(),decoded.c_str()+decoded.length(),std::back_inserter(buffer)); + + deserialize(obj,name,buffer); + } + else + { + serialization_xml::deserialize(obj,doc,element,name); + } + } + } + + namespace serialization_xml + { + // fundamental types + + template + IGL_INLINE typename std::enable_if::value>::type serialize(const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* child = getElement(doc,element,name.c_str()); + child->SetAttribute("val",obj); + } + + template + IGL_INLINE typename std::enable_if::value>::type deserialize(T& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child != NULL) + { + getAttribute(child->Attribute("val"),obj); + } + else + { + obj = T(); + } + } + + // std::string + + IGL_INLINE void serialize(const std::string& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* child = getElement(doc,element,name.c_str()); + child->SetAttribute("val",obj.c_str()); + } + + IGL_INLINE void deserialize(std::string& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child != NULL) + { + getAttribute(child->Attribute("val"),obj); + } + else + { + obj = std::string(""); + } + } + + // Serializable + + template + IGL_INLINE typename std::enable_if::value>::type serialize(const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + // Serialize object implementing Serializable interface + const XMLSerializableBase& object = dynamic_cast(obj); + + tinyxml2::XMLElement* child = getElement(doc,element,name.c_str()); + object.Serialize(doc,child); + } + + template + IGL_INLINE typename std::enable_if::value>::type deserialize(T& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + + if(child != NULL) + { + obj.Deserialize(doc,child); + } + else + { + obj = T(); + } + } + + // STL containers + + template + IGL_INLINE void serialize(const std::pair& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* pair = getElement(doc,element,name.c_str()); + serialize(obj.first,doc,pair,"first"); + serialize(obj.second,doc,pair,"second"); + } + + template + IGL_INLINE void deserialize(std::pair& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child != NULL) + { + deserialize(obj.first,doc,child,"first"); + deserialize(obj.second,doc,child,"second"); + } + else + { + obj.first = T1(); + obj.second = T2(); + } + } + + template + IGL_INLINE void serialize(const std::vector& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* vector = getElement(doc,element,name.c_str()); + vector->SetAttribute("size",(unsigned int)obj.size()); + + std::stringstream num; + for(unsigned int i=0;i + IGL_INLINE void deserialize(std::vector& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + obj.clear(); + + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child != NULL) + { + unsigned int size = child->UnsignedAttribute("size"); + obj.resize(size); + + std::stringstream num; + for(unsigned int i=0;i + IGL_INLINE void serialize(const std::set& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* set = getElement(doc,element,name.c_str()); + set->SetAttribute("size",(unsigned int)obj.size()); + + std::stringstream num; + typename std::set::iterator iter = obj.begin(); + for(int i=0;iter!=obj.end();iter++,i++) + { + num.str(""); + num << "value" << i; + serialize((T)*iter,doc,set,num.str()); + } + } + + template + IGL_INLINE void deserialize(std::set& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + obj.clear(); + + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child != NULL) + { + unsigned int size = child->UnsignedAttribute("size"); + + std::stringstream num; + typename std::set::iterator iter = obj.begin(); + for(int i=0;i + IGL_INLINE void serialize(const std::map& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* map = getElement(doc,element,name.c_str()); + map->SetAttribute("size",(unsigned int)obj.size()); + + std::stringstream num; + typename std::map::const_iterator iter = obj.cbegin(); + for(int i=0;iter!=obj.end();iter++,i++) + { + num.str(""); + num << "value" << i; + serialize((std::pair)*iter,doc,map,num.str()); + } + } + + template + IGL_INLINE void deserialize(std::map& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + obj.clear(); + + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child != NULL) + { + unsigned int size = child->UnsignedAttribute("size"); + + std::stringstream num; + typename std::map::iterator iter = obj.begin(); + for(int i=0;i pair; + deserialize(pair,doc,child,num.str()); + obj.insert(pair); + } + } + else + { + obj.clear(); + } + } + + template + IGL_INLINE void serialize( + const Eigen::Matrix& obj, + const std::string& name, + const std::function& to_string, + tinyxml2::XMLDocument* doc, + tinyxml2::XMLElement* element) + { + tinyxml2::XMLElement* matrix = getElement(doc,element,name.c_str()); + + const unsigned int rows = obj.rows(); + const unsigned int cols = obj.cols(); + + matrix->SetAttribute("rows",rows); + matrix->SetAttribute("cols",cols); + + std::stringstream ms; + ms << "\n"; + for(unsigned int r=0;r 1) + mString[mString.size()-2] = '\0'; + + matrix->SetAttribute("matrix",mString.c_str()); + } + + // Eigen types + template + IGL_INLINE void serialize( + const Eigen::Matrix& obj, + tinyxml2::XMLDocument* doc, + tinyxml2::XMLElement* element, + const std::string& name) + { + const std::function to_string = + [](const T & v)->std::string + { + return + STR(std::setprecision(std::numeric_limits::digits10+2)< + IGL_INLINE void deserialize( + const tinyxml2::XMLDocument* doc, + const tinyxml2::XMLElement* element, + const std::string& name, + const std::function & from_string, + Eigen::Matrix& obj) + { + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + bool initialized = false; + if(child != NULL) + { + const unsigned int rows = child->UnsignedAttribute("rows"); + const unsigned int cols = child->UnsignedAttribute("cols"); + + if(rows > 0 && cols > 0) + { + obj.resize(rows,cols); + + const tinyxml2::XMLAttribute* attribute = child->FindAttribute("matrix"); + if(attribute != NULL) + { + std::string matTemp; + getAttribute(attribute->Value(),matTemp); + + std::string line,srows,scols; + std::stringstream mats; + mats << matTemp; + + int r=0; + std::string val; + // for each line + getline(mats,line); + while(getline(mats,line)) + { + // get current line + std::stringstream liness(line); + + for(unsigned int c=0;c(); + } + } + + template + IGL_INLINE void deserialize( + Eigen::Matrix& obj, + const tinyxml2::XMLDocument* doc, + const tinyxml2::XMLElement* element, + const std::string& name) + { + const std::function & from_string = + [](const std::string & s,T & v) + { + getAttribute(s.c_str(),v); + }; + deserialize(doc,element,name,from_string,obj); + } + + template + IGL_INLINE void serialize(const Eigen::SparseMatrix& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* matrix = getElement(doc,element,name.c_str()); + + const unsigned int rows = obj.rows(); + const unsigned int cols = obj.cols(); + + matrix->SetAttribute("rows",rows); + matrix->SetAttribute("cols",cols); + + char buffer[200]; + std::stringstream ms; + ms << "\n"; + for(int k=0;k::InnerIterator it(obj,k);it;++it) + { + tinyxml2::XMLUtil::ToStr(it.value(),buffer,200); + ms << it.row() << "," << it.col() << "," << buffer << "\n"; + } + } + + std::string mString = ms.str(); + if(mString.size() > 0) + mString[mString.size()-1] = '\0'; + + matrix->SetAttribute("matrix",mString.c_str()); + } + + template + IGL_INLINE void deserialize(Eigen::SparseMatrix& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + bool initialized = false; + if(child != NULL) + { + const unsigned int rows = child->UnsignedAttribute("rows"); + const unsigned int cols = child->UnsignedAttribute("cols"); + + if(rows > 0 && cols > 0) + { + obj.resize(rows,cols); + obj.setZero(); + + const tinyxml2::XMLAttribute* attribute = child->FindAttribute("matrix"); + if(attribute != NULL) + { + std::string matTemp; + getAttribute(attribute->Value(),matTemp); + + std::string line,srows,scols; + std::stringstream mats; + mats << matTemp; + + std::vector > triplets; + int r=0; + std::string val; + + // for each line + getline(mats,line); + while(getline(mats,line)) + { + // get current line + std::stringstream liness(line); + + // row + getline(liness,val,','); + int row = atoi(val.c_str()); + // col + getline(liness,val,','); + int col = atoi(val.c_str()); + // val + getline(liness,val); + T value; + getAttribute(val.c_str(),value); + + triplets.push_back(Eigen::Triplet(row,col,value)); + + r++; + } + + obj.setFromTriplets(triplets.begin(),triplets.end()); + initialized = true; + } + } + } + + if(!initialized) + { + obj = Eigen::SparseMatrix(); + } + } + + // pointers + + template + IGL_INLINE typename std::enable_if::value>::type serialize(const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* pointer = getElement(doc,element,name.c_str()); + + bool isNullPtr = (obj == NULL); + + pointer->SetAttribute("isNullPtr",isNullPtr); + + if(isNullPtr == false) + serialization_xml::serialize(*obj,doc,element,name); + } + + template + IGL_INLINE typename std::enable_if::value>::type deserialize(T& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name) + { + const tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child != NULL) + { + bool isNullPtr = child->BoolAttribute("isNullPtr"); + + if(isNullPtr) + { + if(obj != NULL) + { + std::cout << "deserialization: possible memory leak for '" << typeid(obj).name() << "'" << std::endl; + obj = NULL; + } + } + else + { + if(obj != NULL) + std::cout << "deserialization: possible memory leak for '" << typeid(obj).name() << "'" << std::endl; + + obj = new typename std::remove_pointer::type(); + + serialization_xml::deserialize(*obj,doc,element,name); + } + } + } + + // helper functions + + IGL_INLINE tinyxml2::XMLElement* getElement(tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name) + { + tinyxml2::XMLElement* child = element->FirstChildElement(name.c_str()); + if(child == NULL) + { + child = doc->NewElement(name.c_str()); + element->InsertEndChild(child); + } + return child; + } + + IGL_INLINE void getAttribute(const char* src,bool& dest) + { + tinyxml2::XMLUtil::ToBool(src,&dest); + } + + IGL_INLINE void getAttribute(const char* src,char& dest) + { + dest = (char)atoi(src); + } + + IGL_INLINE void getAttribute(const char* src,std::string& dest) + { + dest = src; + } + + IGL_INLINE void getAttribute(const char* src,float& dest) + { + tinyxml2::XMLUtil::ToFloat(src,&dest); + } + + IGL_INLINE void getAttribute(const char* src,double& dest) + { + tinyxml2::XMLUtil::ToDouble(src,&dest); + } + + template + IGL_INLINE typename std::enable_if::value && std::is_unsigned::value>::type getAttribute(const char* src,T& dest) + { + unsigned int val; + tinyxml2::XMLUtil::ToUnsigned(src,&val); + dest = (T)val; + } + + template + IGL_INLINE typename std::enable_if::value && !std::is_unsigned::value>::type getAttribute(const char* src,T& dest) + { + int val; + tinyxml2::XMLUtil::ToInt(src,&val); + dest = (T)val; + } + + // tinyXML2 related stuff + static const int numForbiddenChars = 8; + static const char forbiddenChars[] ={' ','/','~','#','&','>','<','='}; + + IGL_INLINE void replaceSubString(std::string& str,const std::string& search,const std::string& replace) + { + size_t pos = 0; + while((pos = str.find(search,pos)) != std::string::npos) + { + str.replace(pos,search.length(),replace); + pos += replace.length(); + } + } + + IGL_INLINE void encodeXMLElementName(std::string& name) + { + // must not start with a digit + if(isdigit(*name.begin())) + { + name = ":::" + name; + } + + std::stringstream stream; + for(int i=0;i> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for(i = 0; (i <4) ; i++) + ret += base64_chars[char_array_4[i]]; + + i = 0; + } + } + + if(i) + { + for(j = i; j < 3; j++) + char_array_3[j] = '\0'; + + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for(j = 0; (j < i + 1); j++) + ret += base64_chars[char_array_4[j]]; + + while((i++ < 3)) + ret += '='; + } + + return ret; + } + + std::string base64_decode(std::string const& encoded_string) + { + int in_len = encoded_string.size(); + int i = 0; + int j = 0; + int in_ = 0; + unsigned char char_array_4[4],char_array_3[3]; + std::string ret; + + // construct fast lookup table + // added by Christian Sch�ller (schuellc@inf.ethz.ch) + int charLookup[200]; + for(int i=0;i<(int)(base64_chars.length());i++) + charLookup[(int)base64_chars[i]] = i; + + while(in_len-- && (encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { + char_array_4[i++] = encoded_string[in_]; in_++; + if(i ==4) { + for(i = 0; i <4; i++) + char_array_4[i] = charLookup[char_array_4[i]]; // new fast lookup + //char_array_4[i] = base64_chars.find(char_array_4[i]); // original version + + char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for(i = 0; (i < 3); i++) + ret += char_array_3[i]; + + i = 0; + } + } + + if(i) { + for(j = i; j <4; j++) + char_array_4[j] = 0; + + for(j = 0; j <4; j++) + char_array_4[j] = base64_chars.find(char_array_4[j]); + + char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for(j = 0; (j < i - 1); + j++) ret += char_array_3[j]; + } + + return ret; + } + } + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +template void igl::xml::serialize_xml > >(std::vector > const&, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, bool, bool); +template void igl::xml::deserialize_xml > >(std::vector >&, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&); +#endif diff --git a/vendor/libigl/include/igl/xml/serialize_xml.h b/vendor/libigl/include/igl/xml/serialize_xml.h new file mode 100644 index 0000000000000000000000000000000000000000..2190f676a953dc838451fbf22c4060633aa80098 --- /dev/null +++ b/vendor/libigl/include/igl/xml/serialize_xml.h @@ -0,0 +1,247 @@ +// +// Copyright (C) 2014 Christian Sch�ller +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_XML_SERIALIZABLE_XML_H +#define IGL_XML_SERIALIZABLE_XML_H +// ----------------------------------------------------------------------------- +// Functions to save and load a serialization of fundamental c++ data types to +// and from a xml file. STL containers, Eigen matrix types and nested data +// structures are also supported. To serialize a user defined class implement +// the interface XMLSerializable or XMLSerializableBase. +// +// See also: serialize.h +// ----------------------------------------------------------------------------- + +#include "../igl_inline.h" + + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +//#define SERIALIZE_XML(x) igl::xml::serialize_xml(x,#x,doc,element); +//#define DESERIALIZE_XML(x) igl::xml::deserialize_xml(x,#x,,doc,element); + +namespace igl +{ + namespace xml + { + struct XMLSerializableBase; + // serializes the given object either to a xml file or to the provided doc data + // + // Templates: + // T type of the object to serialize + // Inputs: + // obj object to serialize + // objectName unique object name,used for the identification + // filename name of the file containing the serialization + // binary set to true to serialize the object in binary format (faster for big data) + // overwrite set to true to overwrite an existing xml file + // element tinyxml2 virtual representation of the current xml node + // Outputs: + // doc contains current tinyxml2 virtual representation of the xml data + // + template + IGL_INLINE void serialize_xml(const T& obj,const std::string& filename); + template + IGL_INLINE void serialize_xml( + const T& obj, + const std::string& objectName, + const std::string& filename, + bool binary = false, + bool overwrite = false); + template + IGL_INLINE void serialize_xml( + const T& obj, + const std::string& objectName, + tinyxml2::XMLDocument* doc, + tinyxml2::XMLElement* element, + bool binary = false); + + // deserializes the given data from a xml file or doc data back to the provided object + // + // Templates: + // T type of the object to serialize + // Inputs: + // + // objectName unique object name,used for the identification + // filename name of the file containing the serialization + // binary set to true to serialize the object in binary format (faster for big data) + // overwrite set to true to overwrite an existing xml file + // doc contains current tinyxml2 virtual representation of the xml data + // element tinyxml2 virtual representation of the current xml node + // Outputs: + // obj object to load back serialization to + // + template + IGL_INLINE void deserialize_xml(T& obj,const std::string& filename); + template + IGL_INLINE void deserialize_xml(T& obj,const std::string& objectName,const std::string& filename); + template + IGL_INLINE void deserialize_xml(T& obj,const std::string& objectName,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element); + + // internal functions + namespace serialization_xml + { + // fundamental types + template + IGL_INLINE typename std::enable_if::value>::type serialize(const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + template + IGL_INLINE typename std::enable_if::value>::type deserialize(T& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + // std::string + IGL_INLINE void serialize(const std::string& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + IGL_INLINE void deserialize(std::string& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + // XMLSerializableBase + template + IGL_INLINE typename std::enable_if::value>::type serialize(const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + template + IGL_INLINE typename std::enable_if::value>::type deserialize(T& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + // STL containers + template + IGL_INLINE void serialize(const std::pair& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + template + IGL_INLINE void deserialize(std::pair& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + template + IGL_INLINE void serialize(const std::vector& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + template + IGL_INLINE void deserialize(std::vector& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + template + IGL_INLINE void serialize(const std::set& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + template + IGL_INLINE void deserialize(std::set& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + template + IGL_INLINE void serialize(const std::map& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + template + IGL_INLINE void deserialize(std::map& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + // Eigen types + + // Serialize a Dense Eigen Matrix to xml (in the matrix= attribute, + // awkward...) + // + // Inputs: + // obj MR by MC matrix of T types + // name name of matrix + // to_string function converting T to string + // Outputs: + // doc pointer to xml document + // element pointer to xml element + // + template + IGL_INLINE void serialize( + const Eigen::Matrix& obj, + const std::string& name, + const std::function& to_string, + tinyxml2::XMLDocument* doc, + tinyxml2::XMLElement* element); + // De-Serialize a Dense Eigen Matrix from xml (in the matrix= attribute, + // awkward...) + // + // Inputs: + // doc pointer to xml document + // element pointer to xml element + // name name of matrix + // from_string function string to T + // Outputs: + // obj MR by MC matrix of T types + template + IGL_INLINE void deserialize( + const tinyxml2::XMLDocument* doc, + const tinyxml2::XMLElement* element, + const std::string& name, + const std::function & from_string, + Eigen::Matrix& obj); + + // Legacy APIs + template + IGL_INLINE void serialize( + const Eigen::Matrix& obj, + tinyxml2::XMLDocument* doc, + tinyxml2::XMLElement* element, + const std::string& name); + template + IGL_INLINE void deserialize( + Eigen::Matrix& obj, + const tinyxml2::XMLDocument* doc, + const tinyxml2::XMLElement* element, + const std::string& name); + + template + IGL_INLINE void serialize(const Eigen::SparseMatrix& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + template + IGL_INLINE void deserialize(Eigen::SparseMatrix& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + // raw pointers + template + IGL_INLINE typename std::enable_if::value>::type serialize(const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + template + IGL_INLINE typename std::enable_if::value>::type deserialize(T& obj,const tinyxml2::XMLDocument* doc,const tinyxml2::XMLElement* element,const std::string& name); + + // helper functions + tinyxml2::XMLElement* getElement(tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,const std::string& name); + IGL_INLINE void getAttribute(const char* src,bool& dest); + IGL_INLINE void getAttribute(const char* scr,char& dest); + IGL_INLINE void getAttribute(const char* src,std::string& dest); + IGL_INLINE void getAttribute(const char* src,float& dest); + IGL_INLINE void getAttribute(const char* src,double& dest); + template + IGL_INLINE typename std::enable_if::value && std::is_unsigned::value>::type getAttribute(const char* src,T& dest); + template + IGL_INLINE typename std::enable_if::value && !std::is_unsigned::value>::type getAttribute(const char* src,T& dest); + IGL_INLINE void replaceSubString(std::string& str,const std::string& search,const std::string& replace); + IGL_INLINE void encodeXMLElementName(std::string& name); + IGL_INLINE void decodeXMLElementName(std::string& name); + IGL_INLINE std::string base64_encode(unsigned char const* bytes_to_encode,unsigned int in_len); + IGL_INLINE std::string base64_decode(std::string const& encoded_string); + + // compile time type serializable check + template + struct is_stl_container { static const bool value = false; }; + template + struct is_stl_container > { static const bool value = true; }; + template + struct is_stl_container > { static const bool value = true; }; + template + struct is_stl_container > { static const bool value = true; }; + template + struct is_stl_container > { static const bool value = true; }; + + template + struct is_eigen_type { static const bool value = false; }; + template + struct is_eigen_type > { static const bool value = true; }; + template + struct is_eigen_type > { static const bool value = true; }; + + template + struct is_serializable { + using T0 = typename std::remove_pointer::type; + static const bool value = std::is_fundamental::value || std::is_same::value || std::is_base_of::value + || is_stl_container::value || is_eigen_type::value; + }; + } + } +} + +#ifndef IGL_STATIC_LIBRARY + #include "serialize_xml.cpp" +#endif + +#endif diff --git a/vendor/libigl/include/igl/xml/writeDAE.cpp b/vendor/libigl/include/igl/xml/writeDAE.cpp new file mode 100644 index 0000000000000000000000000000000000000000..44bcd0cee22402cb7471d1682960b85c4259b4c4 --- /dev/null +++ b/vendor/libigl/include/igl/xml/writeDAE.cpp @@ -0,0 +1,143 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "writeDAE.h" +#include "../STR.h" +#include +#include +#include + +template +IGL_INLINE bool igl::xml::writeDAE( + const std::string & filename, + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F) +{ + using namespace std; + using namespace Eigen; + + tinyxml2::XMLDocument* doc = new tinyxml2::XMLDocument(); + + const auto & ele = [&doc]( + const std::string tag, + // Can't just use `{}` as the default argument because of a clang-bug + // http://stackoverflow.com/questions/17264067/ + const std::map attribs = + std::map(), + const std::string text="", + const std::list children = + std::list() + )->tinyxml2::XMLElement * + { + tinyxml2::XMLElement * element = doc->NewElement(tag.c_str()); + for(const auto & key_value : attribs) + { + element->SetAttribute(key_value.first.c_str(),key_value.second.c_str()); + } + if(!text.empty()) + { + element->InsertEndChild(doc->NewText(text.c_str())); + } + for(auto & child : children) + { + element->InsertEndChild(child); + } + return element; + }; + + Eigen::IOFormat row_format(Eigen::FullPrecision,0," "," ","","",""); + doc->InsertEndChild( + ele("COLLADA", + { + {"xmlns","http://www.collada.org/2005/11/COLLADASchema"}, + {"version","1.4.1"} + }, + "", + { + ele("asset",{},"", + { + ele("unit",{{"meter","0.0254000"},{"name","inch"}}), + ele("up_axis",{},"Y_UP") + }), + ele("library_visual_scenes",{},"", + { + ele("visual_scene",{{"id","ID2"}},"", + { + ele("node",{{"name","SketchUp"}},"", + { + ele("node",{{"id","ID3"},{"name","group_0"}},"", + { + ele("matrix",{},"1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"), + ele("instance_geometry",{{"url","#ID4"}},"", + { + ele("bind_material",{},"",{ele("technique_common")}), + }), + }), + }), + }), + }), + ele("library_geometries",{},"", + { + ele("geometry",{{"id","ID4"}},"", + { + ele("mesh",{},"", + { + ele("source",{{"id","ID7"}},"", + { + ele( + "float_array", + {{"count",STR(V.size())},{"id","ID10"}}, + STR(V.format(row_format))), + ele("technique_common",{},"", + { + ele( + "accessor", + {{"count",STR(V.rows())},{"source","#ID8"},{"stride","3"}}, + "", + { + ele("param",{{"name","X"},{"type","float"}}), + ele("param",{{"name","Y"},{"type","float"}}), + ele("param",{{"name","Z"},{"type","float"}}), + }) + }) + }), + ele( + "vertices", + {{"id","ID9"}}, + "", + {ele("input",{{"semantic","POSITION"},{"source","#ID7"}})}), + ele( + "triangles", + {{"count",STR(F.rows())}}, + "", + { + ele("input",{{"semantic","VERTEX"},{"source","#ID9"}}), + ele("p",{},STR(F.format(row_format))), + }) + }) + }) + }), + ele("scene",{},"",{ele("instance_visual_scene",{{"url","#ID2"}})}), + })); + // tinyxml2 seems **not** to print the header by default, but it + // also seems that that's OK + tinyxml2::XMLError error = doc->SaveFile(filename.c_str()); + bool ret = true; + if(error != tinyxml2::XML_SUCCESS) + { + doc->PrintError(); + ret = false; + } + delete doc; + return ret; +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::xml::writeDAE, Eigen::Matrix >(std::basic_string, std::allocator > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); +#endif diff --git a/vendor/libigl/include/igl/xml/writeDAE.h b/vendor/libigl/include/igl/xml/writeDAE.h new file mode 100644 index 0000000000000000000000000000000000000000..731fe7255bf86a1201effe3fd995d3d6187335c9 --- /dev/null +++ b/vendor/libigl/include/igl/xml/writeDAE.h @@ -0,0 +1,38 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_XML_WRITEDAE_H +#define IGL_XML_WRITEDAE_H +#include "../igl_inline.h" +#include +#include +namespace igl +{ + namespace xml + { + // Write a mesh to a Collada .dae scene file. The resulting scene contains + // a single "geometry" suitable for solid operaions (boolean union, + // intersection, etc.) in SketchUp. + // + // Inputs: + // filename path to .dae file + // V #V by 3 list of vertex positions + // F #F by 3 list of face indices + // Returns true iff success + // + template + IGL_INLINE bool writeDAE( + const std::string & filename, + const Eigen::PlainObjectBase & V, + const Eigen::PlainObjectBase & F); + } +} + +#ifndef IGL_STATIC_LIBRARY +#include "writeDAE.cpp" +#endif +#endif diff --git a/vendor/libigl/include/igl/xml/write_triangle_mesh.cpp b/vendor/libigl/include/igl/xml/write_triangle_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6a39da2aff71cad40fdd7b8be766a3e9e811db29 --- /dev/null +++ b/vendor/libigl/include/igl/xml/write_triangle_mesh.cpp @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include "write_triangle_mesh.h" +#include "../write_triangle_mesh.h" +#include "../pathinfo.h" +#include "writeDAE.h" + +template +IGL_INLINE bool igl::xml::write_triangle_mesh( + const std::string str, + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const FileEncoding fe) +{ + using namespace std; + // dirname, basename, extension and filename + string d,b,e,f; + pathinfo(str,d,b,e,f); + // Convert extension to lower case + std::transform(e.begin(), e.end(), e.begin(), ::tolower); + if(e == "dae") + { + return writeDAE(str,V,F); + }else + { + return igl::write_triangle_mesh(str,V,F,fe); + } +} + +#ifdef IGL_STATIC_LIBRARY +// Explicit template instantiation +// generated by autoexplicit.sh +template bool igl::xml::write_triangle_mesh, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, igl::FileEncoding); +#endif diff --git a/vendor/libigl/include/igl/xml/write_triangle_mesh.h b/vendor/libigl/include/igl/xml/write_triangle_mesh.h new file mode 100644 index 0000000000000000000000000000000000000000..ca968eb97468f2ad0638f517c7aecf1c581e0675 --- /dev/null +++ b/vendor/libigl/include/igl/xml/write_triangle_mesh.h @@ -0,0 +1,46 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2016 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_XML_WRITE_TRIANGLE_MESH_H +#define IGL_XML_WRITE_TRIANGLE_MESH_H +#include "../igl_inline.h" +#include "../FileEncoding.h" + +#include +#include + +namespace igl +{ + namespace xml + { + // write mesh to a file with automatic detection of file format. supported: + // dae, or any of the formats supported by igl::write_triangle_mesh + // + // Templates: + // Scalar type for positions and vectors (will be read as double and cast + // to Scalar) + // Index type for indices (will be read as int and cast to Index) + // Inputs: + // str path to file + // V eigen double matrix #V by 3 + // F eigen int matrix #F by 3 + // Returns true iff success + template + IGL_INLINE bool write_triangle_mesh( + const std::string str, + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const FileEncoding fe = FileEncoding::Ascii); + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "write_triangle_mesh.cpp" +#endif + +#endif + diff --git a/vendor/libigl/tests/include/igl/MshLoader.cpp b/vendor/libigl/tests/include/igl/MshLoader.cpp new file mode 100644 index 0000000000000000000000000000000000000000..587da35df10698b644bfd32e90c8447d0a0fda84 --- /dev/null +++ b/vendor/libigl/tests/include/igl/MshLoader.cpp @@ -0,0 +1,59 @@ +#include + +#include +#include + + +TEST_CASE("MshLoader","[igl]") +{ + igl::MshLoader msh_loader(test_common::data_path("sphere_lowres_TMS_1-0001_Magstim_70mm_Fig8_nii_scalar.msh")); + + // + // size of nodes - 3xNodes (x,y,z) + // + REQUIRE( msh_loader.get_nodes().size() == (398+4506)*3 ); + + // + // size of elements: number of triangles x 3 + // number of tetrahedra x 4 + // + REQUIRE( msh_loader.get_elements().size() == (8988*3 + 25937*4) ); + // all these should have the same size + REQUIRE( msh_loader.get_elements_lengths().size() == (8988 + 25937) ); + REQUIRE( msh_loader.get_elements_ids().size() == (8988 + 25937) ); + REQUIRE( msh_loader.get_elements_types().size() == (8988 + 25937) ); + + // the test file should have identity map + REQUIRE( msh_loader.is_element_map_identity() ); + + // there should be 12 tags: 6 surface structures and 6 volume structures + // index 1st structure tag: Volumes + msh_loader.index_structures(1); + + REQUIRE( msh_loader.is_element_map_identity() ); + REQUIRE( msh_loader.get_structures().size() == 6+6 ); + + // verify that all triangle elements have length of 3 and + // tetrahedral elements have length 4 + + for(auto t =msh_loader.get_structures().begin(); + t!=msh_loader.get_structures().end(); ++t ) + { + REQUIRE(( t->el_type == igl::MshLoader::ELEMENT_TRI || + t->el_type == igl::MshLoader::ELEMENT_TET )); + + auto element_range = msh_loader.get_structure_index().equal_range(*t); + + for(auto e=element_range.first; e != element_range.second; ++e) + { + if( t->el_type == igl::MshLoader::ELEMENT_TRI ) + { + REQUIRE( msh_loader.get_elements_lengths()[e->second] == 3 ); + } else { + // t->first.el_type==MshLoader::ELEMENT_TET + REQUIRE( msh_loader.get_elements_lengths()[e->second] == 4 ); + } + } + } +} + diff --git a/vendor/libigl/tests/include/igl/MshSaver.cpp b/vendor/libigl/tests/include/igl/MshSaver.cpp new file mode 100644 index 0000000000000000000000000000000000000000..057a022e7b64057553b316a250f011035cab0597 --- /dev/null +++ b/vendor/libigl/tests/include/igl/MshSaver.cpp @@ -0,0 +1,72 @@ +#include + +#include +#include +#include + +TEST_CASE("MshSaver","[igl]") +{ + igl::MshLoader msh_loader1(test_common::data_path("sphere_lowres_TMS_1-0001_Magstim_70mm_Fig8_nii_scalar.msh")); + REQUIRE( msh_loader1.is_element_map_identity()); + + igl::MshSaver msh_saver("test_binary_sphere.msh",true); + msh_saver.save_mesh( msh_loader1.get_nodes(), + msh_loader1.get_elements(), + msh_loader1.get_elements_lengths(), + msh_loader1.get_elements_types(), + msh_loader1.get_elements_tags()[1]); + + for(size_t i=0;i +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include + +TEST_CASE("accumarray: matlab_help", "[igl]") +{ + const Eigen::VectorXd V = + (Eigen::VectorXd(5) << 101,102,103,104,105).finished(); + const Eigen::VectorXi S = + (Eigen::VectorXi(5) << 0,2,3,2,3).finished(); + Eigen::VectorXd A; + igl::accumarray(S,V,A); + const Eigen::VectorXd Agt = + (Eigen::VectorXd(4) << 101,0,206,208).finished(); + test_common::assert_eq(A,Agt); +} + +TEST_CASE("accumarray: scalar", "[igl]") +{ + const auto n = + (Eigen::VectorXi(5) << 1,2,2,4,5).finished(); + Eigen::VectorXi C; + igl::accumarray(n,1,C); + const auto Cgt = + (Eigen::VectorXi(6) << 0,1,2,0,1,1).finished(); + test_common::assert_eq(C,Cgt); +} diff --git a/vendor/libigl/tests/include/igl/avg_edge_length.cpp b/vendor/libigl/tests/include/igl/avg_edge_length.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cc15756c45d94315f3f8ce1e1ea9ca18cc7ff8b6 --- /dev/null +++ b/vendor/libigl/tests/include/igl/avg_edge_length.cpp @@ -0,0 +1,62 @@ +#include +#include +#include + + +TEST_CASE("avg_edge_length: cube", "[igl]") +{ + //The allowed error for this test + const double epsilon = 1e-15; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + //Create scaled versions of the cube + double scale = 1.0; + double huge_scale = 1.0e8; + double tiny_scale = 1.0e-8; + Eigen::MatrixXd V_huge = V * huge_scale; + Eigen::MatrixXd V_tiny = V * tiny_scale; + //Prepare another mesh with triangles along side diagonals of the cube + //These triangles are form a regular tetrahedron of side sqrt(2) + Eigen::MatrixXi F_tet(4,3); + F_tet << 4,6,1, + 6,4,3, + 4,1,3, + 1,6,3; + + //1. Check avg_edge_length function + double side_sq = 1.0; //squared lenght of a side + double diag_sq = 2.0; //squared lenght of a diagonal + double avg; + + avg = igl::avg_edge_length(V,F); + REQUIRE (avg == Approx ((12.*sqrt(side_sq) + 6.*sqrt(diag_sq))/(12.+6.)).margin( epsilon)); + + //Check the regular tetrahedron + avg = igl::avg_edge_length(V,F_tet); + REQUIRE (avg == Approx (sqrt(diag_sq)).margin( epsilon)); + + + //Scale the cube to have huge sides + side_sq = huge_scale * huge_scale; //squared lenght of a side + diag_sq = 2.0 * side_sq; //squared lenght of a diagonal + avg = igl::avg_edge_length(V_huge,F); + REQUIRE (avg == Approx ((12.*sqrt(side_sq) + 6.*sqrt(diag_sq))/(12.+6.)).margin( epsilon*huge_scale)); + + //Check the equilateral triangles + avg = igl::avg_edge_length(V_huge,F_tet); + REQUIRE (avg == Approx (sqrt(diag_sq)).margin( epsilon*huge_scale)); + + + //Scale the cube to have tiny sides + side_sq = tiny_scale * tiny_scale; //squared lenght of a side + diag_sq = 2.0 * side_sq; //squared lenght of a diagonal + avg = igl::avg_edge_length(V_tiny,F); + REQUIRE (avg == Approx ((12.*sqrt(side_sq) + 6.*sqrt(diag_sq))/(12.+6.)).margin( epsilon*tiny_scale)); + + //Check the regular tetrahedron + avg = igl::avg_edge_length(V_tiny,F_tet); + REQUIRE (avg == Approx (sqrt(diag_sq)).margin( epsilon*tiny_scale)); + +} diff --git a/vendor/libigl/tests/include/igl/barycentric_interpolation.cpp b/vendor/libigl/tests/include/igl/barycentric_interpolation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7c797a2843d7db836e707798e7923e066f5e1584 --- /dev/null +++ b/vendor/libigl/tests/include/igl/barycentric_interpolation.cpp @@ -0,0 +1,40 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include + +TEST_CASE("barycentric_interpolation: two-triangles", "[igl]") +{ + const Eigen::MatrixXd V = + (Eigen::MatrixXd(4,3) << + 0,0,0, + 1,0,0, + 1,1,0, + 0,1,0).finished(); + const Eigen::MatrixXi F = + (Eigen::MatrixXi(2,3) << 0,1,2,0,2,3).finished(); + const Eigen::VectorXi I = + (Eigen::VectorXi(4,1)<<0,0,1,1).finished(); + const Eigen::MatrixXd B = + (Eigen::MatrixXd(4,3)<< + 1,0,0, + 0.5,0.5,0, + 0.5,0.5,0, + 0.25,0.25,0.5 + ).finished(); + const Eigen::MatrixXd Xgt = + (Eigen::MatrixXd(4,3)<< + 0,0,0, + 0.5,0,0, + 0.5,0.5,0, + 0.25,0.75,0 + ).finished(); + Eigen::MatrixXd X; + igl::barycentric_interpolation(V,F,B,I,X); + test_common::assert_eq(X,Xgt); +} diff --git a/vendor/libigl/tests/include/igl/bbw.cpp b/vendor/libigl/tests/include/igl/bbw.cpp new file mode 100644 index 0000000000000000000000000000000000000000..05b01edcfbff84d77ec97d97c48718747a1d6ad4 --- /dev/null +++ b/vendor/libigl/tests/include/igl/bbw.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include +#include + +TEST_CASE("bbw: decimated_knight", "[igl]" "[slow]") +{ + Eigen::MatrixXd V,C; + Eigen::MatrixXi T,F,E; + igl::readMESH(test_common::data_path("decimated-knight.mesh"),V,T,F); + igl::readTGF(test_common::data_path("decimated-knight.tgf"),C,E); + Eigen::MatrixXd W_groundtruth, Was, Wmo; + igl::readDMAT( + test_common::data_path("decimated-knight-matlab-active-set.dmat"),W_groundtruth); + Eigen::VectorXi b; + Eigen::MatrixXd bc; + igl::boundary_conditions(V,T,C,Eigen::VectorXi(),E,Eigen::MatrixXi(),b,bc); + igl::BBWData params; + params.active_set_params.max_iter = 100; + igl::bbw(V,T,b,bc,params,Was); + // igl::writeDMAT("decimated-knight-as.dmat",Was); + REQUIRE (1e-4 > (Was-W_groundtruth).array().abs().maxCoeff()); +} + diff --git a/vendor/libigl/tests/include/igl/bezier.cpp b/vendor/libigl/tests/include/igl/bezier.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0d6878a577083976099bc5f235b1cc8d690fc449 --- /dev/null +++ b/vendor/libigl/tests/include/igl/bezier.cpp @@ -0,0 +1,33 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include + +TEST_CASE("bezier: ease", "[igl]") +{ + // Ease curve + const Eigen::MatrixXd C = + (Eigen::MatrixXd(4,2)<<0,0,0.5,0,0.5,1,1,1).finished(); + const Eigen::VectorXd T = + (Eigen::VectorXd(11,1)<<0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1).finished(); + Eigen::MatrixXd P; + igl::bezier(C,T,P); + const Eigen::MatrixXd Pexact = (Eigen::MatrixXd(11,2)<< + 0.00000000000000000,0.00000000000000000, + 0.13600000000000001,0.02800000000000001, + 0.24800000000000008,0.10400000000000004, + 0.34199999999999997,0.21599999999999997, + 0.42400000000000004,0.35200000000000004, + 0.50000000000000000,0.50000000000000000, + 0.57600000000000007,0.64800000000000002, + 0.65799999999999992,0.78399999999999992, + 0.75200000000000011,0.89600000000000013, + 0.86400000000000010,0.97200000000000009, + 1.00000000000000000,1.00000000000000000).finished(); + test_common::assert_near(P,Pexact,1e-15); +} diff --git a/vendor/libigl/tests/include/igl/blkdiag.cpp b/vendor/libigl/tests/include/igl/blkdiag.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee591443be0fec94135e6c5b1299faae0c3f542b --- /dev/null +++ b/vendor/libigl/tests/include/igl/blkdiag.cpp @@ -0,0 +1,39 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include + +TEST_CASE("blkdiag: 3-matrices", "[igl]") +{ + const Eigen::MatrixXd Ygt= + (Eigen::MatrixXd(3+0+2,3+2+5)<< + 1,2,3,0,0,0,0,0,0,0, + 4,5,6,0,0,0,0,0,0,0, + 7,8,9,0,0,0,0,0,0,0, + 0,0,0,0,0,0,1,2,3,4, + 0,0,0,0,0,5,6,7,8,9).finished(); + Eigen::MatrixXd A(3,3); + A<<1,2,3,4,5,6,7,8,9; + // This is the correct behavior for a 0×n matrix + Eigen::MatrixXd B(0,2); + Eigen::MatrixXd C(2,5); + C<<0,1,2,3,4,5,6,7,8,9; + Eigen::MatrixXd Y; + igl::blkdiag({A,B,C},Y); + test_common::assert_eq(Y,Ygt); + { + Eigen::SparseMatrix sA = A.sparseView(); + Eigen::SparseMatrix sB = B.sparseView(); + Eigen::SparseMatrix sC = C.sparseView(); + Eigen::SparseMatrix sY; + igl::blkdiag({sA,sB,sC},sY); + Y = sY; + test_common::assert_eq(Y,Ygt); + } +} + diff --git a/vendor/libigl/tests/include/igl/blue_noise.cpp b/vendor/libigl/tests/include/igl/blue_noise.cpp new file mode 100644 index 0000000000000000000000000000000000000000..995ea94ef08d5ed87d291ca8c25b25f87e47223e --- /dev/null +++ b/vendor/libigl/tests/include/igl/blue_noise.cpp @@ -0,0 +1,40 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2018 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include +#include +#include +#include +#include +#include + +TEST_CASE("blue_noise: decimated-knight", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::readOBJ(test_common::data_path("decimated-knight.obj"),V,F); + const double r = 0.01; + Eigen::MatrixXd B,P; + { + Eigen::VectorXi I; + igl::blue_noise(V,F,r,B,I,P); + } + // There should be ~4000 samples on this model + REQUIRE(P.rows() > 3000); + std::vector > point_indices; + Eigen::MatrixXi CH; + Eigen::MatrixXd CN; + Eigen::VectorXd W; + igl::octree(P,point_indices,CH,CN,W); + Eigen::MatrixXi I; + igl::knn(P,2,point_indices,CH,CN,W,I); + Eigen::MatrixXd P2; + igl::slice(P,I.col(1).eval(),1,P2); + Eigen::VectorXd D = (P-P2).rowwise().norm(); + REQUIRE(D.minCoeff() > r); +} diff --git a/vendor/libigl/tests/include/igl/boundary_facets.cpp b/vendor/libigl/tests/include/igl/boundary_facets.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f358ebe5890c9ba2964dd68ca3ff079e5d74051 --- /dev/null +++ b/vendor/libigl/tests/include/igl/boundary_facets.cpp @@ -0,0 +1,96 @@ +#include +#include +#include +#include +#include + +#include +#include + + +TEST_CASE("boundary_facets: single_tet", "[igl]") +{ + const Eigen::MatrixXi T = + (Eigen::MatrixXi(1,4)<<0,1,2,3).finished(); + Eigen::MatrixXi F; + Eigen::MatrixXi J; + Eigen::MatrixXi K; + igl::boundary_facets(T,F); + REQUIRE( F.rows () == 4 ); + // sorted! (unoriented) + const Eigen::MatrixXi sorted_Fgt = + (Eigen::MatrixXi(4,3) << + 0,1,2, + 0,1,3, + 0,2,3, + 1,2,3).finished(); + Eigen::MatrixXi sorted_F; + { + Eigen::MatrixXi _1; + igl::sort(F,2,true, sorted_F,_1); + igl::sortrows(Eigen::MatrixXi(sorted_F),true,sorted_F,_1); + } + test_common::assert_eq(sorted_Fgt,sorted_F); +} + +TEST_CASE("boundary_facets: single_cube", "[igl]") +{ + const Eigen::MatrixXi T = + (Eigen::MatrixXi(6,4)<< + 0,1,7,5, + 0,7,4,5, + 0,1,3,7, + 0,3,2,7, + 0,6,4,7, + 0,2,6,7).finished(); + const Eigen::MatrixXi Fgt = + (Eigen::MatrixXi(12,3)<< + 0,5,4, + 0,1,5, + 6,7,2, + 7,3,2, + 4,6,0, + 6,2,0, + 1,7,5, + 1,3,7, + 0,3,1, + 0,2,3, + 5,7,4, + 7,6,4).finished(); + Eigen::MatrixXi F; + Eigen::VectorXi J,K; + igl::boundary_facets(T,F,J,K); + const auto sortF = [](const Eigen::MatrixXi & F)-> Eigen::MatrixXi + { + Eigen::MatrixXi sorted_F; + igl::sort(F,2,true, sorted_F); + igl::sortrows(Eigen::MatrixXi(sorted_F),true,sorted_F); + return sorted_F; + }; + Eigen::MatrixXi sorted_F = sortF(F); + Eigen::MatrixXi sorted_Fgt = sortF(Fgt); + test_common::assert_eq(sorted_Fgt,sorted_F); + for(int f = 0;f +#include +#include +#include +#include + +TEST_CASE("boundary_loop: cube", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.off"), V, F); + + //Compute Boundary Loop + Eigen::VectorXi boundary; + igl::boundary_loop(F, boundary); + + //The cube has no boundary + REQUIRE (boundary.size() == 0); +} + +TEST_CASE("boundary_loop: bunny", "[igl]" "[slow]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //Load the Stanford bunny + igl::read_triangle_mesh(test_common::data_path("bunny.off"), V, F); + + //Compute list of ordered boundary loops for a manifold mesh + std::vector >boundaries; + igl::boundary_loop(F, boundaries); + + //Compare our result with known results taken from meshlab + REQUIRE (boundaries.size() == 5); + + //Compute min, max and sum of boundaries + size_t boundaryMin=9999999; + size_t boundaryMax=0; + size_t boundarySum=0; + for(size_t i=0; i +#include + +#include + +TEST_CASE("cat: rows", "[igl]") +{ + std::vector rows = { + Eigen::RowVector3i(1, 2, 3), + Eigen::RowVector3i(4, 5, 6), + Eigen::RowVector3i(7, 8, 9) + }; + + Eigen::MatrixXi actual; + igl::cat(1,rows,actual); + + Eigen::Matrix3i expected; + expected << 1, 2, 3, + 4, 5, 6, + 7, 8, 9; + + test_common::assert_eq(actual,expected); +} + +TEST_CASE("cat: cols", "[igl]") +{ + std::vector cols = { + Eigen::Vector3i(1, 4, 7), + Eigen::Vector3i(2, 5, 8), + Eigen::Vector3i(3, 6, 9) + }; + + Eigen::MatrixXi actual; + igl::cat(2,cols,actual); + + Eigen::Matrix3i expected; + expected << 1, 2, 3, + 4, 5, 6, + 7, 8, 9; + + test_common::assert_eq(actual,expected); +} + diff --git a/vendor/libigl/tests/include/igl/circulation.cpp b/vendor/libigl/tests/include/igl/circulation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d7709ffbd646ec79117a6e3cd35c1046259652b8 --- /dev/null +++ b/vendor/libigl/tests/include/igl/circulation.cpp @@ -0,0 +1,69 @@ +#include +#include +#include +#include +#include + +TEST_CASE("circulation: single_edge", "[igl]") +{ + // 7 + // /₆|₇\ + // 4 - 5 - 6 + // |₂/₃|₄\₅| + // 1 - 2 - 3 + // \₀|₁/ + // 0 + const Eigen::MatrixXi F = (Eigen::MatrixXi(8,3)<< + 0,2,1, + 0,3,2, + 1,5,4, + 1,2,5, + 2,3,5, + 3,6,5, + 4,5,7, + 5,6,7).finished(); + Eigen::MatrixXi E,uE; + Eigen::VectorXi EMAP; + std::vector > uE2E; + igl::unique_edge_map(F, E, uE, EMAP, uE2E); + Eigen::MatrixXi EI,EF; + { + const auto & cuE = uE; + const auto & cEMAP = EMAP; + igl::edge_flaps(F,cuE,cEMAP,EF,EI); + } + // Find (2,5) in uE + int ei = 0; + bool flip = false; + for(;ei + +#include + +#include +#include +#include +#include +#include +#include + +namespace { + + template + void assert_no_exterior_edges( + const Eigen::PlainObjectBase& F) { + Eigen::MatrixXi Eb; + igl::exterior_edges(F, Eb); + + REQUIRE (Eb.rows() == 0); + } + + template + void assert_is_manifold( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F) { + Eigen::MatrixXi B; + REQUIRE (igl::is_vertex_manifold(F, B)); + REQUIRE (igl::is_edge_manifold(F)); + } + + template + void assert_genus_eq( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const int genus) { + const int num_vertices = V.rows(); + const int num_faces = F.rows(); + + Eigen::Matrix< + typename DerivedF::Scalar, + Eigen::Dynamic, + Eigen::Dynamic> + E, uE, EMAP; + std::vector > uE2E; + igl::unique_edge_map(F, E, uE, EMAP, uE2E); + + const int num_edges = uE.rows(); + const int euler = num_vertices - num_edges + num_faces; + REQUIRE (2 - 2 * genus == euler); + } + +} + +TEST_CASE("MeshBoolean: TwoCubes", "[igl/copyleft/boolean]") { + Eigen::MatrixXd V1; + Eigen::MatrixXi F1; + igl::read_triangle_mesh(test_common::data_path("two-boxes-bad-self-union.ply"), V1, F1); + + Eigen::MatrixXd V2(0, 3); + Eigen::MatrixXi F2(0, 3); + + Eigen::MatrixXd Vo; + Eigen::MatrixXi Fo; + + igl::copyleft::cgal::mesh_boolean(V1, F1, V2, F2, + igl::MESH_BOOLEAN_TYPE_UNION, + Vo, Fo); + + assert_no_exterior_edges(Fo); + assert_is_manifold(Vo, Fo); + assert_genus_eq(Vo, Fo, 0); +} + +TEST_CASE("MeshBoolean: MinusTest", "[igl/copyleft/boolean]") { + // Many thanks to Eric Yao for submitting this test case. + Eigen::MatrixXd V1, V2, Vo; + Eigen::MatrixXi F1, F2, Fo; + igl::read_triangle_mesh(test_common::data_path("boolean_minus_test_cube.obj"), V1, F1); + igl::read_triangle_mesh(test_common::data_path("boolean_minus_test_green.obj"), V2, F2); + + igl::copyleft::cgal::mesh_boolean(V1, F1, V2, F2, + igl::MESH_BOOLEAN_TYPE_MINUS, + Vo, Fo); + + assert_no_exterior_edges(Fo); + assert_is_manifold(Vo, Fo); + assert_genus_eq(Vo, Fo, 1); +} + +TEST_CASE("MeshBoolean: IntersectWithSelf", "[igl/copyleft/boolean]") { + Eigen::MatrixXd V1, Vo; + Eigen::MatrixXi F1, Fo; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V1, F1); + + igl::copyleft::cgal::mesh_boolean(V1, F1, V1, F1, + igl::MESH_BOOLEAN_TYPE_INTERSECT, + Vo, Fo); + + assert_no_exterior_edges(Fo); + assert_is_manifold(Vo, Fo); + assert_genus_eq(Vo, Fo, 0); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/CSGTree.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/CSGTree.cpp new file mode 100644 index 0000000000000000000000000000000000000000..51807622cb43ae1302ef92da09b1f504ad9dba6b --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/CSGTree.cpp @@ -0,0 +1,17 @@ +#include + +#include + +TEST_CASE("CSGTree: extrusion", "[igl/copyleft/cgal]") { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("extrusion.obj"), V, F); + igl::copyleft::cgal::CSGTree tree(V, F); + igl::copyleft::cgal::CSGTree inter(tree, tree, "i"); // returns error + + Eigen::MatrixXd V2 = inter.cast_V(); + Eigen::MatrixXi F2 = inter.F(); + + REQUIRE (V2.rows() == V.rows()); + REQUIRE (F2.rows() == F.rows()); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/delaunay_triangulation.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/delaunay_triangulation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1c59c3c6e4598029c3a445ba5acb655d0dc08026 --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/delaunay_triangulation.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include + +TEST_CASE("igl_copyleft_cgal_delaunay_triangulation: two_triangles", "[igl/copyleft/cgal]") +{ + const Eigen::MatrixXd V = + (Eigen::MatrixXd(4,2)<< + 0,10, + 1,0, + 1,20, + 2,10).finished(); + Eigen::MatrixXi F; + igl::copyleft::cgal::delaunay_triangulation(V,F); + // Ground truth + Eigen::MatrixXi Fgt = (Eigen::MatrixXi(2,3)<<0,1,3,0,3,2).finished(); + REQUIRE (2 == F.rows()); + Eigen::MatrixXi Fu; + Eigen::VectorXi IA,IC; + igl::unique_simplices( + (Eigen::MatrixXi(4,3)< + +#include +#include +#include +#include + +TEST_CASE("hausdorff: knightVScheburashka", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd VA,VB; + Eigen::MatrixXi FA,FB; + igl::read_triangle_mesh(test_common::data_path("decimated-knight.obj"), VA, FA); + igl::read_triangle_mesh(test_common::data_path("cheburashka.off"), VB, FB); + //typedef CGAL::Epeck Kernel; + typedef CGAL::Simple_cartesian Kernel; + CGAL::AABB_tree< + CGAL::AABB_traits >::iterator + > + > + > treeB; + std::vector > TB; + { + igl::copyleft::cgal::point_mesh_squared_distance_precompute(VB,FB,treeB,TB); + } + std::vector U(5); + for(int j = 0;j0) + { + igl::upsample(Eigen::MatrixXd(VA),Eigen::MatrixXi(FA),VA,FA); + } + const int m = FA.rows(); + U[j].resize(m); + for(int i = 0;i0&&i%4==3) + { + double u4 = std::numeric_limits::infinity(); + for(int u = 0;u<4;u++) + { + u4 = std::min(u4,U[j](i-u)); + } + REQUIRE (U[j-1](i/4) >= u4); + } + } + break; + } +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/mesh_to_polyhedron.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/mesh_to_polyhedron.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4dcb97dfc259cf320259de103112d873765a4ef8 --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/mesh_to_polyhedron.cpp @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include + +TEST_CASE( + "igl_copyleft_cgal_mesh_to_polyhedron: positive", + "[igl/copyleft/cgal/]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path(param), V, F); + CGAL::Polyhedron_3< + CGAL::Simple_cartesian, + CGAL::Polyhedron_items_with_id_3, + CGAL::HalfedgeDS_default, + std::allocator > + poly; + REQUIRE ( igl::copyleft::cgal::mesh_to_polyhedron(V,F,poly) ); + }; + + test_common::run_test_cases(test_common::manifold_meshes(), test_case); +} + +TEST_CASE( + "igl_copyleft_cgal_mesh_to_polyhedron: negative", + "[igl/copyleft/cgal/]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("truck.obj"), V, F); + CGAL::Polyhedron_3< + CGAL::Simple_cartesian, + CGAL::Polyhedron_items_with_id_3, + CGAL::HalfedgeDS_default, + std::allocator > + poly; + REQUIRE (! igl::copyleft::cgal::mesh_to_polyhedron(V,F,poly) ); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/order_facets_around_edges.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/order_facets_around_edges.cpp new file mode 100644 index 0000000000000000000000000000000000000000..08309e9b8ebaa3d58be1dca24ee3f21be9cc9239 --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/order_facets_around_edges.cpp @@ -0,0 +1,201 @@ +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace { + +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; + +template +size_t index_of(const std::vector& array, T val) { + auto loc = std::find(array.begin(), array.end(), val); + assert(loc != array.end()); + return loc - array.begin(); +} + +void assert_consistently_oriented(size_t num_faces, + const std::vector& expected_face_order, + const std::vector& e_order) { + const size_t num_items = expected_face_order.size(); + REQUIRE (e_order.size() == num_items); + + std::vector order(num_items); + std::transform(e_order.begin(), e_order.end(), order.begin(), + [=](int val) { return val % num_faces; }); + + size_t ref_start = index_of(order, expected_face_order[0]); + for (size_t i=0; i +void assert_order( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + size_t v0, size_t v1, + std::vector expected_order, const std::string& normal="") { + Eigen::MatrixXi E, uE, EMAP; + std::vector > uE2E; + igl::unique_edge_map(F, E, uE, EMAP, uE2E); + + std::vector > uE2oE; + std::vector > uE2C; + + if (normal != "") { + Eigen::MatrixXd N; + //igl::per_face_normals_stable(V, F, N); + //igl::per_face_normals(V, F, N); + igl::readDMAT(test_common::data_path(normal), N); + igl::copyleft::cgal::order_facets_around_edges( + V, F, N, uE, uE2E, uE2oE, uE2C); + } else { + igl::copyleft::cgal::order_facets_around_edges( + V, F, uE, uE2E, uE2oE, uE2C); + } + + const size_t num_faces = F.rows(); + const size_t num_uE = uE.rows(); + for (size_t i=0; i + +#include + +namespace { + +/** + * Check if the outer facet is indeed valid. + * Assumption: mesh is closed. + */ +template +void assert_outer_facet_is_correct( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + size_t fid, bool flipped) { + // Todo. +} + +} // anonymous namespace + +TEST_CASE("OuterFacet: Simple", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + const size_t num_faces = F.rows(); + + Eigen::VectorXi I(num_faces); + I.setLinSpaced(num_faces, 0, num_faces-1); + + size_t fid = num_faces + 1; + bool flipped; + igl::copyleft::cgal::outer_facet(V, F, I, fid, flipped); + + REQUIRE (num_faces > fid); + REQUIRE (!flipped); +} + +TEST_CASE("OuterFacet: DuplicatedOppositeFaces", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F1; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F1); + + Eigen::MatrixXi F2 = F1; + F2.col(0).swap(F2.col(1)); + + Eigen::MatrixXi F(F1.rows()*2, F1.cols()); + F << F1, F2; + + Eigen::VectorXi I(F.rows()); + I.setLinSpaced(F.rows(), 0, F.rows()-1); + + size_t fid = F.rows() + 1; + bool flipped; + igl::copyleft::cgal::outer_facet(V, F, I, fid, flipped); + + REQUIRE (F.rows() > fid); + REQUIRE (!flipped); +} + +TEST_CASE("OuterFacet: FullyDegnerated", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("degenerated.obj"), V, F); + + Eigen::VectorXi I(F.rows()); + I.setLinSpaced(F.rows(), 0, F.rows()-1); + + size_t fid = F.rows() + 1; + bool flipped; + igl::copyleft::cgal::outer_facet(V, F, I, fid, flipped); + + REQUIRE (F.rows() > fid); + REQUIRE (!flipped); +} + +TEST_CASE("OuterFacet: InvertedNormal", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + F.col(0).swap(F.col(1)); + + Eigen::VectorXi I(F.rows()); + I.setLinSpaced(F.rows(), 0, F.rows()-1); + + size_t fid = F.rows() + 1; + bool flipped; + igl::copyleft::cgal::outer_facet(V, F, I, fid, flipped); + + REQUIRE (F.rows() > fid); + REQUIRE (flipped); +} + +TEST_CASE("OuterFacet: SliverTet", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("sliver_tet.ply"), V, F); + + Eigen::VectorXi I(F.rows()); + I.setLinSpaced(F.rows(), 0, F.rows()-1); + + size_t fid = F.rows() + 1; + bool flipped; + igl::copyleft::cgal::outer_facet(V, F, I, fid, flipped); + + REQUIRE (F.rows() > fid); + REQUIRE (!flipped); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/outer_hull.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/outer_hull.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3f0d0126b0c8fa7d8e94fd46341d68bf9c2a4b5b --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/outer_hull.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include + +TEST_CASE("OuterHull: CubeWithFold", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("cube_with_fold.ply"), V, F); + + Eigen::MatrixXi G,J,flip; + // Is this just checking that it doesn't crash? + igl::copyleft::cgal::outer_hull_legacy(V, F, G, J, flip); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/peel_outer_hull_layers.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/peel_outer_hull_layers.cpp new file mode 100644 index 0000000000000000000000000000000000000000..086de5328fd77d9bd71f348990b2e39fc271699e --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/peel_outer_hull_layers.cpp @@ -0,0 +1,80 @@ +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +TEST_CASE("copyleft_cgal_peel_outer_hull_layers: TwoCubes", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("two-boxes-bad-self-union.ply"), V, F); + REQUIRE (V.rows() == 486); + REQUIRE (F.rows() == 708); + + typedef CGAL::Exact_predicates_exact_constructions_kernel K; + typedef K::FT Scalar; + typedef Eigen::Matrix MatrixXe; + + MatrixXe Vs; + Eigen::MatrixXi Fs, IF; + Eigen::VectorXi J, IM; + igl::copyleft::cgal::RemeshSelfIntersectionsParam param; + igl::copyleft::cgal::remesh_self_intersections(V, F, param, Vs, Fs, IF, J, IM); + + std::for_each(Fs.data(),Fs.data()+Fs.size(), + [&IM](int & a){ a=IM(a); }); + MatrixXe Vt; + Eigen::MatrixXi Ft; + igl::remove_unreferenced(Vs,Fs,Vt,Ft,IM); + const size_t num_faces = Ft.rows(); + + Eigen::VectorXi I, flipped; + size_t num_peels = igl::copyleft::cgal::peel_outer_hull_layers(Vt, Ft, I, flipped); + + Eigen::MatrixXd vertices(Vt.rows(), Vt.cols()); + std::transform(Vt.data(), Vt.data() + Vt.rows() * Vt.cols(), + vertices.data(), [](Scalar v) { return CGAL::to_double(v); }); + igl::writeOBJ("debug.obj", vertices, Ft); + + REQUIRE (I.rows() == num_faces); + REQUIRE (I.minCoeff() == 0); + REQUIRE (I.maxCoeff() == 1); +} + +TEST_CASE("PeelOuterHullLayers: CubeWithFold", "[igl/copyleft/cgal]") +{ + Eigen::Matrix V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("cube_with_fold.ply"), V, F); + + typedef CGAL::Exact_predicates_exact_constructions_kernel K; + typedef K::FT Scalar; + typedef Eigen::Matrix MatrixXe; + + MatrixXe Vs; + Eigen::MatrixXi Fs, IF; + Eigen::VectorXi J, IM; + igl::copyleft::cgal::RemeshSelfIntersectionsParam param; + igl::copyleft::cgal::remesh_self_intersections(V, F, param, Vs, Fs, IF, J, IM); + + std::for_each(Fs.data(),Fs.data()+Fs.size(), + [&IM](int & a){ a=IM(a); }); + MatrixXe Vt; + Eigen::MatrixXi Ft; + igl::remove_unreferenced(Vs,Fs,Vt,Ft,IM); + + Eigen::VectorXi I, flipped; + size_t num_peels = igl::copyleft::cgal::peel_outer_hull_layers(Vt, Ft, I, flipped); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/points_inside_component.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/points_inside_component.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e6eb314ca70dd7c9e4782bd4c5d45928cf004d36 --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/points_inside_component.cpp @@ -0,0 +1,83 @@ +#include + +#include +#include + +TEST_CASE("PointInsideComponent: simple", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V1; + Eigen::MatrixXi F1; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V1, F1); + + Eigen::MatrixXd P(4, 3); + P << 0.0, 0.0, 0.0, + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0; + Eigen::VectorXi inside; + + CHECK_NOTHROW (igl::copyleft::cgal::points_inside_component(V1, F1, P, inside)); + REQUIRE (inside[0] == 1); + REQUIRE (inside[1] == 0); + REQUIRE (inside[2] == 0); + REQUIRE (inside[3] == 0); +} + +TEST_CASE("PointInsideComponent: near_boundary", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V1; + Eigen::MatrixXi F1; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V1, F1); + + const double EPS = std::numeric_limits::epsilon(); + Eigen::MatrixXd P(6, 3); + P << 0.5 + EPS, 0.0, 0.0, + 0.0, 0.5 + EPS, 0.0, + 0.0, 0.0, 0.5 + EPS, + 0.5 - EPS, 0.0, 0.0, + 0.0, 0.5 - EPS, 0.0, + 0.0, 0.0, 0.5 - EPS; + + Eigen::VectorXi inside; + CHECK_NOTHROW (igl::copyleft::cgal::points_inside_component(V1, F1, P, inside)); + REQUIRE (inside[0] == 0); + REQUIRE (inside[1] == 0); + REQUIRE (inside[2] == 0); + REQUIRE (inside[3] == 1); + REQUIRE (inside[4] == 1); + REQUIRE (inside[5] == 1); +} + +TEST_CASE("PointInsideComponent: near_corner", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V1; + Eigen::MatrixXi F1; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V1, F1); + + const double EPS = std::numeric_limits::epsilon(); + Eigen::MatrixXd P_out(8, 3); + P_out << 0.5 + EPS, 0.5 + EPS, 0.5 + EPS, + -0.5 - EPS, 0.5 + EPS, 0.5 + EPS, + 0.5 + EPS,-0.5 - EPS, 0.5 + EPS, + -0.5 - EPS,-0.5 - EPS, 0.5 + EPS, + 0.5 + EPS, 0.5 + EPS,-0.5 - EPS, + -0.5 - EPS, 0.5 + EPS,-0.5 - EPS, + 0.5 + EPS,-0.5 - EPS,-0.5 - EPS, + -0.5 - EPS,-0.5 - EPS,-0.5 - EPS; + + Eigen::VectorXi inside; + CHECK_NOTHROW (igl::copyleft::cgal::points_inside_component(V1, F1, P_out, inside)); + REQUIRE ((inside.array()==0).all()); + + Eigen::MatrixXd P_in(8, 3); + P_in << 0.5 - EPS, 0.5 - EPS, 0.5 - EPS, + -0.5 + EPS, 0.5 - EPS, 0.5 - EPS, + 0.5 - EPS,-0.5 + EPS, 0.5 - EPS, + -0.5 + EPS,-0.5 + EPS, 0.5 - EPS, + 0.5 - EPS, 0.5 - EPS,-0.5 + EPS, + -0.5 + EPS, 0.5 - EPS,-0.5 + EPS, + 0.5 - EPS,-0.5 + EPS,-0.5 + EPS, + -0.5 + EPS,-0.5 + EPS,-0.5 + EPS; + CHECK_NOTHROW (igl::copyleft::cgal::points_inside_component(V1, F1, P_in, inside)); + REQUIRE ((inside.array()==1).all()); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/remesh_self_intersections.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/remesh_self_intersections.cpp new file mode 100644 index 0000000000000000000000000000000000000000..172a93d77be2b543c11025850880bab2de4eeafd --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/remesh_self_intersections.cpp @@ -0,0 +1,23 @@ +#include +#include + +#include +#include + +#include + +TEST_CASE("RemeshSelfIntersections: CubeWithFold", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("cube_with_fold.ply"), V, F); + + typedef CGAL::Exact_predicates_exact_constructions_kernel K; + typedef Eigen::Matrix MatrixXe; + + MatrixXe VV; + Eigen::MatrixXi FF, IF; + Eigen::VectorXi J, IM; + igl::copyleft::cgal::RemeshSelfIntersectionsParam param; + igl::copyleft::cgal::remesh_self_intersections(V, F, param, VV, FF, IF, J, IM); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/cgal/triangulate.cpp b/vendor/libigl/tests/include/igl/copyleft/cgal/triangulate.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fd80d32a76088b79ee602e199fbc71c7898a74c8 --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/cgal/triangulate.cpp @@ -0,0 +1,41 @@ +#include +#include +#include + +TEST_CASE("igl_copyleft_cgal_triangulate: sqannulus", "[igl/copyleft/cgal]") +{ + Eigen::MatrixXd V(8,2); + V<<0,0,3,0,3,3,0,3, + 1,1,1,2,2,2,2,1; + Eigen::MatrixXi E(8,2); + E<<0,1,1,2,2,3,3,0, + 4,5,5,6,6,7,7,4; + Eigen::MatrixXd H(1,2); + H<<1.5,1.5; + Eigen::MatrixXd TV; + Eigen::MatrixXi TF; + igl::copyleft::cgal::triangulate(V,E,H,false,TV,TF); + Eigen::MatrixXd gt_TV(8,2); + gt_TV<< + 0,0, + 3,0, + 3,3, + 0,3, + 1,1, + 1,2, + 2,2, + 2,1; + Eigen::MatrixXi gt_TF(8,3); + gt_TF<< + 7,4,0, + 7,0,1, + 3,0,4, + 3,5,6, + 3,4,5, + 2,6,1, + 2,3,6, + 6,7,1; + test_common::assert_eq(TV,gt_TV); + test_common::assert_eq(TF,gt_TF); +} + diff --git a/vendor/libigl/tests/include/igl/copyleft/comiso/miq.cpp b/vendor/libigl/tests/include/igl/copyleft/comiso/miq.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5113891692a51e4cd971ca812aaa865235af1f6d --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/comiso/miq.cpp @@ -0,0 +1,130 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +TEST_CASE("miq: 3_holes", "[igl/copyleft/comiso]") +{ +using namespace Eigen; + +// Input mesh +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +// Face barycenters +Eigen::MatrixXd B; + +// Cross field +Eigen::MatrixXd X1,X2; + +// Bisector field +Eigen::MatrixXd BIS1, BIS2; + +// Combed bisector +Eigen::MatrixXd BIS1_combed, BIS2_combed; + +// Per-corner, integer mismatches +Eigen::Matrix MMatch; + +// Field singularities +Eigen::Matrix isSingularity, singularityIndex; + +// Per corner seams +Eigen::Matrix Seams; + +// Combed field +Eigen::MatrixXd X1_combed, X2_combed; + +// Global parametrization +Eigen::MatrixXd UV; +Eigen::MatrixXi FUV; + +// Global parametrization (reference) +Eigen::MatrixXd UV_ref; +Eigen::MatrixXi FUV_ref; + +// Load a mesh in OFF format +igl::readOFF(test_common::data_path("3holes.off"), V, F); + +double gradient_size = 50; +double iter = 0; +double stiffness = 5.0; +bool direct_round = 0; + +// Compute face barycenters +igl::barycenter(V, F, B); + +// Contrain one face +VectorXi b(1); +b << 0; +MatrixXd bc(1, 3); +bc << 1, 0, 0; + +// Create a smooth 4-RoSy field +VectorXd S; +igl::copyleft::comiso::nrosy(V, F, b, bc, VectorXi(), VectorXd(), MatrixXd(), 4, 0.5, X1, S); + +// Find the orthogonal vector +MatrixXd B1, B2, B3; +igl::local_basis(V, F, B1, B2, B3); +X2 = igl::rotate_vectors(X1, VectorXd::Constant(1, igl::PI / 2), B1, B2); + +// Always work on the bisectors, it is more general +igl::compute_frame_field_bisectors(V, F, X1, X2, BIS1, BIS2); + +// Comb the field, implicitly defining the seams +igl::comb_cross_field(V, F, BIS1, BIS2, BIS1_combed, BIS2_combed); + +// Find the integer mismatches + igl::cross_field_mismatch(V, F, BIS1_combed, BIS2_combed, true, MMatch); + +// Find the singularities +igl::find_cross_field_singularities(V, F, MMatch, isSingularity, singularityIndex); + +// Cut the mesh, duplicating all vertices on the seams +igl::cut_mesh_from_singularities(V, F, MMatch, Seams); + +// Comb the frame-field accordingly +igl::comb_frame_field(V, F, X1, X2, BIS1_combed, BIS2_combed, X1_combed, X2_combed); + +// Global parametrization +igl::copyleft::comiso::miq(V, + F, + X1_combed, + X2_combed, + MMatch, + isSingularity, + Seams, + UV, + FUV, + gradient_size, + stiffness, + direct_round, + iter, + 5, + true); + + // Refresh the test data + // igl::writeDMAT(test_common::data_path("3holes-miq-UV.dmat"),UV); + // igl::writeDMAT(test_common::data_path("3holes-miq-FUV.dmat"),FUV); + + igl::readDMAT(test_common::data_path("3holes-miq-UV.dmat"),UV_ref); + igl::readDMAT(test_common::data_path("3holes-miq-FUV.dmat"),FUV_ref); + + REQUIRE (1e-6 > (UV-UV_ref).array().abs().maxCoeff()); + REQUIRE (1e-6 > (FUV-FUV_ref).array().abs().maxCoeff()); +} diff --git a/vendor/libigl/tests/include/igl/copyleft/tetgen/tetrahedralize.cpp b/vendor/libigl/tests/include/igl/copyleft/tetgen/tetrahedralize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bfb8b8834a1f453c7405f613c31e8de0f5584cf8 --- /dev/null +++ b/vendor/libigl/tests/include/igl/copyleft/tetgen/tetrahedralize.cpp @@ -0,0 +1,51 @@ +#include + +#include +#include + +TEST_CASE("tetrahedralize: single_tet", "[igl/copyleft/tetgen]") +{ + const Eigen::MatrixXd V = (Eigen::MatrixXd(4,3)<< + 0,0,0, + 1,0,0, + 0,1,0, + 0,0,1).finished(); + Eigen::MatrixXi F(0,3); + Eigen::MatrixXd TV; + Eigen::MatrixXi TT,TF; + igl::copyleft::tetgen::tetrahedralize(V,F,"cpQ",TV,TT,TF); + REQUIRE (4 == TV.rows()); + REQUIRE (1 == TT.rows()); + REQUIRE (4 == TF.rows()); + Eigen::MatrixXi TTcorrect = (Eigen::MatrixXi(1,4)<<0,1,2,3).finished(); + { + Eigen::VectorXi TT_XOR,IA,IB; + igl::setxor(TT,TTcorrect,TT_XOR,IA,IB); + REQUIRE (0 == TT_XOR.size()); + } + test_common::assert_eq(TV,V); +} + +TEST_CASE("tetrahedralize: schoenhardt", "[igl/copyleft/tetgen]") +{ + const Eigen::MatrixXd V = (Eigen::MatrixXd(6,3)<< + -246.2,-43.412,500, + 160.7,-191.51,500, + 85.505, 234.92,500, + 250, 0, 0, + -125, 216.51, 0, + -125,-216.51, 0).finished(); + const Eigen::MatrixXi F = (Eigen::MatrixXi(8,3)<< + 1,2,0, + 5,0,2, + 3,1,0, + 4,2,1, + 0,5,3, + 1,3,4, + 2,4,5, + 3,5,4).finished(); + Eigen::MatrixXd TV; + Eigen::MatrixXi TT,TF; + igl::copyleft::tetgen::tetrahedralize(V,F,"pQ",TV,TT,TF); + REQUIRE (V.rows() <= TV.rows()); +} diff --git a/vendor/libigl/tests/include/igl/cotmatrix.cpp b/vendor/libigl/tests/include/igl/cotmatrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2e70d88737bd736470975d0b8c4374f9aa8e94c2 --- /dev/null +++ b/vendor/libigl/tests/include/igl/cotmatrix.cpp @@ -0,0 +1,215 @@ +#include +#include +#include +#include +#include + +TEST_CASE("cotmatrix: poly", "[igl]" ) +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + // Load example mesh: GetParam() will be name of mesh file + igl::read_triangle_mesh(test_common::data_path(param), V, F); + Eigen::SparseMatrix tL,pL,pM,pP; + igl::cotmatrix(V,F,tL); + std::vector > vF; + igl::matrix_to_list(F,vF); + // trivial polygon mesh + Eigen::VectorXi I,C; + igl::polygon_corners(vF,I,C); + igl::cotmatrix(V,I,C,pL,pM,pP); + REQUIRE (tL.cols() == pL.cols()); + REQUIRE (tL.rows() == pL.rows()); + REQUIRE ( tL.isApprox(pL,1e-7) ); + }; + + test_common::run_test_cases(test_common::all_meshes(), test_case); +} + +TEST_CASE("cotmatrix: constant_in_null_space", "[igl]" "[slow]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + Eigen::SparseMatrix L; + // Load example mesh: GetParam() will be name of mesh file + igl::read_triangle_mesh(test_common::data_path(param), V, F); + igl::cotmatrix(V,F,L); + REQUIRE (L.rows() == V.rows()); + REQUIRE (L.cols() == L.rows()); + Eigen::VectorXd C = Eigen::VectorXd::Ones(L.rows()); + Eigen::VectorXd Z = Eigen::VectorXd::Zero(L.rows()); + // REQUIRE (b == a); + // REQUIRE (a==b); + // ASSERT_NEAR(a,b,1e-15) + REQUIRE (1e-12 > ((L*C)-(Z)).norm()); + }; + + test_common::run_test_cases(test_common::all_meshes(), test_case); +} + +TEST_CASE("cotmatrix: cube", "[igl]") +{ + //The allowed error for this test + const double epsilon = 1e-15; + + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + //Scale the cube to have huge sides + Eigen::MatrixXd V_huge = V * 1.0e8; + + //Scale the cube to have tiny sides + Eigen::MatrixXd V_tiny = V * 1.0e-8; + + //Check cotmatrix (Laplacian) + //The laplacian for the cube is quite singular. + //Each edge in a diagonal has two opposite angles of 90, with cotangent 0.0 each + //Each edge in a side has two opposite angle of 45, with (half)cotangen 0.5 each + //So the cotangent matrix always are (0+0) or (0.5+0.5) + Eigen::SparseMatrix L1; + igl::cotmatrix(V,F,L1); + REQUIRE (L1.rows() == V.rows()); + REQUIRE (L1.cols() == V.rows()); +//// This is hitting an Eigen bug. https://github.com/libigl/libigl/pull/1064 +// for(int f = 0;f L1; + + //Check the regular tetrahedron of side sqrt(2) + igl::cotmatrix(V,F_equi,L1); + + REQUIRE (L1.rows() == V.rows()); + REQUIRE (L1.cols() == V.rows()); + for(int f = 0;f +#include +#include +#include +#include + +TEST_CASE("cotmatrix_entries: simple", "[igl]") +{ + //The allowed error for this test + const double epsilon = 1e-15; + + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + //Prepare another mesh with triangles along side diagonals of the cube + //These triangles are form a regular tetrahedron of side sqrt(2) + Eigen::MatrixXi F_tet(4,3); + F_tet << 4,6,1, + 6,4,3, + 4,1,3, + 1,6,3; + + //1. Check cotmatrix_entries + + Eigen::MatrixXd C1; + igl::cotmatrix_entries(V,F,C1); + REQUIRE (C1.rows() == F.rows()); + REQUIRE (C1.cols() == 3); + //All angles in unit cube measure 45 or 90 degrees + //Their (half)cotangent must value 0.5 or 0.0 + for(int f = 0;f 0.1) + REQUIRE (C1(f,v) == 0.5); + else + REQUIRE (C1(f,v) == 0.0); + //All cotangents sum 1.0 for those triangles + REQUIRE (C1.row(f).sum() == 1.0); +#else + //Soft assert if we have not edge_length_squared + for(int v = 0;v<3;v++) + if (C1(f,v) > 0.1) + REQUIRE (C1(f,v) == Approx (0.5).margin( epsilon)); + else + REQUIRE (C1(f,v) == Approx (0.0).margin( epsilon)); + //All cotangents sum 1.0 for those triangles + REQUIRE (C1.row(f).sum() == Approx (1.0).margin( epsilon)); +#endif + } + + //Check the regular tetrahedron + Eigen::MatrixXd C2; + igl::cotmatrix_entries(V,F_tet,C2); + REQUIRE (C2.rows() == F_tet.rows()); + REQUIRE (C2.cols() == 3); + for(int f = 0;f 0.1) + REQUIRE (C1(f,v) == 0.5); + else + REQUIRE (C1(f,v) == 0.0); + //All cotangents sum 1.0 for those triangles + REQUIRE (C1.row(f).sum() == 1.0); +#else + //Soft assert if we have not edge_length_squared + for(int v = 0;v<3;v++) + if (C1(f,v) > 0.1) + REQUIRE (C1(f,v) == Approx (0.5).margin( epsilon)); + else + REQUIRE (C1(f,v) == Approx (0.0).margin( epsilon)); + //All cotangents sum 1.0 for those triangles + REQUIRE (C1.row(f).sum() == Approx (1.0).margin( epsilon)); +#endif + + } + + //Check the huge regular tetrahedron + igl::cotmatrix_entries(V_huge,F_tet,C2); + REQUIRE (C2.rows() == F_tet.rows()); + REQUIRE (C2.cols() == 3); + for(int f = 0;f 0.1) + REQUIRE (C1(f,v) == Approx (0.5).margin( epsilon)); + else + REQUIRE (C1(f,v) == Approx (0.0).margin( epsilon)); + //All cotangents sum 1.0 for those triangles + REQUIRE (C1.row(f).sum() == Approx (1.0).margin( epsilon)); + } + + //Check the tiny regular tetrahedron + igl::cotmatrix_entries(V_tiny,F_tet,C2); + REQUIRE (C2.rows() == F_tet.rows()); + REQUIRE (C2.cols() == 3); + for(int f = 0;f()); +} diff --git a/vendor/libigl/tests/include/igl/cotmatrix_intrinsic.cpp b/vendor/libigl/tests/include/igl/cotmatrix_intrinsic.cpp new file mode 100644 index 0000000000000000000000000000000000000000..82ad6c45c2e5d4aa4477ff9d6fb8b14ce0005685 --- /dev/null +++ b/vendor/libigl/tests/include/igl/cotmatrix_intrinsic.cpp @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include + +TEST_CASE("cotmatrix_intrinsic: periodic", "[igl]") +{ + const Eigen::MatrixXi F = (Eigen::MatrixXi(18,3)<< + 0,3,1, + 3,4,1, + 1,4,2, + 4,5,2, + 2,5,0, + 5,3,0, + 3,6,4, + 6,7,4, + 4,7,5, + 7,8,5, + 5,8,3, + 8,6,3, + 6,0,7, + 0,1,7, + 7,1,8, + 1,2,8, + 8,2,6, + 2,0,6).finished(); + const Eigen::MatrixXd l = (Eigen::MatrixXd(18,3)<< + 0.47140452079103168,0.33333333333333331,0.33333333333333331, + 0.33333333333333331,0.47140452079103168,0.33333333333333331, + 0.47140452079103168,0.33333333333333331,0.33333333333333331, + 0.33333333333333331,0.47140452079103168,0.33333333333333331, + 0.47140452079103168,0.33333333333333337,0.33333333333333331, + 0.33333333333333331,0.47140452079103168,0.33333333333333337, + 0.47140452079103168,0.33333333333333331,0.33333333333333331, + 0.33333333333333331,0.47140452079103168,0.33333333333333331, + 0.47140452079103168,0.33333333333333331,0.33333333333333331, + 0.33333333333333331,0.47140452079103168,0.33333333333333331, + 0.47140452079103168,0.33333333333333337,0.33333333333333331, + 0.33333333333333331,0.47140452079103168,0.33333333333333337, + 0.47140452079103168,0.33333333333333331,0.33333333333333337, + 0.33333333333333337,0.47140452079103168,0.33333333333333331, + 0.47140452079103168,0.33333333333333331,0.33333333333333337, + 0.33333333333333337,0.47140452079103168,0.33333333333333331, + 0.47140452079103173,0.33333333333333337,0.33333333333333337, + 0.33333333333333337,0.47140452079103173,0.33333333333333337).finished(); + Eigen::SparseMatrix L; + igl::cotmatrix_intrinsic(l,F,L); + const Eigen::MatrixXd L_d = L; + const Eigen::MatrixXd L_gt = (Eigen::MatrixXd(9,9)<< + -4,1,1,1,0,0,1,0,0, + 1,-4,1,0,1,0,0,1,0, + 1,1,-4,0,0,1,0,0,1, + 1,0,0,-4,1,1,1,0,0, + 0,1,0,1,-4,1,0,1,0, + 0,0,1,1,1,-4,0,0,1, + 1,0,0,1,0,0,-4,1,1, + 0,1,0,0,1,0,1,-4,1, + 0,0,1,0,0,1,1,1,-4).finished(); + test_common::assert_near(L_d,L_gt,igl::EPS()); +} + +TEST_CASE("cotmatrix_intrinsic: manifold_meshes", "[igl]" "[slow]") +{ + auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path(param), V, F); + Eigen::MatrixXd l; + igl::edge_lengths(V,F,l); + Eigen::SparseMatrix L,Li; + igl::cotmatrix(V,F,L); + igl::cotmatrix_intrinsic(l,F,Li); + // Augh, we don't have assert_near for sparse matrices... + // Instead test that bilinear form is near equal for 2 random vectors + const Eigen::VectorXd u = Eigen::VectorXd::Random(V.rows(),1); + const Eigen::VectorXd v = Eigen::VectorXd::Random(V.rows(),1); + const double uv = u.norm()*v.norm(); + REQUIRE (u.dot(Li*v)/uv == Approx (u.dot(L*v)/uv).margin( igl::EPS())); + }; + + test_common::run_test_cases(test_common::manifold_meshes(), test_case); +} + diff --git a/vendor/libigl/tests/include/igl/cr_vector_curvature_correction.cpp b/vendor/libigl/tests/include/igl/cr_vector_curvature_correction.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b4bd187f1bf717e413fb1091e678e11c45faa04f --- /dev/null +++ b/vendor/libigl/tests/include/igl/cr_vector_curvature_correction.cpp @@ -0,0 +1,84 @@ +#include +#include +#include + +#include + + +TEST_CASE("cr_vector_curvature_correction: cube", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + Eigen::SparseMatrix K; + Eigen::MatrixXi E(12,3), oE(12,3); + //We need to provide these as unput, as orient_halfedges is + // platform-dependent (because unique_simplices is) + E.col(0) << 6,9,0,3,8,10,8,14,12,15,17,15; + E.col(1) << 0,1,7,4,6,9,16,13,2,5,11,14; + E.col(2) << 1,2,4,13,10,11,7,16,5,3,12,17; + oE.col(0) << 1,-1,1,1,-1,1,1,1,-1,1,1,-1; + oE.col(1) << -1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1; + oE.col(2) << 1,1,1,-1,-1,-1,-1,1,1,-1,1,-1; + igl::cr_vector_curvature_correction(V, F, E, oE, K); + + Eigen::MatrixXd Kexact(36,36); + Kexact << 0x1.0c152382d7359p+1,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,-0x1.ffffffffffffcp-55,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x1.0c152382d737p+1,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x1.0c152382d7359p+1,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d7359p+1,-0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x1.0c152382d737p+1,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x1.0c152382d737p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d737p+1,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x1.0c152382d737p+1,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,-0x1.7b20423d1d927p-2,0x1.0c152382d737p+1,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d737p+1,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x1.0c152382d7359p+1,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x1.7b20423d1d939p-2,-0x1.ffffffffffffcp-55,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,-0x1.7b20423d1d939p-2,0x1.0c152382d737p+1,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,-0x1.7b20423d1d939p-2,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x1.0c152382d737p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d737p+1,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x1.0c152382d737p+1,0x1.7b20423d1d927p-2,0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,-0x1.7b20423d1d927p-2,-0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x1.0c152382d737p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x1.0c152382d7359p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.0c152382d7359p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x1.ffffffffffffcp-55,0x0p+0,-0x1.7b20423d1d939p-2,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x1.ffffffffffffcp-55,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d7359p+1,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x1.0c152382d737p+1,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x1.0c152382d7359p+1,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d7359p+1,-0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x1.0c152382d737p+1,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x1.0c152382d737p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d737p+1,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x1.0c152382d737p+1,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,-0x1.7b20423d1d927p-2,0x1.0c152382d737p+1,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d737p+1,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,-0x1.7b20423d1d939p-2,0x1.ffffffffffffcp-55,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x1.0c152382d7359p+1,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x1.7b20423d1d939p-2,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,-0x1.7b20423d1d939p-2,0x1.0c152382d737p+1,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x1.0c152382d737p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c152382d737p+1,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x1.7b20423d1d927p-2,0x1.7b20423d1d939p-2,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x1.0c152382d737p+1,0x1.7b20423d1d927p-2,0x1.7b20423d1d939p-2,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,0x0p+0,0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d927p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d927p-2,0x1.0c152382d737p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffffffffffffcp-55,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffffffffffffcp-55,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x1.0c152382d7359p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b20423d1d939p-2,-0x1.ffffffffffffcp-55,0x0p+0,0x1.7b20423d1d939p-2,0x1.ffffffffffffcp-55,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.7b20423d1d939p-2,0x0p+0,0x0p+0,0x1.0c152382d7359p+1; + + test_common::assert_near(Eigen::MatrixXd(K),Kexact,1e-12); +} + + +TEST_CASE("cr_vector_curvature_correction: annulus", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a flat annulus, the curvature correction term should be 0 + igl::read_triangle_mesh(test_common::data_path("annulus.obj"), V, F); + + Eigen::SparseMatrix K; + Eigen::MatrixXi E, oE; + igl::cr_vector_curvature_correction(V, F, E, oE, K); + + //Check that all entries are zero + for(int k=0; k::InnerIterator it(K,k); it; ++it) { + CAPTURE(it.row()); + CAPTURE(it.col()); + REQUIRE(std::fabs(it.value()) < 1e-12); + } + } +} + + +TEST_CASE("cr_vector_curvature_correction: hemisphere", "[igl]") +{ + Eigen::MatrixXd V(30,3); + Eigen::MatrixXi F(50,3); + //A hemisphere + V.col(0) << 0.123210180105156,0.120042838981061,-0.0266950674667266,0.547271236313169,0.909057439262935,0.476000682243829,-0.0627939946099465,0.834953885123028,0.71004054244757,0.927898450620554,0.997139495738395,-1.0346810710285,-0.873877187970066,-0.810764436472768,-0.557847099606779,-0.648164714630689,-0.48901248727368,-0.458066890021154,2.19193809979699e-18,-0.120042838981061,-0.648164714630688,-0.104764325633049,-0.547271236313169,0.137744702760756,-0.832599789343693,-0.545107296719742,0.832599789343694,0.648164714630689,0.54727123631317,0.458066890021154; + V.col(1) << 1.03236863849097,0.873877187970063,0.496931047446973,0.780943723060875,0.476750755723684,0.202861474114298,0.0271396948845639,-0.104764325633051,0.584338896338393,0.137744702760757,-0.191109044152342,5.70069451748062e-16,-0.120042838981059,0.434627329004084,-0.192109663365432,0.796048402163832,0.297233462167295,0.797415796511911,-1.02662622390077,-0.873877187970063,-0.796048402163833,-0.567538027861204,-0.780943723060875,-0.406359788699653,-0.48901248727368,-0.545107296719744,-0.489012487273684,-0.796048402163832,-0.347271887627275,-0.797415796511911; + V.col(2) << 0.000649035932896096,0.498694326166451,0.903219087774507,0.347271887627274,0.000219431098934193,0.878695694866723,1.02556506115436,0.567538027861209,0.47361070380888,0.406359788699652,0.000797356878447526,0.000352906880537802,0.498694326166454,0.455661682402886,0.834230306986639,0.000168415577855158,0.832599789343691,0.458066890021154,0.00288477444837691,0.498694326166451,0.000168415577855185,0.834953885123031,0.347271887627274,0.927898450620554,0.29723346216729,0.650458030846682,0.29723346216729,0.000168415577855158,0.780943723060872,0.458066890021154; + F.col(0) << 3,0,5,4,3,8,8,9,9,4,4,12,11,11,14,16,15,13,17,17,17,15,0,20,22,21,14,20,22,25,25,24,24,12,20,11,10,26,10,7,5,28,27,26,29,29,29,29,27,18; + F.col(1) << 0,3,2,3,1,1,2,8,5,8,9,14,12,13,6,6,13,14,13,16,2,17,17,18,18,23,21,22,19,19,21,22,25,25,24,24,9,10,26,5,6,5,26,7,26,28,23,21,29,29; + F.col(2) << 1,4,6,8,8,2,5,5,7,9,10,13,13,15,16,2,17,16,16,2,1,0,1,22,19,6,6,24,25,21,14,25,12,14,11,12,7,7,27,28,23,23,29,28,28,23,21,19,18,19; + + Eigen::SparseMatrix K; + Eigen::MatrixXi E(50,3), oE(50,3); + //We need to provide these as input, as orient_halfedges is + // platform-dependent (because unique_simplices is) + E.col(0) << 0,14,10,15,7,5,9,21,20,33,34,46,42,47,26,10,49,50,48,12,5,4,8,57,55,28,27,69,62,60,51,70,45,52,41,44,29,30,74,24,28,23,76,32,75,71,66,60,59,63; + E.col(1) << 6,2,19,16,15,11,21,22,29,17,18,42,38,39,50,12,53,48,54,13,8,3,0,64,61,27,25,65,70,67,52,73,44,43,40,37,30,31,36,32,23,71,77,75,78,72,68,63,58,55; + E.col(2) << 1,1,9,14,6,7,11,33,22,16,17,43,37,38,25,26,47,46,49,54,13,53,4,56,57,66,51,64,61,62,67,69,73,45,65,41,34,35,35,20,19,24,74,31,76,78,72,68,77,59; + oE.col(0) << 1,-1,1,1,1,1,1,1,1,1,1,1,1,1,-1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,-1,-1,-1,1,-1,1,1; + oE.col(1) << 1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,1,1,1,1,1,1,1,-1,1,-1,1,1; + oE.col(2) << 1,-1,-1,1,-1,-1,1,-1,1,1,1,-1,-1,-1,1,1,-1,-1,-1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1; + igl::cr_vector_curvature_correction(V, F, E, oE, K); + + std::vector initvec = {0x1.682fff8d392ddp-3,0x1.aff5a461cc45cp-5,0x0p+0,0x0p+0,0x1.05fb29be0b6ep-4,0x0p+0,-0x1.5cd3d2a9daf7dp-8,0x0p+0,-0x1.b616a5bd8f6a3p-12,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.de3401d356f3cp-5,0x0p+0,0x0p+0,0x1.2bd727c0fb97cp-4,0x0p+0,-0x1.4890eeda71411p-6,0x0p+0,0x1.4cb31e9bd0b45p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.aff5a461cc45cp-5,0x1.11a0e9960aefcp-3,-0x1.6ee6884572f2ap-5,0x0p+0,0x0p+0,0x0p+0,0x1.72bae815374c8p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1731f3fe6726ep-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.de3401d356f3cp-5,0x0p+0,0x1.04b8b6e4429cbp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.1cf50411f847dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.abe82428da284p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6ee6884572f2ap-5,0x1.c21a157031ed8p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.69a8713d59bb1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.04b8b6e4429cbp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0bf24084bf5efp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.17a0ec4ee0adap-4,0x1.c1e5c333a9659p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9b920d305ae59p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.4c34bfa9b84p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0402976f98b0bp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.05fb29be0b6ep-4,0x0p+0,0x0p+0,0x1.c1e5c333a9659p-5,0x1.52e6117aab128p-3,0x0p+0,0x0p+0,0x0p+0,0x1.ec12018de8a35p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1eb519b74ecd1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2bd727c0fb97cp-4,0x0p+0,0x0p+0,0x1.4c34bfa9b84p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c01e6ef81393ap-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0e493f04bb42fp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.28dcee0a01fa6p-2,0x0p+0,-0x1.b077c9311f9bep-11,-0x1.ebbd1ea0bea77p-7,0x0p+0,0x0p+0,-0x1.dcc31652cc3b1p-6,0x0p+0,-0x1.a4a0895231147p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.993c09c11882ep-6,-0x1.949a5980834ccp-5,0x0p+0,0x0p+0,-0x1.1cb739348d936p-5,0x0p+0,0x1.24857f361a386p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5cd3d2a9daf7dp-8,0x1.72bae815374c8p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7c6daab10e3dap-3,-0x1.2a612921dff64p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.177cf474b8ap-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4890eeda71411p-6,0x1.1cf50411f847dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.daada204b543cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c9a6a95164987p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b077c9311f9bep-11,-0x1.2a612921dff64p-4,0x1.fd41b6f7c6b0ap-3,0x0p+0,0x0p+0,0x0p+0,0x1.b2e80721bef08p-5,0x0p+0,0x0p+0,0x0p+0,-0x1.2732a15ab0e31p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.993c09c11882ep-6,0x1.daada204b543cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.85413dc7808ecp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.bb448d90a6b49p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b616a5bd8f6a3p-12,0x0p+0,0x0p+0,0x0p+0,0x1.ec12018de8a35p-7,-0x1.ebbd1ea0bea77p-7,0x0p+0,0x0p+0,0x1.f6e106e687c82p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.064fc65691dbdp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.4cb31e9bd0b45p-6,0x0p+0,0x0p+0,0x0p+0,-0x1.c01e6ef81393ap-7,0x1.949a5980834ccp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.574926f149404p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3f0e19be651fap-2,-0x1.89fdf5d7cf537p-7,0x1.992c8adcbe7cfp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.86d5e0c45b894p-5,0x0p+0,0x1.2fc6b4a6faef2p-14,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b340a329f9482p-6,-0x1.94f801c26e329p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c5886b594066ap-5,0x0p+0,-0x1.b147b96b95a77p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.89fdf5d7cf537p-7,0x1.30144e045dbd2p-2,0x0p+0,0x1.9c2e4bbdee94bp-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6e5c37311e21ap-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.9ac280175031dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b340a329f9482p-6,0x0p+0,0x0p+0,0x1.c8797788c3e85p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8ab79ded52155p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.56f8181e3d7efp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.dcc31652cc3b1p-6,0x0p+0,0x1.b2e80721bef08p-5,0x0p+0,0x1.992c8adcbe7cfp-5,0x0p+0,0x1.30ede2d6c37b9p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.fab84229f479cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1cb739348d936p-5,0x0p+0,0x1.85413dc7808ecp-5,0x0p+0,0x1.94f801c26e329p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d5032683156d2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9c2e4bbdee94bp-8,0x0p+0,0x1.22dba63158f63p-2,-0x1.986ca83bb5201p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a3f6207492b2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ff3f96359043ep-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c8797788c3e85p-7,0x0p+0,0x0p+0,-0x1.6d82128a71d75p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.04ba164701572p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bd788f563b7ccp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a4a0895231147p-6,0x0p+0,0x0p+0,0x1.064fc65691dbdp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.986ca83bb5201p-7,0x1.29c47d1e9ed78p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5c3424b2aa5c1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.24857f361a386p-5,0x0p+0,0x0p+0,-0x1.574926f149404p-5,0x0p+0,0x0p+0,0x0p+0,0x1.6d82128a71d75p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5ea8fe0fbfa0ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1731f3fe6726ep-6,-0x1.69a8713d59bb1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.494f4a1de54d3p-3,0x1.30133c9507e29p-6,-0x1.7b1aa659e31afp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.abe82428da284p-5,-0x1.0bf24084bf5efp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2f42c23bea9d5p-5,0x1.a4c4f98b7ff3cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.177cf474b8ap-7,-0x1.2732a15ab0e31p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.30133c9507e29p-6,0x1.b41c0b38e89bp-3,0x1.c6e4db1137b5bp-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c9a6a95164987p-7,0x1.bb448d90a6b49p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2f42c23bea9d5p-5,0x0p+0,0x1.52f0af6145431p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b1aa659e31afp-4,0x1.c6e4db1137b5bp-10,0x1.8efa8894d901bp-3,-0x1.8ef0c21cc6183p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d8206573dc384p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a4c4f98b7ff3cp-5,-0x1.52f0af6145431p-5,0x0p+0,0x1.30f1a7170c08fp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bd37bca5ccceap-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8ef0c21cc6183p-5,0x1.17e913e28f395p-3,0x1.f478cf6a89041p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e6ba024ea4c3ep-8,-0x1.232d046ff2dbp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.30f1a7170c08fp-4,0x0p+0,-0x1.2c42e34651f37p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b9450e7da6566p-7,-0x1.8006a2edd4fbcp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f478cf6a89041p-6,0x1.86dd403e3c2a3p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f0cf1d0e3fdfdp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2c42e34651f37p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2dc73663979eep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.86d5e0c45b894p-5,-0x1.6e5c37311e21ap-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.290230dce38f4p-2,0x0p+0,0x0p+0,0x0p+0,0x1.700c0f8eefd17p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.52ba06608187cp-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c5886b594066ap-5,0x1.8ab79ded52155p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5d9428bbc5e7ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0205cf55bcd62p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bab6222286405p-3,0x0p+0,0x1.a45513fb349f8p-5,0x0p+0,0x1.a8d377956f3e1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6d01a7d50e59bp-11,0x0p+0,0x0p+0,-0x1.277baaac0678cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b92635ce72cf7p-6,0x0p+0,0x1.a983884db04ebp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ba32da4dbc90fp-7,0x0p+0,0x0p+0,0x1.5e9a43373581bp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2fc6b4a6faef2p-14,0x0p+0,-0x1.fab84229f479cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2bb8ebe3ae8afp-2,-0x1.4956915754441p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2abc3fb6fd4cbp-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b147b96b95a77p-10,0x0p+0,-0x1.d5032683156d2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5cc5ec5480a9cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d36c0c5d665a1p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a45513fb349f8p-5,-0x1.4956915754441p-5,0x1.eceefdbc040aap-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.11771a91897f3p-6,0x0p+0,0x0p+0,0x0p+0,0x1.f2c5f0726c416p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b92635ce72cf7p-6,0x1.5cc5ec5480a9cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.cda17a8fe1c4fp-6,0x0p+0,0x0p+0,0x0p+0,0x1.c363aca0e9663p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.700c0f8eefd17p-5,0x0p+0,0x0p+0,0x0p+0,0x1.0487f78531196p-2,-0x1.5d1253050851p-5,0x0p+0,0x0p+0,0x0p+0,0x1.2a28c5b06dacbp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.fd62e03f741edp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5d9428bbc5e7ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.19a4d06d7c036p-5,0x0p+0,0x0p+0,0x0p+0,-0x1.b69dd77d41c0ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5a3d65b2b0fe9p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a8d377956f3e1p-6,0x0p+0,0x0p+0,-0x1.5d1253050851p-5,0x1.da8612a1a479bp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.64bee300bf9adp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.25281c3e8ab1dp-11,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a983884db04ebp-6,0x0p+0,0x0p+0,-0x1.19a4d06d7c036p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b52c8aacd450bp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.99d6cb1ecfe32p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f9364b17867eap-3,-0x1.99d71a8f13d01p-6,0x1.0a5af8e1924ffp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2cf7ed75cd59dp-6,0x1.93acbc5dd1ea5p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0b6426fee822ap-5,-0x1.b32b09d89be06p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.06b1f5b4b8ce7p-5,0x1.b356cd363949cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.9ac280175031dp-6,0x0p+0,-0x1.6a3f6207492b2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.99d71a8f13d01p-6,0x1.0f94b8edec884p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.205194ca5f9c6p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.56f8181e3d7efp-5,0x0p+0,0x1.04ba164701572p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0b6426fee822ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5824c3ac232fep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0a5af8e1924ffp-6,0x0p+0,0x1.e3247767120f6p-3,-0x1.e92f67cec840ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1c593d7b5c095p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3b8ab1e42b6a2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b32b09d89be06p-6,0x0p+0,0x0p+0,0x1.0a51dfe67c31cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ab117c60b7096p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.74098f204ed3ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.52ba06608187cp-10,0x0p+0,0x0p+0,0x0p+0,0x1.2a28c5b06dacbp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.e92f67cec840ap-5,0x1.faf363dc7047bp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.87bac25da587bp-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0205cf55bcd62p-7,0x0p+0,0x0p+0,0x0p+0,0x1.b69dd77d41c0ep-5,0x0p+0,0x0p+0,0x0p+0,-0x1.0a51dfe67c31cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d75017f5e38c4p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6d01a7d50e59bp-11,0x0p+0,0x1.11771a91897f3p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7ed344c1cd0bp-3,-0x1.55cda448b9d94p-7,0x0p+0,0x0p+0,0x0p+0,-0x1.1f897e3485183p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ba32da4dbc90fp-7,0x0p+0,0x1.cda17a8fe1c4fp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.417aaffc88021p-6,0x0p+0,0x0p+0,0x0p+0,0x1.6ba3953eb7bc5p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.55cda448b9d94p-7,0x1.303ac275e0bf8p-3,0x1.9608958065b78p-7,0x0p+0,0x0p+0,-0x1.22f4d8c757ab9p-4,0x1.52dfcfc833d47p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.417aaffc88021p-6,0x0p+0,0x1.c8a4e380ddd4fp-7,0x0p+0,0x0p+0,-0x1.5b3b459546059p-5,-0x1.a3825f8a767a9p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9608958065b78p-7,0x1.4bc5063ffedbcp-3,-0x1.ac5a0a29a9106p-9,0x0p+0,0x0p+0,-0x1.90539e00e14b4p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.02c20535c5ff1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c8a4e380ddd4fp-7,0x0p+0,-0x1.27fc3a45af89ap-6,0x0p+0,0x0p+0,-0x1.2d66b4b5473cdp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.186673d0efe28p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.277baaac0678cp-6,0x0p+0,0x0p+0,0x0p+0,-0x1.64bee300bf9adp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ac5a0a29a9106p-9,0x1.aa3eb46b8358ap-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3445a0adbefd4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5e9a43373581bp-5,0x0p+0,0x0p+0,0x0p+0,0x1.b52c8aacd450bp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.27fc3a45af89ap-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.986d5a4ba970fp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d8206573dc384p-8,-0x1.e6ba024ea4c3ep-8,0x0p+0,0x0p+0,0x0p+0,-0x1.2abc3fb6fd4cbp-8,0x1.f2c5f0726c416p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.cdb6466d8d33cp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bd37bca5ccceap-7,-0x1.b9450e7da6566p-7,0x0p+0,0x0p+0,0x0p+0,-0x1.d36c0c5d665a1p-7,-0x1.c363aca0e9672p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.232d046ff2dbp-7,0x1.f0cf1d0e3fdfdp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1f897e3485183p-10,-0x1.22f4d8c757ab9p-4,0x0p+0,0x0p+0,0x0p+0,0x1.0b2019afe50e9p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8006a2edd4fbcp-5,0x1.2dc73663979eep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6ba3953eb7bc5p-6,0x1.5b3b459546059p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.52dfcfc833d47p-5,-0x1.90539e00e14b4p-9,0x0p+0,0x0p+0,0x0p+0,0x1.e2c07302ef2e4p-4,0x1.411634466311p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.12011e16b31f6p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a3825f8a767a9p-5,0x1.2d66b4b5473cdp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.184d426c0f8fcp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a4ae9ae6d3ab8p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.411634466311p-5,0x1.aa3902afb372ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.484314133cadp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.184d426c0f8fcp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0fdd168550652p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.584cddff718b8p-3,-0x1.b1aa19f77cf18p-5,0x0p+0,0x0p+0,0x1.d48818498fce2p-5,-0x1.d894ad0c90121p-12,0x0p+0,0x1.7c79fc090352ap-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2af30f9b2b557p-4,0x0p+0,0x0p+0,0x1.b1e7c48b11e9cp-5,-0x1.b8c00d89251aep-10,0x0p+0,-0x1.a9de2ffb7aaa1p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b1aa19f77cf18p-5,0x1.5b3697d737e2bp-3,-0x1.dba0a8522e362p-5,0x0p+0,0x0p+0,-0x1.1f6a679eba8d9p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.667455d185d27p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2af30f9b2b557p-4,0x0p+0,0x1.bb62ee679920ap-5,0x0p+0,0x0p+0,0x1.626ab45ff95cep-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.44ed68f0e2959p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.dba0a8522e362p-5,0x1.451ed34aec262p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.aabc65d8b047dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bb62ee679920ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ea9f228cc5cc5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e9a51f7073449p-5,-0x1.aa32f88b4cf4dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.77762ec5ecacp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e21b25c5d7a2dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3a4b4a8cc8ccap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d48818498fce2p-5,0x0p+0,0x0p+0,-0x1.aa32f88b4cf4dp-5,0x1.1a0ef7a9cc8d4p-3,0x0p+0,0x0p+0,-0x1.b727ec540e13cp-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.582acd6731db9p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b1e7c48b11e9cp-5,0x0p+0,0x0p+0,-0x1.e21b25c5d7a2dp-6,0x0p+0,0x0p+0,0x0p+0,-0x1.7916f6efb5e16p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ca68e373333b2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d894ad0c90121p-12,-0x1.1f6a679eba8d9p-10,0x0p+0,0x0p+0,0x0p+0,0x1.b5a21d321e23ep-3,-0x1.250590e95fc72p-10,0x0p+0,0x0p+0,-0x1.795fce1c2741cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b8c00d89251aep-10,-0x1.626ab45ff95cep-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.132a10dbfc9e5p-7,0x0p+0,0x0p+0,0x1.18d16b18841c3p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.250590e95fc72p-10,0x1.da9575fa52f39p-3,0x0p+0,0x1.444c0e8e729cp-5,-0x1.495e1ca35fa1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3e82fdf74bac3p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.132a10dbfc9e5p-7,0x0p+0,0x0p+0,0x1.3fe9cee7acfdep-5,-0x1.5243d3978fd3bp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c47751e537415p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7c79fc090352ap-9,0x0p+0,0x0p+0,0x0p+0,-0x1.b727ec540e13cp-8,0x0p+0,0x0p+0,0x1.6253ff3afb04p-3,-0x1.3500e5291a7a8p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.09a4fbfc2f156p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a9de2ffb7aaa1p-7,0x0p+0,0x0p+0,0x0p+0,0x1.7916f6efb5e16p-7,0x0p+0,0x0p+0,0x0p+0,0x1.a3c1c08a70a73p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.46d674ff73306p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.444c0e8e729cp-5,-0x1.3500e5291a7a8p-6,0x1.a048d66741e7p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.157c2cbc370eap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.23c49de925ac5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3fe9cee7acfdep-5,-0x1.a3c1c08a70a73p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.91cd3caa2afeep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.4246a8f98ff59p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.795fce1c2741cp-5,-0x1.495e1ca35fa1p-5,0x0p+0,0x0p+0,0x1.f8274399ce4c1p-3,0x0p+0,0x1.4f299da2ffc25p-5,0x0p+0,-0x1.8ca59ae0b998fp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.18d16b18841c3p-5,0x1.5243d3978fd3bp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0e20bb470c31p-5,0x0p+0,-0x1.560d5e92ccf32p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.667455d185d27p-9,0x1.aabc65d8b047dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8ccda5a2621b4p-3,0x0p+0,-0x1.97d5dbc6d50eap-7,0x0p+0,0x0p+0,0x0p+0,0x1.1545781c2b955p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.44ed68f0e2959p-4,0x1.ea9f228cc5cc5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0697d9b3e616ep-6,0x0p+0,0x0p+0,0x0p+0,-0x1.799fc116f2811p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4f299da2ffc25p-5,0x0p+0,0x1.132e6f99d3531p-2,-0x1.3a9fddee7de0ap-9,0x1.225d8d20333fp-10,0x0p+0,0x0p+0,0x0p+0,-0x1.b6ec4c15a46f4p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0e20bb470c31p-5,0x0p+0,0x0p+0,0x1.3334dbdec378dp-7,0x1.8d1a9d4529884p-8,0x0p+0,0x0p+0,0x0p+0,-0x1.14b2201c44cccp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.97d5dbc6d50eap-7,-0x1.3a9fddee7de0ap-9,0x1.0ab7634b905b4p-2,0x0p+0,0x0p+0,0x0p+0,0x1.6be752fec5f9cp-8,0x1.f16229b2617e4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0697d9b3e616ep-6,-0x1.3334dbdec378dp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3fc85fa038c5dp-6,-0x1.476a02c0fb46dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2cf7ed75cd59dp-6,0x1.205194ca5f9c6p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8ca59ae0b998fp-5,0x0p+0,0x1.225d8d20333fp-10,0x0p+0,0x1.f85c08bc89bdbp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.06b1f5b4b8ce7p-5,-0x1.5824c3ac2330dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.560d5e92ccf32p-5,0x0p+0,-0x1.8d1a9d4529884p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.93acbc5dd1ea5p-7,0x0p+0,0x1.1c593d7b5c095p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c53daef0d255ap-3,0x1.8fe63bda28e8dp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.409c9f7c38d86p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b356cd363949cp-6,0x0p+0,0x1.ab117c60b7096p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.11d49c8d4b7a9p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.23909af8e7d61p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3e82fdf74bac3p-10,0x0p+0,-0x1.157c2cbc370eap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8fe63bda28e8dp-7,0x1.a6d19ef65a3ap-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5a02c5d5f3efep-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c47751e537415p-8,0x0p+0,0x1.91cd3caa2afeep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.11d49c8d4b7a9p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.919d6a4173032p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9b920d305ae59p-6,-0x1.1eb519b74ecd1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1545781c2b955p-4,0x0p+0,0x1.6be752fec5f9cp-8,0x0p+0,0x0p+0,0x0p+0,0x1.760eb2245c5f4p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0402976f98b0bp-4,-0x1.0e493f04bb42fp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.799fc116f2811p-4,0x0p+0,-0x1.3fc85fa038c5dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ff3f96359043ep-7,-0x1.5c3424b2aa5c1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b6ec4c15a46f4p-5,0x1.f16229b2617e4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.27770ca212a73p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bd788f563b7ccp-5,0x1.5ea8fe0fbfa0ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.14b2201c44cccp-4,0x1.476a02c0fb46dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.60e8b23d6457ap-3,0x0p+0,-0x1.e46ad42fedcfp-5,0x0p+0,-0x1.aca4b348c6dcfp-5,0x0p+0,0x1.47a9b990756d7p-10,0x0p+0,-0x1.a3ab1d91ecea8p-11,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b351c1c5e6065p-5,0x0p+0,-0x1.3a028a732a322p-4,0x0p+0,0x1.06bab205991ffp-5,0x0p+0,0x1.961d4efc73598p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1e9abf9ecc6bfp-5,-0x1.ee63163f0c904p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2184139ca55bp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.22160ca7b43c7p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.15508cdb6b3e5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e46ad42fedcfp-5,-0x1.ee63163f0c904p-6,0x1.d4f0f63387658p-4,0x0p+0,0x0p+0,0x0p+0,0x1.4ffd0ef0fa1bap-6,0x0p+0,0x0p+0,0x1.37a98a5d01907p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b351c1c5e6065p-5,0x1.22160ca7b43c7p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.94858e06a7c66p-6,0x0p+0,0x0p+0,0x1.13cf6cc9be9fbp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.03fdff23b523bp-4,0x1.806bf14db4f4ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7c6f32cdfef4bp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5e25ec4309d11p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e3f17e01fe817p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.aca4b348c6dcfp-5,0x0p+0,0x0p+0,0x1.806bf14db4f4ap-5,0x1.4015e69d2e529p-3,0x0p+0,0x0p+0,0x0p+0,-0x1.14491e3772164p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.728121e51bfa5p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3a028a732a322p-4,0x0p+0,0x0p+0,0x1.5e25ec4309d11p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3b9962da5d877p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e5dd953ec223fp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bcb1d3e346b35p-3,0x0p+0,-0x1.f7a2fd6248a6ep-7,0x1.8b65a93bd2dd4p-11,0x0p+0,0x0p+0,0x0p+0,-0x1.538dd705e3d9fp-8,0x1.24158c4028471p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.698b2ef0c941dp-6,0x1.60b961557c99ap-7,0x0p+0,0x0p+0,0x0p+0,-0x1.1e046238e3091p-6,-0x1.9b210ec39e405p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.47a9b990756d7p-10,0x0p+0,0x1.4ffd0ef0fa1bap-6,0x0p+0,0x0p+0,0x0p+0,0x1.5b5c568cc81bbp-3,-0x1.aa21dbae9da03p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d8b6039ea7598p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.06bab205991ffp-5,0x0p+0,0x1.94858e06a7c66p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8c66d7e863d55p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a15170ac8336cp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.f7a2fd6248a6ep-7,-0x1.aa21dbae9da03p-6,0x1.7f358475fa202p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.09575146aebf4p-5,0x0p+0,0x0p+0,0x1.86d40ffeddd19p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.698b2ef0c941dp-6,0x1.8c66d7e863d55p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.4c3f1af2813fcp-5,0x0p+0,0x0p+0,0x1.186c51e72caedp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a3ab1d91ecea8p-11,0x0p+0,0x0p+0,0x0p+0,-0x1.14491e3772164p-9,0x1.8b65a93bd2dd4p-11,0x0p+0,0x0p+0,0x1.b41dc1d357d8cp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2e7117ffb165ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.961d4efc73598p-9,0x0p+0,0x0p+0,0x0p+0,0x1.3b9962da5d877p-9,-0x1.60b961557c99ap-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f0d853c1a25a1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2184139ca55bp-7,0x1.37a98a5d01907p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.887747455b21ap-4,0x1.07dd4cc2cd70fp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.3e2436397f6a6p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.15508cdb6b3e5p-5,-0x1.13cf6cc9be9fbp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a6bc6a66ee248p-5,0x0p+0,0x0p+0,0x0p+0,-0x1.1016135dad528p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.77762ec5ecacp-5,-0x1.582acd6731db9p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.07dd4cc2cd70fp-5,0x1.edfc772e2e8c9p-4,0x0p+0,0x0p+0,0x0p+0,0x1.79661b4db997ep-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3a4b4a8cc8ccap-5,0x1.ca68e373333b2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a6bc6a66ee248p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a714a85be5fap-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3b8ab1e42b6a2p-5,0x1.87bac25da587bp-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.cf9ccd9371ecep-3,0x0p+0,0x1.55793c020390ep-7,0x0p+0,0x0p+0,0x0p+0,0x1.7e97ac8ec6003p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.74098f204ed3ap-5,-0x1.d75017f5e38c4p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.14ebd4903a181p-5,0x0p+0,0x0p+0,0x0p+0,-0x1.585bf34a68a52p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.409c9f7c38d86p-5,0x1.5a02c5d5f3efep-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.538dd705e3d9fp-8,0x0p+0,0x1.09575146aebf4p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8fe21117a6389p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.23909af8e7d61p-5,-0x1.919d6a4173032p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1e046238e3091p-6,0x0p+0,0x1.4c3f1af2813fcp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24158c4028471p-5,0x0p+0,0x0p+0,0x1.2e7117ffb165ap-5,0x0p+0,0x0p+0,0x1.55793c020390ep-7,0x0p+0,0x1.de85c7e8d2b03p-3,0x0p+0,0x0p+0,0x0p+0,0x1.f548d505f5419p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9b210ec39e405p-5,0x0p+0,0x0p+0,-0x1.f0d853c1a25a1p-6,0x0p+0,0x0p+0,-0x1.14ebd4903a181p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d45b0f784d80cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3e2436397f6a6p-9,0x1.79661b4db997ep-8,0x0p+0,0x0p+0,0x0p+0,0x1.2de149e1f5c08p-3,-0x1.bd4c5ee372c63p-8,0x0p+0,0x0p+0,0x1.3174ee211cb52p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1016135dad528p-7,0x1.a714a85be5fap-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3830f1385f751p-6,0x0p+0,0x0p+0,-0x1.878c280c25112p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d8b6039ea7598p-10,0x1.86d40ffeddd19p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bd4c5ee372c63p-8,0x1.69d6e181b2d02p-3,0x0p+0,0x0p+0,-0x1.3c740c554a821p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a15170ac8336cp-7,-0x1.186c51e72caedp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3830f1385f751p-6,0x0p+0,0x0p+0,0x0p+0,-0x1.f25a6d14dbc94p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.fd62e03f741edp-6,0x1.25281c3e8ab1dp-11,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f16518e74aee9p-3,0x1.08073dd94d855p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1fb63b8026819p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5a3d65b2b0fe9p-5,0x1.99d6cb1ecfe32p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6e8606e1fb684p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.19f293c239a13p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7e97ac8ec6003p-10,0x0p+0,0x1.f548d505f5419p-5,0x0p+0,0x0p+0,0x1.08073dd94d855p-5,0x1.e4a99a678444dp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.41238253fd4dap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.585bf34a68a52p-7,0x0p+0,-0x1.d45b0f784d80cp-6,0x0p+0,0x0p+0,-0x1.6e8606e1fb684p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.07f1577b9cf23p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.09a4fbfc2f156p-9,0x1.23c49de925ac5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3174ee211cb52p-6,-0x1.3c740c554a821p-6,0x0p+0,0x0p+0,0x1.73faa59446934p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.46d674ff73306p-7,0x1.4246a8f98ff59p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.878c280c25112p-6,0x1.f25a6d14dbcb1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.12011e16b31f1p-7,0x1.484314133cadp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.13515fccb7176p-3,0x0p+0,-0x1.29ecaf0188528p-7,-0x1.26315f43deca9p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a4ae9ae6d3ab8p-5,0x1.0fdd168550652p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0aaca05890b7ap-6,0x1.2fc8f89608e71p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.02c20535c5ff1p-5,-0x1.3445a0adbefd4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c47f3eb6dd62dp-3,0x1.d5c979007e191p-6,0x0p+0,-0x1.23c6b87ba1e7ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.186673d0efe28p-5,0x1.986d5a4ba970fp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b1de4ee6fa77bp-5,0x0p+0,-0x1.867da0b315c15p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.29ecaf0188528p-7,0x1.d5c979007e191p-6,0x1.a84f506d337dp-3,-0x1.5e322f9f74535p-7,-0x1.15965e2e73ea3p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0aaca05890b7ap-6,0x1.b1de4ee6fa77bp-5,0x0p+0,-0x1.f4950b684adadp-7,0x1.2c59ae9a34cb2p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7c6f32cdfef4bp-6,0x1.728121e51bfa5p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.26315f43deca9p-5,0x0p+0,-0x1.5e322f9f74535p-7,0x1.2ac21eb2a4ccfp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e3f17e01fe817p-5,0x1.e5dd953ec223fp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2fc8f89608e71p-4,0x0p+0,0x1.f4950b684adadp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1fb63b8026819p-10,0x1.41238253fd4dap-5,0x0p+0,0x0p+0,-0x1.23c6b87ba1e7ep-5,-0x1.15965e2e73ea3p-9,0x0p+0,0x1.fbb6de931eee8p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.19f293c239a13p-6,-0x1.07f1577b9cf23p-5,0x0p+0,0x0p+0,0x1.867da0b315c15p-5,-0x1.2c59ae9a34cb2p-8,0x0p+0,0x0p+0,0x0p+0,0x1.de3401d356f3cp-5,0x0p+0,0x0p+0,-0x1.2bd727c0fb97cp-4,0x0p+0,0x1.4890eeda71411p-6,0x0p+0,-0x1.4cb31e9bd0b45p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.682fff8d392ddp-3,0x1.aff5a461cc45cp-5,0x0p+0,0x0p+0,0x1.05fb29be0b6ep-4,0x0p+0,-0x1.5cd3d2a9daf7dp-8,0x0p+0,-0x1.b616a5bd8f6a3p-12,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.de3401d356f3cp-5,0x0p+0,-0x1.04b8b6e4429cbp-5,0x0p+0,0x0p+0,0x0p+0,0x1.1cf50411f847dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.abe82428da284p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.aff5a461cc45cp-5,0x1.11a0e9960aefcp-3,-0x1.6ee6884572f2ap-5,0x0p+0,0x0p+0,0x0p+0,0x1.72bae815374c8p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1731f3fe6726ep-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.04b8b6e4429cbp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0bf24084bf5efp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6ee6884572f2ap-5,0x1.c21a157031ed8p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.69a8713d59bb1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4c34bfa9b84p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0402976f98b0bp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.17a0ec4ee0adap-4,0x1.c1e5c333a9659p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9b920d305ae59p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2bd727c0fb97cp-4,0x0p+0,0x0p+0,-0x1.4c34bfa9b84p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c01e6ef81393ap-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0e493f04bb42fp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.05fb29be0b6ep-4,0x0p+0,0x0p+0,0x1.c1e5c333a9659p-5,0x1.52e6117aab128p-3,0x0p+0,0x0p+0,0x0p+0,0x1.ec12018de8a35p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1eb519b74ecd1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.993c09c11882ep-6,0x1.949a5980834ccp-5,0x0p+0,0x0p+0,0x1.1cb739348d936p-5,0x0p+0,-0x1.24857f361a386p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.28dcee0a01fa6p-2,0x0p+0,-0x1.b077c9311f9bep-11,-0x1.ebbd1ea0bea77p-7,0x0p+0,0x0p+0,-0x1.dcc31652cc3b1p-6,0x0p+0,-0x1.a4a0895231147p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.4890eeda71411p-6,-0x1.1cf50411f847dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.daada204b543cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c9a6a95164987p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5cd3d2a9daf7dp-8,0x1.72bae815374c8p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7c6daab10e3dap-3,-0x1.2a612921dff64p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.177cf474b8ap-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.993c09c11882ep-6,-0x1.daada204b543cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.85413dc7808ecp-5,0x0p+0,0x0p+0,0x0p+0,0x1.bb448d90a6b49p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b077c9311f9bep-11,-0x1.2a612921dff64p-4,0x1.fd41b6f7c6b0ap-3,0x0p+0,0x0p+0,0x0p+0,0x1.b2e80721bef08p-5,0x0p+0,0x0p+0,0x0p+0,-0x1.2732a15ab0e31p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4cb31e9bd0b45p-6,0x0p+0,0x0p+0,0x0p+0,0x1.c01e6ef81393ap-7,-0x1.949a5980834ccp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.574926f149404p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b616a5bd8f6a3p-12,0x0p+0,0x0p+0,0x0p+0,0x1.ec12018de8a35p-7,-0x1.ebbd1ea0bea77p-7,0x0p+0,0x0p+0,0x1.f6e106e687c82p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.064fc65691dbdp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b340a329f9482p-6,0x1.94f801c26e329p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c5886b594066ap-5,0x0p+0,0x1.b147b96b95a77p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3f0e19be651fap-2,-0x1.89fdf5d7cf537p-7,0x1.992c8adcbe7cfp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.86d5e0c45b894p-5,0x0p+0,0x1.2fc6b4a6faef2p-14,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b340a329f9482p-6,0x0p+0,0x0p+0,-0x1.c8797788c3e85p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8ab79ded52155p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.56f8181e3d7efp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.89fdf5d7cf537p-7,0x1.30144e045dbd2p-2,0x0p+0,0x1.9c2e4bbdee94bp-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6e5c37311e21ap-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.9ac280175031dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1cb739348d936p-5,0x0p+0,-0x1.85413dc7808ecp-5,0x0p+0,-0x1.94f801c26e329p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d5032683156d2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.dcc31652cc3b1p-6,0x0p+0,0x1.b2e80721bef08p-5,0x0p+0,0x1.992c8adcbe7cfp-5,0x0p+0,0x1.30ede2d6c37b9p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.fab84229f479cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c8797788c3e85p-7,0x0p+0,0x0p+0,0x1.6d82128a71d75p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.04ba164701572p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bd788f563b7ccp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9c2e4bbdee94bp-8,0x0p+0,0x1.22dba63158f63p-2,-0x1.986ca83bb5201p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a3f6207492b2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ff3f96359043ep-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24857f361a386p-5,0x0p+0,0x0p+0,0x1.574926f149404p-5,0x0p+0,0x0p+0,0x0p+0,-0x1.6d82128a71d75p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5ea8fe0fbfa0ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a4a0895231147p-6,0x0p+0,0x0p+0,0x1.064fc65691dbdp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.986ca83bb5201p-7,0x1.29c47d1e9ed78p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5c3424b2aa5c1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.abe82428da284p-5,0x1.0bf24084bf5efp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2f42c23bea9d5p-5,-0x1.a4c4f98b7ff3cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1731f3fe6726ep-6,-0x1.69a8713d59bb1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.494f4a1de54d3p-3,0x1.30133c9507e29p-6,-0x1.7b1aa659e31afp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c9a6a95164987p-7,-0x1.bb448d90a6b49p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2f42c23bea9d5p-5,0x0p+0,-0x1.52f0af6145431p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.177cf474b8ap-7,-0x1.2732a15ab0e31p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.30133c9507e29p-6,0x1.b41c0b38e89bp-3,0x1.c6e4db1137b5bp-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a4c4f98b7ff3cp-5,0x1.52f0af6145431p-5,0x0p+0,-0x1.30f1a7170c08fp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bd37bca5ccceap-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b1aa659e31afp-4,0x1.c6e4db1137b5bp-10,0x1.8efa8894d901bp-3,-0x1.8ef0c21cc6183p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d8206573dc384p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.30f1a7170c08fp-4,0x0p+0,0x1.2c42e34651f37p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b9450e7da6566p-7,0x1.8006a2edd4fbcp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8ef0c21cc6183p-5,0x1.17e913e28f395p-3,0x1.f478cf6a89041p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e6ba024ea4c3ep-8,-0x1.232d046ff2dbp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2c42e34651f37p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2dc73663979eep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f478cf6a89041p-6,0x1.86dd403e3c2a3p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f0cf1d0e3fdfdp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c5886b594066ap-5,-0x1.8ab79ded52155p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5d9428bbc5e7ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0205cf55bcd62p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.86d5e0c45b894p-5,-0x1.6e5c37311e21ap-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.290230dce38f4p-2,0x0p+0,0x0p+0,0x0p+0,0x1.700c0f8eefd17p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.52ba06608187cp-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b92635ce72cf7p-6,0x0p+0,-0x1.a983884db04ebp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ba32da4dbc90fp-7,0x0p+0,0x0p+0,-0x1.5e9a43373581bp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bab6222286405p-3,0x0p+0,0x1.a45513fb349f8p-5,0x0p+0,0x1.a8d377956f3e1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6d01a7d50e59bp-11,0x0p+0,0x0p+0,-0x1.277baaac0678cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b147b96b95a77p-10,0x0p+0,0x1.d5032683156d2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5cc5ec5480a9cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d36c0c5d665a1p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2fc6b4a6faef2p-14,0x0p+0,-0x1.fab84229f479cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2bb8ebe3ae8afp-2,-0x1.4956915754441p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2abc3fb6fd4cbp-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b92635ce72cf7p-6,-0x1.5cc5ec5480a9cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.cda17a8fe1c4fp-6,0x0p+0,0x0p+0,0x0p+0,-0x1.c363aca0e9663p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a45513fb349f8p-5,-0x1.4956915754441p-5,0x1.eceefdbc040aap-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.11771a91897f3p-6,0x0p+0,0x0p+0,0x0p+0,0x1.f2c5f0726c416p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5d9428bbc5e7ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.19a4d06d7c036p-5,0x0p+0,0x0p+0,0x0p+0,0x1.b69dd77d41c0ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5a3d65b2b0fe9p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.700c0f8eefd17p-5,0x0p+0,0x0p+0,0x0p+0,0x1.0487f78531196p-2,-0x1.5d1253050851p-5,0x0p+0,0x0p+0,0x0p+0,0x1.2a28c5b06dacbp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.fd62e03f741edp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a983884db04ebp-6,0x0p+0,0x0p+0,0x1.19a4d06d7c036p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b52c8aacd450bp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.99d6cb1ecfe32p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a8d377956f3e1p-6,0x0p+0,0x0p+0,-0x1.5d1253050851p-5,0x1.da8612a1a479bp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.64bee300bf9adp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.25281c3e8ab1dp-11,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0b6426fee822ap-5,0x1.b32b09d89be06p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.06b1f5b4b8ce7p-5,-0x1.b356cd363949cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f9364b17867eap-3,-0x1.99d71a8f13d01p-6,0x1.0a5af8e1924ffp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2cf7ed75cd59dp-6,0x1.93acbc5dd1ea5p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.56f8181e3d7efp-5,0x0p+0,-0x1.04ba164701572p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0b6426fee822ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5824c3ac232fep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.9ac280175031dp-6,0x0p+0,-0x1.6a3f6207492b2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.99d71a8f13d01p-6,0x1.0f94b8edec884p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.205194ca5f9c6p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b32b09d89be06p-6,0x0p+0,0x0p+0,-0x1.0a51dfe67c31cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ab117c60b7096p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.74098f204ed3ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0a5af8e1924ffp-6,0x0p+0,0x1.e3247767120f6p-3,-0x1.e92f67cec840ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1c593d7b5c095p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3b8ab1e42b6a2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0205cf55bcd62p-7,0x0p+0,0x0p+0,0x0p+0,-0x1.b69dd77d41c0ep-5,0x0p+0,0x0p+0,0x0p+0,0x1.0a51dfe67c31cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d75017f5e38c4p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.52ba06608187cp-10,0x0p+0,0x0p+0,0x0p+0,0x1.2a28c5b06dacbp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.e92f67cec840ap-5,0x1.faf363dc7047bp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.87bac25da587bp-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ba32da4dbc90fp-7,0x0p+0,-0x1.cda17a8fe1c4fp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.417aaffc88021p-6,0x0p+0,0x0p+0,0x0p+0,-0x1.6ba3953eb7bc5p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6d01a7d50e59bp-11,0x0p+0,0x1.11771a91897f3p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7ed344c1cd0bp-3,-0x1.55cda448b9d94p-7,0x0p+0,0x0p+0,0x0p+0,-0x1.1f897e3485183p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.417aaffc88021p-6,0x0p+0,-0x1.c8a4e380ddd4fp-7,0x0p+0,0x0p+0,0x1.5b3b459546059p-5,0x1.a3825f8a767a9p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.55cda448b9d94p-7,0x1.303ac275e0bf8p-3,0x1.9608958065b78p-7,0x0p+0,0x0p+0,-0x1.22f4d8c757ab9p-4,0x1.52dfcfc833d47p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c8a4e380ddd4fp-7,0x0p+0,0x1.27fc3a45af89ap-6,0x0p+0,0x0p+0,0x1.2d66b4b5473cdp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.186673d0efe28p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9608958065b78p-7,0x1.4bc5063ffedbcp-3,-0x1.ac5a0a29a9106p-9,0x0p+0,0x0p+0,-0x1.90539e00e14b4p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.02c20535c5ff1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5e9a43373581bp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.b52c8aacd450bp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.27fc3a45af89ap-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.986d5a4ba970fp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.277baaac0678cp-6,0x0p+0,0x0p+0,0x0p+0,-0x1.64bee300bf9adp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ac5a0a29a9106p-9,0x1.aa3eb46b8358ap-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3445a0adbefd4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bd37bca5ccceap-7,0x1.b9450e7da6566p-7,0x0p+0,0x0p+0,0x0p+0,0x1.d36c0c5d665a1p-7,0x1.c363aca0e9672p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d8206573dc384p-8,-0x1.e6ba024ea4c3ep-8,0x0p+0,0x0p+0,0x0p+0,-0x1.2abc3fb6fd4cbp-8,0x1.f2c5f0726c416p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.cdb6466d8d33cp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8006a2edd4fbcp-5,-0x1.2dc73663979eep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6ba3953eb7bc5p-6,-0x1.5b3b459546059p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.232d046ff2dbp-7,0x1.f0cf1d0e3fdfdp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1f897e3485183p-10,-0x1.22f4d8c757ab9p-4,0x0p+0,0x0p+0,0x0p+0,0x1.0b2019afe50e9p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a3825f8a767a9p-5,-0x1.2d66b4b5473cdp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.184d426c0f8fcp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a4ae9ae6d3ab8p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.52dfcfc833d47p-5,-0x1.90539e00e14b4p-9,0x0p+0,0x0p+0,0x0p+0,0x1.e2c07302ef2e4p-4,0x1.411634466311p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.12011e16b31f6p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.184d426c0f8fcp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0fdd168550652p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.411634466311p-5,0x1.aa3902afb372ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.484314133cadp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2af30f9b2b557p-4,0x0p+0,0x0p+0,-0x1.b1e7c48b11e9cp-5,0x1.b8c00d89251aep-10,0x0p+0,0x1.a9de2ffb7aaa1p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.584cddff718b8p-3,-0x1.b1aa19f77cf18p-5,0x0p+0,0x0p+0,0x1.d48818498fce2p-5,-0x1.d894ad0c90121p-12,0x0p+0,0x1.7c79fc090352ap-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2af30f9b2b557p-4,0x0p+0,-0x1.bb62ee679920ap-5,0x0p+0,0x0p+0,-0x1.626ab45ff95cep-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.44ed68f0e2959p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b1aa19f77cf18p-5,0x1.5b3697d737e2bp-3,-0x1.dba0a8522e362p-5,0x0p+0,0x0p+0,-0x1.1f6a679eba8d9p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.667455d185d27p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bb62ee679920ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ea9f228cc5cc5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.dba0a8522e362p-5,0x1.451ed34aec262p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.aabc65d8b047dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e21b25c5d7a2dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3a4b4a8cc8ccap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e9a51f7073449p-5,-0x1.aa32f88b4cf4dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.77762ec5ecacp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b1e7c48b11e9cp-5,0x0p+0,0x0p+0,0x1.e21b25c5d7a2dp-6,0x0p+0,0x0p+0,0x0p+0,0x1.7916f6efb5e16p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ca68e373333b2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d48818498fce2p-5,0x0p+0,0x0p+0,-0x1.aa32f88b4cf4dp-5,0x1.1a0ef7a9cc8d4p-3,0x0p+0,0x0p+0,-0x1.b727ec540e13cp-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.582acd6731db9p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b8c00d89251aep-10,0x1.626ab45ff95cep-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.132a10dbfc9e5p-7,0x0p+0,0x0p+0,-0x1.18d16b18841c3p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d894ad0c90121p-12,-0x1.1f6a679eba8d9p-10,0x0p+0,0x0p+0,0x0p+0,0x1.b5a21d321e23ep-3,-0x1.250590e95fc72p-10,0x0p+0,0x0p+0,-0x1.795fce1c2741cp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.132a10dbfc9e5p-7,0x0p+0,0x0p+0,-0x1.3fe9cee7acfdep-5,0x1.5243d3978fd3bp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c47751e537415p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.250590e95fc72p-10,0x1.da9575fa52f39p-3,0x0p+0,0x1.444c0e8e729cp-5,-0x1.495e1ca35fa1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3e82fdf74bac3p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a9de2ffb7aaa1p-7,0x0p+0,0x0p+0,0x0p+0,-0x1.7916f6efb5e16p-7,0x0p+0,0x0p+0,0x0p+0,-0x1.a3c1c08a70a73p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.46d674ff73306p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7c79fc090352ap-9,0x0p+0,0x0p+0,0x0p+0,-0x1.b727ec540e13cp-8,0x0p+0,0x0p+0,0x1.6253ff3afb04p-3,-0x1.3500e5291a7a8p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.09a4fbfc2f156p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3fe9cee7acfdep-5,0x1.a3c1c08a70a73p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.91cd3caa2afeep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4246a8f98ff59p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.444c0e8e729cp-5,-0x1.3500e5291a7a8p-6,0x1.a048d66741e7p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.157c2cbc370eap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.23c49de925ac5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.18d16b18841c3p-5,-0x1.5243d3978fd3bp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0e20bb470c31p-5,0x0p+0,0x1.560d5e92ccf32p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.795fce1c2741cp-5,-0x1.495e1ca35fa1p-5,0x0p+0,0x0p+0,0x1.f8274399ce4c1p-3,0x0p+0,0x1.4f299da2ffc25p-5,0x0p+0,-0x1.8ca59ae0b998fp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.44ed68f0e2959p-4,-0x1.ea9f228cc5cc5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0697d9b3e616ep-6,0x0p+0,0x0p+0,0x0p+0,0x1.799fc116f2811p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.667455d185d27p-9,0x1.aabc65d8b047dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8ccda5a2621b4p-3,0x0p+0,-0x1.97d5dbc6d50eap-7,0x0p+0,0x0p+0,0x0p+0,0x1.1545781c2b955p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0e20bb470c31p-5,0x0p+0,0x0p+0,-0x1.3334dbdec378dp-7,-0x1.8d1a9d4529884p-8,0x0p+0,0x0p+0,0x0p+0,0x1.14b2201c44cccp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4f299da2ffc25p-5,0x0p+0,0x1.132e6f99d3531p-2,-0x1.3a9fddee7de0ap-9,0x1.225d8d20333fp-10,0x0p+0,0x0p+0,0x0p+0,-0x1.b6ec4c15a46f4p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0697d9b3e616ep-6,0x1.3334dbdec378dp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3fc85fa038c5dp-6,0x1.476a02c0fb46dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.97d5dbc6d50eap-7,-0x1.3a9fddee7de0ap-9,0x1.0ab7634b905b4p-2,0x0p+0,0x0p+0,0x0p+0,0x1.6be752fec5f9cp-8,0x1.f16229b2617e4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.06b1f5b4b8ce7p-5,0x1.5824c3ac2330dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.560d5e92ccf32p-5,0x0p+0,0x1.8d1a9d4529884p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2cf7ed75cd59dp-6,0x1.205194ca5f9c6p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8ca59ae0b998fp-5,0x0p+0,0x1.225d8d20333fp-10,0x0p+0,0x1.f85c08bc89bdbp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b356cd363949cp-6,0x0p+0,-0x1.ab117c60b7096p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.11d49c8d4b7a9p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.23909af8e7d61p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.93acbc5dd1ea5p-7,0x0p+0,0x1.1c593d7b5c095p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c53daef0d255ap-3,0x1.8fe63bda28e8dp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.409c9f7c38d86p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c47751e537415p-8,0x0p+0,-0x1.91cd3caa2afeep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.11d49c8d4b7a9p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.919d6a4173032p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3e82fdf74bac3p-10,0x0p+0,-0x1.157c2cbc370eap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8fe63bda28e8dp-7,0x1.a6d19ef65a3ap-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5a02c5d5f3efep-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0402976f98b0bp-4,0x1.0e493f04bb42fp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.799fc116f2811p-4,0x0p+0,0x1.3fc85fa038c5dp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9b920d305ae59p-6,-0x1.1eb519b74ecd1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1545781c2b955p-4,0x0p+0,0x1.6be752fec5f9cp-8,0x0p+0,0x0p+0,0x0p+0,0x1.760eb2245c5f4p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bd788f563b7ccp-5,-0x1.5ea8fe0fbfa0ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.14b2201c44cccp-4,-0x1.476a02c0fb46dp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ff3f96359043ep-7,-0x1.5c3424b2aa5c1p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b6ec4c15a46f4p-5,0x1.f16229b2617e4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.27770ca212a73p-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b351c1c5e6065p-5,0x0p+0,0x1.3a028a732a322p-4,0x0p+0,-0x1.06bab205991ffp-5,0x0p+0,-0x1.961d4efc73598p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.60e8b23d6457ap-3,0x0p+0,-0x1.e46ad42fedcfp-5,0x0p+0,-0x1.aca4b348c6dcfp-5,0x0p+0,0x1.47a9b990756d7p-10,0x0p+0,-0x1.a3ab1d91ecea8p-11,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.22160ca7b43c7p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.15508cdb6b3e5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1e9abf9ecc6bfp-5,-0x1.ee63163f0c904p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2184139ca55bp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b351c1c5e6065p-5,-0x1.22160ca7b43c7p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.94858e06a7c66p-6,0x0p+0,0x0p+0,-0x1.13cf6cc9be9fbp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e46ad42fedcfp-5,-0x1.ee63163f0c904p-6,0x1.d4f0f63387658p-4,0x0p+0,0x0p+0,0x0p+0,0x1.4ffd0ef0fa1bap-6,0x0p+0,0x0p+0,0x1.37a98a5d01907p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5e25ec4309d11p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e3f17e01fe817p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.03fdff23b523bp-4,0x1.806bf14db4f4ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7c6f32cdfef4bp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3a028a732a322p-4,0x0p+0,0x0p+0,-0x1.5e25ec4309d11p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3b9962da5d877p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e5dd953ec223fp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.aca4b348c6dcfp-5,0x0p+0,0x0p+0,0x1.806bf14db4f4ap-5,0x1.4015e69d2e529p-3,0x0p+0,0x0p+0,0x0p+0,-0x1.14491e3772164p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.728121e51bfa5p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.698b2ef0c941dp-6,-0x1.60b961557c99ap-7,0x0p+0,0x0p+0,0x0p+0,0x1.1e046238e3091p-6,0x1.9b210ec39e405p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bcb1d3e346b35p-3,0x0p+0,-0x1.f7a2fd6248a6ep-7,0x1.8b65a93bd2dd4p-11,0x0p+0,0x0p+0,0x0p+0,-0x1.538dd705e3d9fp-8,0x1.24158c4028471p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.06bab205991ffp-5,0x0p+0,-0x1.94858e06a7c66p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8c66d7e863d55p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a15170ac8336cp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.47a9b990756d7p-10,0x0p+0,0x1.4ffd0ef0fa1bap-6,0x0p+0,0x0p+0,0x0p+0,0x1.5b5c568cc81bbp-3,-0x1.aa21dbae9da03p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d8b6039ea7598p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.698b2ef0c941dp-6,-0x1.8c66d7e863d55p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4c3f1af2813fcp-5,0x0p+0,0x0p+0,-0x1.186c51e72caedp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.f7a2fd6248a6ep-7,-0x1.aa21dbae9da03p-6,0x1.7f358475fa202p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.09575146aebf4p-5,0x0p+0,0x0p+0,0x1.86d40ffeddd19p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.961d4efc73598p-9,0x0p+0,0x0p+0,0x0p+0,-0x1.3b9962da5d877p-9,0x1.60b961557c99ap-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.f0d853c1a25a1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a3ab1d91ecea8p-11,0x0p+0,0x0p+0,0x0p+0,-0x1.14491e3772164p-9,0x1.8b65a93bd2dd4p-11,0x0p+0,0x0p+0,0x1.b41dc1d357d8cp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2e7117ffb165ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.15508cdb6b3e5p-5,0x1.13cf6cc9be9fbp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a6bc6a66ee248p-5,0x0p+0,0x0p+0,0x0p+0,0x1.1016135dad528p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2184139ca55bp-7,0x1.37a98a5d01907p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.887747455b21ap-4,0x1.07dd4cc2cd70fp-5,0x0p+0,0x0p+0,0x0p+0,-0x1.3e2436397f6a6p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3a4b4a8cc8ccap-5,-0x1.ca68e373333b2p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a6bc6a66ee248p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a714a85be5fap-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.77762ec5ecacp-5,-0x1.582acd6731db9p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.07dd4cc2cd70fp-5,0x1.edfc772e2e8c9p-4,0x0p+0,0x0p+0,0x0p+0,0x1.79661b4db997ep-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.74098f204ed3ap-5,0x1.d75017f5e38c4p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.14ebd4903a181p-5,0x0p+0,0x0p+0,0x0p+0,0x1.585bf34a68a52p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3b8ab1e42b6a2p-5,0x1.87bac25da587bp-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.cf9ccd9371ecep-3,0x0p+0,0x1.55793c020390ep-7,0x0p+0,0x0p+0,0x0p+0,0x1.7e97ac8ec6003p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.23909af8e7d61p-5,0x1.919d6a4173032p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1e046238e3091p-6,0x0p+0,-0x1.4c3f1af2813fcp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.409c9f7c38d86p-5,0x1.5a02c5d5f3efep-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.538dd705e3d9fp-8,0x0p+0,0x1.09575146aebf4p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8fe21117a6389p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.9b210ec39e405p-5,0x0p+0,0x0p+0,0x1.f0d853c1a25a1p-6,0x0p+0,0x0p+0,0x1.14ebd4903a181p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d45b0f784d80cp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24158c4028471p-5,0x0p+0,0x0p+0,0x1.2e7117ffb165ap-5,0x0p+0,0x0p+0,0x1.55793c020390ep-7,0x0p+0,0x1.de85c7e8d2b03p-3,0x0p+0,0x0p+0,0x0p+0,0x1.f548d505f5419p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1016135dad528p-7,-0x1.a714a85be5fap-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3830f1385f751p-6,0x0p+0,0x0p+0,0x1.878c280c25112p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3e2436397f6a6p-9,0x1.79661b4db997ep-8,0x0p+0,0x0p+0,0x0p+0,0x1.2de149e1f5c08p-3,-0x1.bd4c5ee372c63p-8,0x0p+0,0x0p+0,0x1.3174ee211cb52p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a15170ac8336cp-7,0x1.186c51e72caedp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3830f1385f751p-6,0x0p+0,0x0p+0,0x0p+0,0x1.f25a6d14dbc94p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d8b6039ea7598p-10,0x1.86d40ffeddd19p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bd4c5ee372c63p-8,0x1.69d6e181b2d02p-3,0x0p+0,0x0p+0,-0x1.3c740c554a821p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5a3d65b2b0fe9p-5,-0x1.99d6cb1ecfe32p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6e8606e1fb684p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.19f293c239a13p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.fd62e03f741edp-6,0x1.25281c3e8ab1dp-11,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f16518e74aee9p-3,0x1.08073dd94d855p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1fb63b8026819p-10,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.585bf34a68a52p-7,0x0p+0,0x1.d45b0f784d80cp-6,0x0p+0,0x0p+0,0x1.6e8606e1fb684p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.07f1577b9cf23p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7e97ac8ec6003p-10,0x0p+0,0x1.f548d505f5419p-5,0x0p+0,0x0p+0,0x1.08073dd94d855p-5,0x1.e4a99a678444dp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.41238253fd4dap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.46d674ff73306p-7,-0x1.4246a8f98ff59p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.878c280c25112p-6,-0x1.f25a6d14dbcb1p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.09a4fbfc2f156p-9,0x1.23c49de925ac5p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3174ee211cb52p-6,-0x1.3c740c554a821p-6,0x0p+0,0x0p+0,0x1.73faa59446934p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a4ae9ae6d3ab8p-5,-0x1.0fdd168550652p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0aaca05890b7ap-6,-0x1.2fc8f89608e71p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.12011e16b31f1p-7,0x1.484314133cadp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.13515fccb7176p-3,0x0p+0,-0x1.29ecaf0188528p-7,-0x1.26315f43deca9p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.186673d0efe28p-5,-0x1.986d5a4ba970fp-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b1de4ee6fa77bp-5,0x0p+0,0x1.867da0b315c15p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.02c20535c5ff1p-5,-0x1.3445a0adbefd4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c47f3eb6dd62dp-3,0x1.d5c979007e191p-6,0x0p+0,-0x1.23c6b87ba1e7ep-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0aaca05890b7ap-6,-0x1.b1de4ee6fa77bp-5,0x0p+0,0x1.f4950b684adadp-7,-0x1.2c59ae9a34cb2p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.29ecaf0188528p-7,0x1.d5c979007e191p-6,0x1.a84f506d337dp-3,-0x1.5e322f9f74535p-7,-0x1.15965e2e73ea3p-9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e3f17e01fe817p-5,-0x1.e5dd953ec223fp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2fc8f89608e71p-4,0x0p+0,-0x1.f4950b684adadp-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7c6f32cdfef4bp-6,0x1.728121e51bfa5p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.26315f43deca9p-5,0x0p+0,-0x1.5e322f9f74535p-7,0x1.2ac21eb2a4ccfp-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.19f293c239a13p-6,0x1.07f1577b9cf23p-5,0x0p+0,0x0p+0,-0x1.867da0b315c15p-5,0x1.2c59ae9a34cb2p-8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1fb63b8026819p-10,0x1.41238253fd4dap-5,0x0p+0,0x0p+0,-0x1.23c6b87ba1e7ep-5,-0x1.15965e2e73ea3p-9,0x0p+0,0x1.fbb6de931eee8p-3}; + Eigen::MatrixXd Kexact = Eigen::Map(&(initvec[0]), 158, 158); + + test_common::assert_near(Eigen::MatrixXd(K),Kexact,1e-12); +} diff --git a/vendor/libigl/tests/include/igl/cr_vector_laplacian.cpp b/vendor/libigl/tests/include/igl/cr_vector_laplacian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..48c40ee9e5421cc48c33217dda35f6a592d76472 --- /dev/null +++ b/vendor/libigl/tests/include/igl/cr_vector_laplacian.cpp @@ -0,0 +1,37 @@ +#include +#include +#include +#include + +#include + + +TEST_CASE("cr_vector_laplacian: cube", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + Eigen::SparseMatrix Ls, Ms; + Eigen::MatrixXi E(12,3), oE(12,3); + //We need to provide these as unput, as orient_halfedges is + // platform-dependent (because unique_simplices is) + E.col(0) << 6,9,0,3,8,10,8,14,12,15,17,15; + E.col(1) << 0,1,7,4,6,9,16,13,2,5,11,14; + E.col(2) << 1,2,4,13,10,11,7,16,5,3,12,17; + oE.col(0) << 1,-1,1,1,-1,1,1,1,-1,1,1,-1; + oE.col(1) << -1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1; + oE.col(2) << 1,1,1,-1,-1,-1,-1,1,1,-1,1,-1; + igl::cr_vector_laplacian(V, F, E, oE, Ls); + igl::cr_vector_mass(V, F, E, oE, Ms); + Eigen::MatrixXd L(Ls), M(Ms); + + std::vector initvecL = {0x1p+2,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1p+3,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1p+2,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,-0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1p+3,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x1p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1p+2,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x1p+3,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x1p+2,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x1p+3,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1p+3,0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,-0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x1p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1p+3,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1p+2,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,-0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1p+3,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x1p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1p+2,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x1p+3,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x1p+2,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x1p+3,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1p+2,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1p+3,0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x1p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x1p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1.6a09e667f3be3p+0,0x0p+0,0x0p+0,0x1p+2}; + Eigen::MatrixXd Lexact = Eigen::Map(&(initvecL[0]), 36, 36); + std::vector initvecM = {0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.555555555554fp-2}; + Eigen::MatrixXd Mexact = Eigen::Map(&(initvecM[0]), 36, 36); + + test_common::assert_near(L,Lexact,1e-12); + test_common::assert_near(M,Mexact,1e-12); +} diff --git a/vendor/libigl/tests/include/igl/cumprod.cpp b/vendor/libigl/tests/include/igl/cumprod.cpp new file mode 100644 index 0000000000000000000000000000000000000000..23990a1428990c3f6ff1efa11c7ad2b9938310e9 --- /dev/null +++ b/vendor/libigl/tests/include/igl/cumprod.cpp @@ -0,0 +1,20 @@ +#include +#include + +TEST_CASE("cumprod: col_factorial", "[igl]") +{ + Eigen::Vector4d X(1,2,3,4); + Eigen::Vector4d Y; + igl::cumprod(X,1,Y); + Eigen::Vector4d Ygt(1,2,6,24); + test_common::assert_eq(Y,Ygt); +} + +TEST_CASE("cumprod: row_factorial", "[igl]") +{ + Eigen::RowVector4d X(1,2,3,4); + Eigen::RowVector4d Y; + igl::cumprod(X,2,Y); + Eigen::RowVector4d Ygt(1,2,6,24); + test_common::assert_eq(Y,Ygt); +} diff --git a/vendor/libigl/tests/include/igl/cumsum.cpp b/vendor/libigl/tests/include/igl/cumsum.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3546b42cf1b668cf98e616bf3d20fd530e3d2225 --- /dev/null +++ b/vendor/libigl/tests/include/igl/cumsum.cpp @@ -0,0 +1,21 @@ +#include +#include + +TEST_CASE("cumsum: col", "[igl]") +{ + Eigen::Vector4d X(1,2,3,4); + Eigen::Vector4d Y; + igl::cumsum(X,1,Y); + Eigen::Vector4d Ygt(1,3,6,10); + test_common::assert_eq(Y,Ygt); +} + +TEST_CASE("cumsum: row", "[igl]") +{ + Eigen::RowVector4d X(1,2,3,4); + Eigen::RowVector4d Y; + igl::cumsum(X,2,Y); + Eigen::RowVector4d Ygt(1,3,6,10); + test_common::assert_eq(Y,Ygt); +} + diff --git a/vendor/libigl/tests/include/igl/curved_hessian_energy.cpp b/vendor/libigl/tests/include/igl/curved_hessian_energy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee0eedb991662ff5351575e7dffb21430e31ca94 --- /dev/null +++ b/vendor/libigl/tests/include/igl/curved_hessian_energy.cpp @@ -0,0 +1,46 @@ +#include +#include +#include + +#include + + +TEST_CASE("curved_hessian_energy: cube", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + Eigen::SparseMatrix Qs; + igl::curved_hessian_energy(V, F, Qs); + Eigen::MatrixXd Q(Qs); + + Eigen::MatrixXd Qexact(8,8); + Qexact << 0x1.3da9e8a554e1cp+4,-0x1.2487ed5110b44p+3,0x1.860a91c16b9b8p+1,-0x1.2487ed5110b44p+3,-0x1.2487ed5110b44p+3,0x1.860a91c16b9b8p+1,-0x1.921fb54442cfap+0,0x1.860a91c16b9b8p+1,-0x1.2487ed5110b44p+3,0x1.5da9e8a554e1cp+4,-0x1.4487ed5110b4ap+3,0x1p+0,0x1p+0,-0x1.4487ed5110b4ap+3,0x1.860a91c16b9b8p+1,0x1.430548e0b5cdcp+1,0x1.860a91c16b9b8p+1,-0x1.4487ed5110b4ap+3,0x1.5da9e8a554e1cp+4,-0x1.4487ed5110b4ap+3,0x1.430548e0b5cdcp+1,0x1p+0,-0x1.2487ed5110b44p+3,0x1p+0,-0x1.2487ed5110b44p+3,0x1p+0,-0x1.4487ed5110b4ap+3,0x1.5da9e8a554e1cp+4,0x1p+0,0x1.430548e0b5cdcp+1,0x1.860a91c16b9b8p+1,-0x1.4487ed5110b4ap+3,-0x1.2487ed5110b44p+3,0x1p+0,0x1.430548e0b5cdcp+1,0x1p+0,0x1.5da9e8a554e1cp+4,-0x1.4487ed5110b4ap+3,0x1.860a91c16b9b8p+1,-0x1.4487ed5110b4ap+3,0x1.860a91c16b9b8p+1,-0x1.4487ed5110b4ap+3,0x1p+0,0x1.430548e0b5cdcp+1,-0x1.4487ed5110b4ap+3,0x1.5da9e8a554e1cp+4,-0x1.2487ed5110b44p+3,0x1p+0,-0x1.921fb54442cfap+0,0x1.860a91c16b9b8p+1,-0x1.2487ed5110b44p+3,0x1.860a91c16b9b8p+1,0x1.860a91c16b9b8p+1,-0x1.2487ed5110b44p+3,0x1.3da9e8a554e1cp+4,-0x1.2487ed5110b44p+3,0x1.860a91c16b9b8p+1,0x1.430548e0b5cdcp+1,0x1p+0,-0x1.4487ed5110b4ap+3,-0x1.4487ed5110b4ap+3,0x1p+0,-0x1.2487ed5110b44p+3,0x1.5da9e8a554e1cp+4; + + test_common::assert_near(Q,Qexact,1e-12); +} + + +TEST_CASE("curved_hessian_energy: annulus", "[igl]") +{ + Eigen::MatrixXd V(99,3); + Eigen::MatrixXi F(148,3); + //This is an annulus + V.col(0) << 0.29999999999999998889776975374843,0.24270509831248421317440033817547,0.0927050983124842048477276534868,-0.0927050983124842048477276534868,-0.24270509831248421317440033817547,-0.29999999999999998889776975374843,-0.24270509831248421317440033817547,-0.092705098312484301992242308187997,0.0927050983124842048477276534868,0.24270509831248421317440033817547,1,0.98768834059513777035022030759137,0.95105651629515353118193843329209,0.89100652418836789880884907688596,0.80901699437494745126286943559535,0.70710678118654757273731092936941,0.58778525229247313710345679282909,0.45399049973954691550304119118664,0.30901699437494750677402066685318,0.15643446504023089671520096999302,9.999999999999999790977867240346e-17,-0.15643446504023059140386919807497,-0.30901699437494728472941574182187,-0.45399049973954669345843626615533,-0.58778525229247302608115433031344,-0.70710678118654746171500846685376,-0.80901699437494734024056697307969,-0.89100652418836778778654661437031,-0.95105651629515353118193843329209,-0.98768834059513765932791784507572,-1,-0.98768834059513777035022030759137,-0.9510565162951537532265433583234,-0.89100652418836789880884907688596,-0.80901699437494745126286943559535,-0.70710678118654768375961339188507,-0.58778525229247324812575925534475,-0.45399049973954691550304119118664,-0.30901699437494761779632312936883,-0.15643446504023100773750343250867,-1.9999999999999999581955734480692e-16,0.15643446504023070242617166059063,0.30901699437494717370711327930621,0.45399049973954658243613380363968,0.58778525229247291505885186779778,0.70710678118654735069270600433811,0.80901699437494734024056697307969,0.89100652418836778778654661437031,0.95105651629515353118193843329209,0.98768834059513765932791784507572,-0.54653773385274273532985489509883,-0.16778761071338771371230791373819,-0.6640334885500396300272996086278,-0.3755430578136348396256494197587,0.27505167682734571465985595750681,0.61283057248268479888508863950847,0.37554305781363522820370803856349,0.66403348855003985207190453365911,-0.69888569632849417700981575762853,-0.71801469123163186303315796976676,-0.54690508304406848516521222336451,-0.32226059481637447934332385557354,-0.066070994246462080856652221427794,-0.8188400187389239803792406746652,-0.586539425411693127188073049183,-0.056392056768511444886371464235708,-0.32226059481637425729871893054224,0.19658609558397963090747850856133,0.43999996868279372952414973951818,0.64034357918688944444340904738056,0.77800589862411184682855491701048,0.3222605948163745903656263180892,0.5469050830440682631206072983332,0.71801469123163186303315796976676,0.76897255750667192764069568511331,-0.83951158001816739151479396241484,-0.3394941295361795230434154291288,-0.64774834858972418771827506134287,0.066070994246462080856652221427794,0.050978900626839074305962640210055,0.42197972345950862660401980974711,0.1516814321578138502477628435372,0.49407477612085504148353720665909,0.62620665770565242524980931193568,-0.29074511527527352461319765097869,0.47043547857839895787179784747423,-0.47043547857839940196100769753684,-0.26935940260987811800674762707786,-0.45589550848838600316526026290376,-9.7144514654701197287067770957947e-17,0.26935940260987795147329393330438,5.5511151231257827021181583404541e-17,0.28175891956423887441118836250098,0.4328463157366620461807826814038,0.80860600926288284107101844710996,-0.18390862049392966981464780928945,0.59788321616198325525459722484811,-0.43994121336078612083397842980048,-0.47585524604634232836986029724358; + V.col(1) << 0,0.17633557568774191337546142221981,0.28531695488854602604789079123293,0.28531695488854608155904202249076,0.17633557568774199664218826910655,0,-0.17633557568774191337546142221981,-0.28531695488854602604789079123293,-0.28531695488854608155904202249076,-0.17633557568774199664218826910655,0,0.15643446504023089671520096999302,0.30901699437494739575171820433752,0.45399049973954669345843626615533,0.58778525229247313710345679282909,0.70710678118654746171500846685376,0.80901699437494745126286943559535,0.89100652418836778778654661437031,0.95105651629515353118193843329209,0.98768834059513777035022030759137,1,0.98768834059513777035022030759137,0.95105651629515364220424089580774,0.89100652418836789880884907688596,0.80901699437494745126286943559535,0.70710678118654757273731092936941,0.58778525229247324812575925534475,0.45399049973954691550304119118664,0.30901699437494750677402066685318,0.15643446504023100773750343250867,9.999999999999999790977867240346e-17,-0.15643446504023070242617166059063,-0.30901699437494689615135712301708,-0.45399049973954669345843626615533,-0.58778525229247302608115433031344,-0.70710678118654746171500846685376,-0.80901699437494734024056697307969,-0.89100652418836778778654661437031,-0.95105651629515353118193843329209,-0.98768834059513765932791784507572,-1,-0.98768834059513777035022030759137,-0.95105651629515364220424089580774,-0.89100652418836800983115153940162,-0.809016994374947562285171898111,-0.70710678118654768375961339188507,-0.5877852522924733591480617178604,-0.45399049973954702652534365370229,-0.30901699437494761779632312936883,-0.15643446504023109100423027939541,-0.46678732236060038740532718293252,-0.6988856963284932888313960575033,0.27505167682734582568215842002246,0.61283057248268479888508863950847,-0.6640334885500396300272996086278,-0.37554305781363517269255680730566,0.61283057248268502092969356453978,0.27505167682734588119330965128029,-0.16778761071338740840097614182014,-0.43999996868279378503530097077601,-0.64034357918688944444340904738056,-0.77800589862411184682855491701048,-0.83951158001816683640328164983657,0.1965860955839799917299615117372,0.50095199450696692444751079165144,0.71652901879469466095429197594058,0.77800589862411184682855491701048,-0.8188400187389239803792406746652,-0.71801469123163208507776289479807,-0.5469050830440682631206072983332,-0.32226059481637464587677754934703,0.77800589862411184682855491701048,0.64034357918688966648801397241186,0.43999996868279395156875466454949,0.060519452777067217486006711624213,-0.06607099424646192820098633546877,-0.55400406805393431763917533316999,0.050978900626839240839416333983536,0.83951158001816716947018903738353,-0.64774834858972396567367013631156,-0.49407477612085498597238597540127,0.63179863449392670293747187315603,0.42197972345950890415977596603625,-0.13434633655936117913043403859774,0.40017632013019388548258348237141,0.15285375279687535288175581627002,-0.15285375279687540839290704752784,-0.37074141186115194823713636651519,0.14812943013199278419200766165886,-0.4582615871346303326738791383832,-0.37074141186115194823713636651519,0.47935690537543407252485394565156,0.38780788281971001474346394388704,-0.14064029342468886696337904140819,-0.11824817247245911211450675182277,0.56601253363877979118967687099939,0.036135156012640279321601610718062,-0.32643697968833562672585912878276,0.34133753547532807992581638245611; + V.col(2) << 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0; + F.col(0) << 5,71,78,60,33,15,57,33,59,72,76,68,69,41,87,61,62,61,52,49,10,75,63,30,68,67,26,64,1,70,31,70,59,60,3,26,0,53,87,66,66,13,66,88,52,71,89,82,62,44,40,79,62,89,55,21,54,68,68,21,95,80,10,65,24,69,2,47,67,55,71,25,57,78,56,21,32,50,37,56,94,14,63,75,61,72,67,72,72,36,62,57,12,61,4,28,69,63,96,94,77,29,51,6,86,88,81,18,54,7,80,8,2,81,1,82,96,9,3,98,85,82,86,97,6,89,98,52,87,90,89,93,81,91,82,81,93,93,74,70,53,95,57,93,58,76,53,52; + F.col(1) << 86,78,18,34,59,73,12,34,60,82,50,45,55,42,97,76,39,38,88,94,74,32,27,31,43,42,27,27,85,47,32,69,34,35,84,64,85,66,6,23,22,73,21,77,27,72,87,72,51,45,67,51,61,79,83,65,67,42,69,66,66,54,11,66,64,70,92,69,54,70,17,64,73,19,72,78,59,58,61,71,70,73,75,29,51,16,40,15,73,61,67,74,74,37,98,29,45,77,83,49,75,75,79,87,77,5,78,78,80,89,93,90,91,91,92,92,57,93,91,53,0,85,5,58,86,76,4,77,89,79,90,80,65,65,56,92,9,83,83,94,84,84,96,96,97,97,98,98; + F.col(2) << 6,81,19,35,32,14,73,59,50,73,60,69,80,67,76,60,40,39,98,48,94,58,28,75,44,68,64,52,92,48,75,47,60,36,4,25,1,24,97,24,23,12,22,86,63,17,76,56,61,68,62,62,39,90,93,78,68,43,80,65,53,68,74,95,53,55,91,46,79,83,18,24,82,20,71,20,58,59,36,81,48,13,77,30,76,17,41,16,15,60,79,12,11,38,88,63,46,52,74,10,58,63,89,7,58,4,65,71,90,8,90,9,3,92,2,85,85,0,95,64,93,57,88,50,97,51,84,88,7,54,8,55,91,95,92,56,90,96,94,83,95,3,74,85,86,50,84,64; + + Eigen::SparseMatrix Qs; + igl::curved_hessian_energy(V, F, Qs); + Eigen::MatrixXd Q(Qs); + + std::vector initvec = {0x1.b0a2fea47278ap+7,-0x1.f4ee1c8888958p+5,0x1.588c1ce03556cp-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.378ec9a5c0038p-5,-0x1.e7a96c6cc3aabp+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.825fb0f25862p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.930db3415cb9p+3,0x0p+0,0x1.4aeb3b082c13dp+3,0x1.908f01caeb6f9p+4,0x0p+0,-0x1.31fe29bc515a8p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0df97df1c2c6bp+2,0x0p+0,0x1.929b5aa49bf18p+2,-0x1.8dd46ca643163p+6,0x0p+0,0x0p+0,0x1.2924877dc5d46p+4,0x0p+0,0x0p+0,-0x1.f4ee1c8888958p+5,0x1.790b14b09d8fep+7,-0x1.deff867aeef18p+5,0x1.24f2b29dd791ap-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.33eb5043c33a2p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b65b9cc416174p+1,0x1.60bdaa1c72424p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3b46a3c04effcp+3,0x1.e7c11b1f30495p+3,0x0p+0,0x0p+0,-0x1.1c9e37fd229fep+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.16363fb0b2c27p+3,-0x1.1266ae5f23fe3p+6,0x1.1ae010713de8bp+3,0x0p+0,0x0p+0,0x1.09a3f30851ca1p+4,0x0p+0,0x0p+0,0x1.588c1ce03556cp-4,-0x1.deff867aeef18p+5,0x1.7b7b64cd3d3e9p+7,-0x1.04c06ccd93994p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5ced6a70385c3p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.652c6ae70b496p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f4b61ea1b978cp+3,0x1.047e895db06f2p+3,0x0p+0,0x1.b5c0342b93ffbp+3,0x1.867053031adfcp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.04b094aac0a65p+6,-0x1.19be37ebf4616p+6,0x0p+0,0x0p+0,0x1.dee59750b101fp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24f2b29dd791ap-5,-0x1.04c06ccd93994p+6,0x1.a6fd7502f8919p+7,-0x1.1db7ac6c9fad4p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4de2925585765p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c3173b753d4bap+2,0x1.25d65619dbf6p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.10aada8eb6d08p+4,0x0p+0,0x0p+0,-0x1.78168da8f79e3p+6,0x0p+0,0x0p+0,0x0p+0,0x1.d4d8fe3a90569p+3,0x0p+0,0x0p+0,-0x1.8e456772f54c1p+6,0x1.27a70fc5e21e8p+4,0x0p+0,0x0p+0,0x1.bbe1d89d61de7p+4,0x0p+0,0x0p+0,0x1.4fbff30cdcc37p+4,0x0p+0,0x0p+0,0x0p+0,-0x1.1db7ac6c9fad4p+6,0x1.9ac564c1ff417p+7,-0x1.0a2e257cf90a7p+6,0x1.588c1ce03559p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ddd12e20f357fp+2,0x1.51d8f0ef03965p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dc761ca57e9f6p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.da46fc0511712p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.316132eb599dbp+6,0x0p+0,0x1.2a1d9c60f5e76p+4,0x0p+0,-0x1.715d8d700ce4bp+6,0x0p+0,0x0p+0,0x1.e17e5c670322p+3,0x0p+0,0x0p+0,0x0p+0,0x1.c44eaaad31d5bp+3,0x0p+0,0x0p+0,0x1.25deea0c2c1f9p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0a2e257cf90a7p+6,0x1.8636da9cfb436p+7,-0x1.2b9db41be397bp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b7c649f8919f1p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.816d906b3141ap+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e7c11b1f30495p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d14f8f0d201abp+3,0x0p+0,-0x1.09988f8e7a76bp+6,0x1.f1769d4365095p+3,-0x1.0fe1b7867330ep+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.84626b7a6f86ep+3,0x1.f0f50b9646f54p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.588c1ce03559p-4,-0x1.2b9db41be397bp+6,0x1.a6134ecd7f649p+7,-0x1.0b6ddb2e2382dp+6,0x1.b7ef91f10e6b7p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.11f7d343de10fp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d340f69c7c888p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.61e01c4c8f35cp+4,0x1.4f3fd0814ee9dp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.badb613df8c03p+5,-0x1.6ed42b640a49dp+6,0x1.a98e7f012bdd9p+3,0x1.675d45cb97cf9p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e32fd7fb044bap+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0b6ddb2e2382dp+6,0x1.a9dee1afb331fp+7,-0x1.d83216acaa962p+5,0x1.b7ef91f10e7f4p-6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5d80e44cdb6f5p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.791e25fa6443bp+2,0x0p+0,0x0p+0,0x1.93b824faa130dp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c6ea49b3c511dp+3,-0x1.3d14721db598p+6,0x0p+0,-0x1.6c1696b6c3e54p+6,0x1.0d4b80ceb0299p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.79fb1c20b72b2p+3,0x0p+0,0x1.378ec9a5c0038p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b7ef91f10e6b7p-6,-0x1.d83216acaa962p+5,0x1.a53d6b4d57b06p+7,-0x1.d774e24df47e3p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.00af507fef52fp-5,0x0p+0,0x0p+0,0x1.5d80e44cdb6f5p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.93b824faa12d5p+3,0x0p+0,0x0p+0,0x1.69ebb7104f8b9p+2,0x1.a5e47f5ac0c02p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a8a362e3b83cep+1,0x0p+0,-0x1.2a8d3e9571221p+6,-0x1.6e58589ef504cp+6,0x0p+0,0x0p+0,0x1.0d9048d272de5p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e7a96c6cc3aabp+5,0x1.33eb5043c33a2p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b7ef91f10e7f4p-6,-0x1.d774e24df47e3p+5,0x1.a422aaf077e01p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.781c1a8013792p-5,0x1.612fff9ebf589p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.93b824faa130dp+3,0x1.696a65a1e5b6ep+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.734834f8c538cp+3,0x0p+0,0x0p+0,0x0p+0,0x1.a0b2da8bffce7p+1,-0x1.2a67e1c99dd11p+6,0x0p+0,0x0p+0,-0x1.3fe59c45f93f1p+6,0x0p+0,0x0p+0,0x1.23d72b03b9af9p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b2324d713ea29p+7,-0x1.7422dc93828dfp+6,-0x1.3d8ca589ee8dep+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e114f27104693p+1,-0x1.a3e82cd487f6cp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dcbcbe6afa193p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4cce8b831e0b2p+4,0x0p+0,0x0p+0,0x0p+0,-0x1.ff7057c818d8bp+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.05c806747cc97p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a7631566c5b74p+4,0x0p+0,0x1.67fa508fe64ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7422dc93828dfp+6,0x1.9cdceef8350c5p+7,-0x1.eb0982fb7c851p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c3562529b2d94p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c12d99c06f133p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.40b05a9a155bfp+3,-0x1.b6e4fff4551d6p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e9dbe1e3484e5p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.34cfd20a8d5e2p+2,0x0p+0,0x1.af9de00cf4d9bp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3d8ca589ee8c8p+1,-0x1.eb0982fb7c851p+6,0x1.0a4cf0b0fcdp+8,-0x1.48094738c48c6p+7,0x1.dce4dd08032ecp+1,0x1.4b76b2bb2736p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.858f69544e739p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d84d57687af6dp+0,0x1.b3853934ccc2ep+5,-0x1.12dcb21001dc5p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2a850a6d079e2p+3,0x1.247f6d9bc5dc1p+0,0x0p+0,0x1.c6196ecaf39b8p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.50bdbbb351494p+4,0x0p+0,0x1.1216ea4602118p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.48094738c48c6p+7,0x1.2a1144c7e0aadp+8,-0x1.dc1ccf185db9cp+5,-0x1.127a05423a787p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.012ac2f90596dp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,-0x1.61796938aa8ep+7,0x1.5ad619686e98dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3af00623e68e2p-1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dce4dd08032d5p+1,-0x1.dc1ccf185db9cp+5,0x1.2a4f57f3b0408p+8,-0x1.8dae04169b055p+7,0x1.433c5f1d749b3p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fdbe16d5dfb5bp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2cdeff41f6699p+6,-0x1.5ef32254f3327p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.630f16efc0d13p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4b76b2bb2736p+3,-0x1.127a05423a787p+4,-0x1.8dae04169b055p+7,0x1.3faeb4118c294p+8,-0x1.1c0b7a6898f69p+6,-0x1.22bb9e2bb2965p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1dep+2,0x1.a2fb038a8e1d3p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,-0x1.5cb33ac05f743p+7,0x1.36a5e97d20774p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0df7bd7f6c5f7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749b3p+1,-0x1.1c0b7a6898f69p+6,0x1.1fc0d791c183bp+8,-0x1.934f94c2ef2f7p+7,0x1.433c5f1d749c9p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bb1f34d9de3p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.336d5cd5c2477p+6,-0x1.1e3b8b4cbcdf6p+7,0x1.0f7a5b36a0a08p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.75b55d4c7005fp+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.22bb9e2bb2965p+3,-0x1.934f94c2ef2f7p+7,0x1.5c57d4e866144p+8,-0x1.2be41db626de6p+6,0x1.433c5f1d749b3p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.77d8c2977d902p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a3022c439e497p+7,0x1.b98865d5af1adp+5,0x1.eadf03585e029p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6f14321576243p+4,0x0p+0,0x0p+0,0x1.241ea42f9723ap+4,0x1.0cc34e5ad024ep+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749c9p+1,-0x1.2be41db626de6p+6,0x1.39507f994ee1p+8,-0x1.8dae04169b055p+7,-0x1.127a05423a76bp+4,0x1.4b76b2bb27398p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0bca3567c6b7ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1b1p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5302f6e283211p+7,0x1.6d5a90af0bfe7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3e9c52d225e74p+6,0x0p+0,0x0p+0,0x1.0df7bd7f6c5f7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749b3p+1,-0x1.8dae04169b055p+7,0x1.2a4f57f3b0408p+8,-0x1.dc1ccf185dbaap+5,0x1.dce4dd0803292p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fdbe16d5dfb77p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2cdeff41f66ap+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5ef32254f3327p+7,0x0p+0,0x0p+0,0x1.630f16efc0cf7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.127a05423a76bp+4,-0x1.dc1ccf185dbaap+5,0x1.2a1144c7e0aadp+8,-0x1.528f17d706182p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1636643588b02p+6,0x1.5856cfacb7014p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.61298001339bp+7,0x0p+0,0x0p+0,0x1.3af00623e68ebp-1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4b76b2bb27398p+3,0x1.dce4dd08032a8p+1,-0x1.528f17d706182p+7,0x1.318aa754d23fcp+8,-0x1.6af4238005728p+7,-0x1.b85cfcd83ee3bp+2,0x1.4b76b2bb27398p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.63a0d2b1dde83p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c35eeeef9a96cp+6,0x1.5c8d23c5ba355p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d84d57687afc7p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c10d6128e9affp+5,0x0p+0,0x0p+0,0x1.051af7f5bfaebp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1ff2db8313e8cp+2,0x0p+0,0x0p+0,0x0p+0,0x1.e5b52cf64f397p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6af4238005728p+7,0x1.373c5bc15f194p+8,-0x1.9c1d74963e05p+5,0x1.dce4dd0803302p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fdbe16d5dfb5bp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.27219cb032b2ap+6,-0x1.867a798a6487bp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.336b8f69a2d65p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.697062be35b05p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b85cfcd83ee3bp+2,-0x1.9c1d74963e05p+5,0x1.2a1144c7e0a9cp+8,-0x1.481077269a949p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.001abf41739e6p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5ad619686e98dp+4,0x1.8c5d7ffe807bcp+4,-0x1.757dc01e66e9p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.421ff3f9efec1p-1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4b76b2bb27398p+3,0x1.dce4dd0803319p+1,-0x1.481077269a949p+7,0x1.076f62167177bp+8,-0x1.ec8f79bc98a2bp+6,-0x1.2cb87b14adc33p+4,0x1.5a21f5dc89467p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2190d230b0af7p-3,-0x1.68e97107527f4p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0fe26bc4f422dp+4,0x1.b684e4859aa7cp+2,0x1.a0bc96c2c2636p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.712188a528fd3p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2451ee3da4063p+2,0x0p+0,0x0p+0,0x1.372a7c92eecb2p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ec8f79bc98a2bp+6,0x1.a44c1d5e8b456p+7,-0x1.cb89ebbba739ep+5,-0x1.2cb87b14adc33p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dcbcbe6afa193p+4,0x1.c65a816b90c96p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.489b5edd9a05dp+6,0x0p+0,0x1.40b05a9a155bfp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.953ae6e6b8987p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2cb87b14adc33p+4,-0x1.cb89ebbba73acp+5,0x1.a44c1d5e8b456p+7,-0x1.eda23d16a9b5p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b35625caa86bep+4,0x1.dcbcbe6afa193p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.40b05a9a155bfp+3,-0x1.43da47f55feep+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b7935228dacd9p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5a21f5dc89467p+4,-0x1.2cb87b14adc33p+4,-0x1.eda23d16a9b5p+6,0x1.0b9845e4183e6p+8,-0x1.42a8d427d5075p+7,0x1.7971a39ac3286p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.83c8e5a8aca93p+6,0x1.2e617c411f013p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.71ec38d4e89c7p+5,0x1.712377bcf7b39p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.30792c993e62fp+3,0x0p+0,0x1.15f480a0e43cdp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffe8cf65490dap+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0861c84586371p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.42a8d427d5075p+7,0x1.1f82c465f1ecep+8,-0x1.1863f2dd60eabp+6,0x1.433c5f1d749b3p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.012ac2f905958p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.473d7782f5a76p+7,0x1.5ad619686e98dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0f7a5b36a0a08p+4,0x0p+0,0x1.0996b02f31a5dp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7971a39ac324ep+3,-0x1.1863f2dd60eabp+6,0x1.3faeb4118c294p+8,-0x1.8dae04169b078p+7,-0x1.127a05423a76bp+4,0x1.4b76b2bb2736p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.333e6bdc419d8p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1bcp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.86760edcc6cfap+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.36a5e97d2079p+6,0x0p+0,0x1.0df7bd7f6c5f7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749b3p+1,-0x1.8dae04169b078p+7,0x1.2a4f57f3b041ap+8,-0x1.dc1ccf185db9cp+5,0x1.dce4dd08032ecp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fdbe16d5dfb93p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2cdeff41f66b5p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5ef32254f334ap+7,0x0p+0,0x1.630f16efc0cf7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.127a05423a76bp+4,-0x1.dc1ccf185db9cp+5,0x1.2a1144c7e0abfp+8,-0x1.528f17d7061a5p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1636643588b09p+6,0x1.5856cfacb703p+4,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.61298001339d4p+7,0x0p+0,0x1.3af00623e68fep-1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4b76b2bb2736p+3,0x1.dce4dd08032d5p+1,-0x1.528f17d7061a5p+7,0x1.31f4337f5cap+8,-0x1.659c346985074p+7,0x1.304f6f6517462p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.649f5224f4e39p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bf90776d446cap+6,0x1.676f6e6afec93p+5,0x1.efe2797537973p+2,0x0p+0,0x0p+0,0x1.d84d57687afc7p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c1adf1d54ac56p+5,0x0p+0,0x1.19ab81c1e30f5p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d1496a2db72b9p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6f81647fc2cc7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.659c346985074p+7,0x1.2caddb5f705c6p+8,-0x1.fafd1c4d4ea44p+5,0x1.433c5f1d749c9p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2a6217f1fd2dep+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2f53cf7a9a4f8p+6,-0x1.465d98f0aed24p+7,0x1.0dc0b9d0367adp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.336b8f69a2d5ap+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.304f6f651748fp+0,-0x1.fafd1c4d4ea53p+5,0x1.62b60960a35b7p+8,-0x1.934f94c2ef2f7p+7,-0x1.22bb9e2bb293ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.efa26e749c2aap+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.38f6eb8564c79p+5,-0x1.d000ca31d67f9p+7,0x1.bd350ed2e7c0ep+5,0x1.eadf03585e03fp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0cc34e5ad0232p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749c9p+1,-0x1.934f94c2ef2f7p+7,0x1.1fc0d791c183bp+8,-0x1.1c0b7a6898f69p+6,0x1.433c5f1d749b3p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bb1f34d9de3p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.336d5cd5c2469p+6,-0x1.1e3b8b4cbcdf6p+7,0x1.0f7a5b36a0a08p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.75b55d4c7005fp+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.22bb9e2bb293ep+3,-0x1.1c0b7a6898f7p+6,0x1.3faeb4118c2a5p+8,-0x1.8dae04169b078p+7,-0x1.127a05423a7a3p+4,0x1.4b76b2bb27398p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1e9p+2,0x1.a2fb038a8e1bcp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,-0x1.5cb33ac05f743p+7,0x1.36a5e97d20782p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0df7bd7f6c5f7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749b3p+1,-0x1.8dae04169b078p+7,0x1.2a4f57f3b0408p+8,-0x1.e36bde2ecdd35p+5,-0x1.127a05423a76bp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2cdeff41f66ap+6,-0x1.35304e388bd7p+7,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.630f16efc0d13p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.127a05423a7a3p+4,-0x1.e36bde2ecdd35p+5,0x1.2a4f57f3b0408p+8,-0x1.98b007d3deb24p+7,0x1.433c5f1d749ep+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bb1f34d9de2e3p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff47p+5,-0x1.38777d0271c3cp+7,0x1.336d5cd5c2462p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4b76b2bb27398p+3,-0x1.127a05423a76bp+4,-0x1.98b007d3deb24p+7,0x1.5c57d4e866133p+8,-0x1.2be41db626dedp+6,0x1.433c5f1d74a0dp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.77d8c2977d902p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fa1680ebdfae3p+5,-0x1.a3022c439e474p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6f14321576243p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0cc34e5ad0232p+4,0x0p+0,0x0p+0,0x1.241ea42f9723ap+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749ep+1,-0x1.2be41db626dedp+6,0x1.39507f994ee1p+8,-0x1.884d9105ab828p+7,-0x1.22bb9e2bb2938p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0bca3567c6b7ep+3,0x0p+0,0x0p+0,0x1.a2fb038a8e1a6p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6d5a90af0bfe7p+4,-0x1.5302f6e2831eep+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1e5545470d9afp+6,0x1.eadf03585e08ep+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0df7bd7f6c5dbp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d74a0dp+1,-0x1.884d9105ab828p+7,0x1.1fc0d791c183bp+8,-0x1.1d7e3b67b72cfp+6,0x1.433c5f1d749ep+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d2659d13fd5bp+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2cdeff41f668bp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1abd285609ac2p+7,0x1.0dc0b9d0367adp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.630f16efc0cdap+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.22bb9e2bb2938p+3,-0x1.1d7e3b67b72cfp+6,0x1.62b60960a35b7p+8,-0x1.98b007d3deb24p+7,-0x1.127a05423a76bp+4,0x1.4b76b2bb27398p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.77d8c2977d8e6p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ac7b3bf4ad53ep+7,0x1.ea29ae41d4cffp+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0cc34e5ad0232p+4,0x1.0cc34e5ad0215p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749ep+1,-0x1.98b007d3deb24p+7,0x1.2a4f57f3b0408p+8,-0x1.e36bde2ecdd35p+5,-0x1.127a05423a787p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bb1f34d9de2e3p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.336d5cd5c2469p+6,-0x1.38777d0271c3cp+7,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.127a05423a76bp+4,-0x1.e36bde2ecdd27p+5,0x1.2a4f57f3b041ap+8,-0x1.8dae04169b078p+7,0x1.433c5f1d749b3p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,-0x1.35304e388bd7p+7,0x1.2cdeff41f66a7p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.630f16efc0cf7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4b76b2bb27398p+3,-0x1.127a05423a787p+4,-0x1.8dae04169b078p+7,0x1.3faeb4118c2a5p+8,-0x1.1c0b7a6898f7p+6,-0x1.22bb9e2bb294ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1dep+2,0x1.a2fb038a8e1bcp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.36a5e97d20789p+6,-0x1.5cb33ac05f743p+7,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0df7bd7f6c5f7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749b3p+1,-0x1.1c0b7a6898f7p+6,0x1.1fc0d791c183bp+8,-0x1.934f94c2ef2f7p+7,0x1.433c5f1d749ep+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.bb1f34d9de3p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0f7a5b36a0a08p+4,-0x1.1e3b8b4cbcdf6p+7,0x1.336d5cd5c2462p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.75b55d4c7005fp+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.22bb9e2bb294ep+3,-0x1.934f94c2ef2f7p+7,0x1.5c81dea78aafcp+8,-0x1.398861ac4544fp+6,0x1.dcbb59cf2955dp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6fcda221f7043p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.eadf03585e056p+2,0x1.b9150f9b3ca54p+5,-0x1.a5ed2a279ad7ep+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0cc34e5ad0232p+4,0x0p+0,0x0p+0,0x1.0e43b3039f82ep+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8a6208a1d1cd8p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e114f27104693p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.433c5f1d749ep+1,-0x1.398861ac4544fp+6,0x1.cf3b6d9c81c8ap+7,-0x1.de109afb9a3c1p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a687edff66956p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.83e2126f967cdp+4,-0x1.ea23b4b843637p+6,0x0p+0,0x0p+0,0x0p+0,0x1.0fc1bb0bc577dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8d4381994be0cp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f6075245f1fap+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a3e82cd487f6cp+6,0x1.c3562529b2d94p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dcbb59cf2955dp+2,-0x1.de109afb9a3c1p+6,0x1.bb6de33fd3686p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5c77147a66e86p+5,0x0p+0,0x0p+0,0x0p+0,0x1.068270418ffcdp+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0f6ee503aef53p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c071f49094b9dp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.11f7d343de10fp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.649f5224f4e2ep+2,0x1.2a6217f1fd2e9p+2,0x1.efa26e749c2aap+4,0x1.bb1f34d9de3p+4,0x1.a2fb038a8e1e9p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e2985cce130cdp+8,0x1.78ed4e4320c1bp+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.31601d6463ef3p+3,-0x1.8ecaa192b2fbcp+7,-0x1.3da7fb9d19081p+7,0x1.70883c618dccbp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.20346851c287ap+2,-0x1.a97787918e255p+5,0x1.347bccb87e1fap+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.16fba18fd70eep+2,0x1.7295c2ca5de59p+3,0x0p+0,0x1.56461e65049a7p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c3246fd6f6608p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5d80e44cdb6f5p+4,0x1.00af507fef52fp-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1bcp+2,0x0p+0,0x1.bb1f34d9de2e3p+4,0x1.77d8c2977d902p+4,0x1.0bca3567c6b7ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.78ed4e4320c1bp+0,0x1.9da69a507a44bp+8,0x0p+0,0x0p+0,0x1.a54f1fa182673p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d441972b9fed9p+2,-0x1.28679c3b5d6fp+7,-0x1.4b4cab6bef0bep+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3a927d756840dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c6b4de12dafa1p+6,0x0p+0,0x0p+0,-0x1.3b360383b0d66p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ed7c67d73257fp+3,0x0p+0,-0x1.9b6862dc4a1bep+5,0x1.edf4107447fe4p-7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6a598b37e98dcp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ddd12e20f358bp+2,0x1.b7c649f8919f1p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2190d230b0af7p-3,0x1.dcbcbe6afa193p+4,0x1.b35625caa86bep+4,-0x1.83c8e5a8aca93p+6,0x1.012ac2f905958p+6,0x1.333e6bdc419d8p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ad125ca15d4p+8,0x1.1556f2c854af6p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.12b1ffe62551cp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ec8dc2da52d8dp+7,-0x1.c78be3b6b0af2p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1f706f9370f46p+4,0x0p+0,-0x1.04690f6bfbf8bp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.eac55195a6054p+3,0x0p+0,0x1.265e30716d912p+3,0x0p+0,-0x1.1179ddd81d415p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.82eedf26dceabp+6,0x0p+0,0x0p+0,0x0p+0,0x1.4de2925585765p+3,0x1.51d8f0ef03965p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.63a0d2b1dde83p+3,0x1.fdbe16d5dfb5bp+4,0x1.001abf41739e6p+6,-0x1.68e97107527f4p+6,0x1.c65a816b90c96p+4,0x1.dcbcbe6afa193p+4,0x1.2e617c411f013p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1556f2c854af6p+3,0x1.bca8c843778c2p+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3eae4b8ae429cp+7,0x1.879612b8e0fcap+4,-0x1.0258ab5d3c282p+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.123abd9eeb4bcp+6,0x0p+0,0x0p+0,0x0p+0,0x1.e1f3b43af054fp+2,0x0p+0,0x0p+0,0x1.2e7eeaed1249ap+3,0x0p+0,0x0p+0,0x0p+0,-0x1.9f05c6ed79e51p+6,0x0p+0,0x0p+0,-0x1.7b15f0fd0b439p-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5d80e44cdb6f5p+4,0x1.781c1a8013792p-5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1a6p+2,0x1.d2659d13fd5bp+0,0x1.77d8c2977d8e6p+4,0x1.bb1f34d9de2e3p+4,0x0p+0,0x1.a2fb038a8e1dep+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a54f1fa182673p+2,0x0p+0,0x0p+0,0x1.9db2ba44041fp+8,0x1.afac89295d2d7p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d441972b9fee5p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.29da6cebdba4cp+7,-0x1.420d8fe93b16ep+7,0x1.f860151e0af5p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d7ff9add37003p+6,-0x1.3c47506560f6p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3bb55dfc4133dp+4,-0x1.95b29f6d49219p+5,0x0p+0,0x0p+0,-0x1.784f9d7ead45p-4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.612fff9ebf589p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1bcp+2,0x1.bb1f34d9de3p+4,0x1.6fcda221f7043p+4,0x1.a687edff66956p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.afac89295d2d7p+2,0x1.a9d2c1af3149p+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.697da7c1e95dep+3,-0x1.2b41c7a6f2ee1p+7,-0x1.793fdb13c884fp+7,0x0p+0,0x0p+0,0x0p+0,0x1.9e7e220f9e74ep+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d866e76ffa993p+6,0x0p+0,0x0p+0,-0x1.2cbbfab195999p+6,0x0p+0,0x1.60a4604bea137p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4b36f0d8771f5p+4,0x0p+0,0x0p+0,-0x1.0a39dd05559p+6,0x1.90181e24a5dap+4,0x0p+0,-0x1.7b654d0d2f613p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b65b9cc416174p+1,0x1.5ced6a70385c3p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1dep+2,0x1.bb1f34d9de3p+4,0x1.77d8c2977d902p+4,0x1.0bca3567c6b83p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7472ba12dda52p+8,0x1.12b1ffe625505p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.38bfd2ca421fdp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.33a804c5344a4p+7,-0x1.3e7008c984447p+7,0x1.01a92acbb1723p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9f94457b7b81cp+3,0x0p+0,0x0p+0,-0x1.1089d8aa3585cp+6,-0x1.a3365fa416109p+5,0x0p+0,0x0p+0,0x1.0c44f252677fbp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7d8256eda5c73p+3,-0x1.251e8ec7c5fe3p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.825fb0f25862p+2,0x1.60bdaa1c72424p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dcbcbe6afa193p+4,0x1.c12d99c06f133p+4,-0x1.858f69544e739p+6,0x1.012ac2f905966p+6,0x1.fdbe16d5dfb5bp+4,0x1.a2fb038a8e1d3p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.12b1ffe625505p+1,0x1.b19d39635c679p+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.53b7e91f2d15ep+3,-0x1.db5842917e83ap+7,-0x1.260052069bb03p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.19922aa5673b3p+6,0x1.c6ae5292763aep+2,0x0p+0,-0x1.6f5142de8a35cp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9e514c8d468c8p+3,0x1.6c68fac61e9a8p+2,0x1.a25ae6da149cap+3,0x0p+0,-0x1.289ab4bcf5458p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.816d906b3141ap+3,0x1.d340f69c7c888p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1bcp+2,0x1.fdbe16d5dfb77p+4,0x1.1636643588b09p+6,-0x1.bf90776d446cap+6,0x1.2f53cf7a9a4f8p+6,0x1.38f6eb8564c79p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.31601d6463ef3p+3,0x0p+0,0x1.12b1ffe62551cp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a44ff0f9f2a8bp+8,-0x1.68b9ebad4e7b2p+7,0x1.000f563bf3408p+2,0x0p+0,0x0p+0,0x1.53b7e91f2d196p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d5f38c4963698p+7,0x1.d3360071445f7p+2,-0x1.040795cd1993bp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.baae9532ab9dbp+6,0x1.c7310a9bb2b58p+2,0x1.d2b5d169804ffp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.dedc1bb71aafap+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5856cfacb703p+4,0x1.676f6e6afec93p+5,-0x1.465d98f0aed24p+7,-0x1.d000ca31d67f9p+7,0x1.336d5cd5c2469p+6,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8ecaa192b2fbcp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.68b9ebad4e7b2p+7,0x1.2b5504be01f2ep+9,-0x1.e0bd143eb4711p+5,0x1.24b1bd3d57995p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d710c826e26c4p+3,-0x1.4f5ac5e446314p-2,0x1.13b0c50438682p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e3b439dd2b5e9p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.673c77a74b78fp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.efe2797537973p+2,0x1.0dc0b9d0367adp+4,0x1.bd350ed2e7c0ep+5,-0x1.1e3b8b4cbcdf6p+7,-0x1.5cb33ac05f743p+7,0x1.2cdeff41f66ap+6,0x1.062e1a815ff47p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3da7fb9d19081p+7,0x1.d441972b9fecep+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.000f563bf3408p+2,-0x1.e0bd143eb4703p+5,0x1.f4cb46c0e69bep+8,-0x1.c8e9b9c77f2dcp+6,0x1.24b1bd3d57995p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8a44d2fbbaeb7p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fdfdf365ea8d8p+3,0x0p+0,0x1.05c4fded33fe1p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.66ae694485f35p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.eadf03585e03fp+2,0x1.0f7a5b36a0a08p+4,0x1.36a5e97d20782p+6,-0x1.35304e388bd7p+7,-0x1.38777d0271c3cp+7,0x1.fa1680ebdfae3p+5,0x1.6d5a90af0bfe7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.70883c618dccbp+3,-0x1.28679c3b5d6fp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24b1bd3d57995p+1,-0x1.c8e9b9c77f2dcp+6,0x1.e13a27862864p+8,-0x1.07afc7342f9ecp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fdd14ca6b2d81p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6d4d8caf3b528p+6,0x0p+0,0x0p+0,0x1.55db00cc7254dp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.38c59e0aac1e8p+2,0x0p+0,0x1.1b43f0fb8bd9dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.65d1c781065cdp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,0x1.336d5cd5c2462p+6,-0x1.a3022c439e474p+7,-0x1.5302f6e2831eep+7,0x1.2cdeff41f668bp+6,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.4b4cab6bef0bep+7,0x0p+0,0x0p+0,0x1.d441972b9fefp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24b1bd3d57995p+1,-0x1.07afc7342f9f3p+6,0x1.19cb7300b57b2p+9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.dd9ff563e4d17p+6,0x1.24b1bd3d5797ep+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.337b12e5bd3ffp+3,0x0p+0,0x0p+0,-0x1.8e86ab8b3f911p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2b81115181745p+4,0x1.0628d58847693p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.40b05a9a155bfp+3,0x1.71ec38d4e89c7p+5,-0x1.473d7782f5a76p+7,-0x1.86760edcc6cfap+7,0x1.2cdeff41f66b5p+6,0x1.062e1a815ff38p+5,0x1.d84d57687afc7p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ec8dc2da52d8dp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.53b7e91f2d1cep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.21878f5a95f9ep+9,0x1.103e7b2b3201dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.daa7b4ac0ae2p+6,0x0p+0,-0x1.5a48fbd637b2ap+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.75a147b07db7ep+3,0x0p+0,0x1.1a00a34d15a6dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.08c3865d569fp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dc761ca57e9f6p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5ad619686e98dp+4,0x1.0fe26bc4f422dp+4,-0x1.489b5edd9a05dp+6,-0x1.43da47f55feep+6,0x1.712377bcf7b45p+2,0x1.5ad619686e98dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c78be3b6b0af2p+6,-0x1.3eae4b8ae429cp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.103e7b2b3201dp+4,0x1.848e3d76552ecp+8,0x0p+0,0x1.176b6fb3642e3p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.49a56eb90f8cfp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3edc33049d393p+4,0x0p+0,0x0p+0,0x0p+0,0x1.586940a1c6b95p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.11d6a33035964p+4,0x0p+0,0x0p+0,-0x1.d9711b55b284bp+6,0x0p+0,0x0p+0,0x1.652c6ae70b496p+1,0x1.c3173b753d4bap+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a2fb038a8e1b1p+2,0x1.fdbe16d5dfb77p+4,0x1.1636643588b02p+6,-0x1.c35eeeef9a96cp+6,0x1.27219cb032b2ap+6,0x1.8c5d7ffe807bcp+4,0x1.b684e4859aa7cp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.879612b8e0fcap+4,0x0p+0,0x0p+0,0x1.38bfd2ca421fdp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b6e458bfaf702p+8,-0x1.2093c41199c36p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c21bf95a1c632p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e648d530a4d18p+7,0x0p+0,0x0p+0,-0x1.ffef8f16f6876p+5,0x0p+0,0x0p+0,0x1.7eb20becbe981p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ef6bfac8a5702p+4,0x1.2709c1a54f935p+3,0x0p+0,0x0p+0,-0x1.19fa7a8b857fep+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.25d65619dbf6p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5856cfacb7014p+4,0x1.5c8d23c5ba355p+5,-0x1.867a798a6487bp+7,-0x1.757dc01e66e9p+7,0x1.a0bc96c2c2636p+5,0x1.40b05a9a155bfp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.0258ab5d3c282p+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.176b6fb3642e3p+4,-0x1.2093c41199c36p+7,0x1.2e443b8af6ee9p+9,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1f828803d39d5p+4,0x0p+0,0x0p+0,0x1.fe30e268cac82p+2,0x0p+0,0x0p+0,0x1.0ec4661043521p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1b1598abded16p+3,0x0p+0,0x0p+0,0x0p+0,-0x1.1ea42b0ddb3e8p+4,0x0p+0,0x0p+0,0x1.f28bc361de6a9p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6f14321576243p+4,0x1.1e5545470d9b6p+6,-0x1.1abd285609ac2p+7,-0x1.ac7b3bf4ad53ep+7,0x1.336d5cd5c2469p+6,0x1.062e1a815ff38p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3a927d756840dp+4,0x0p+0,0x0p+0,-0x1.29da6cebdba4cp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fdd14ca6b2d81p+2,-0x1.dd9ff563e4d17p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.097dc42abbec3p+9,-0x1.df92a2f8f47d7p+5,0x1.24b1bd3d57995p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b5e5afbf38fb2p+6,-0x1.2a6db320e2e2fp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e8b2c5abde75ep+3,0x1.1b43f0fb8bd9dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.eadf03585e08ep+2,0x1.0dc0b9d0367adp+4,0x1.ea29ae41d4cffp+5,-0x1.38777d0271c3cp+7,-0x1.35304e388bd7p+7,0x1.36a5e97d20789p+6,0x1.0f7a5b36a0a08p+4,0x1.eadf03585e056p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.420d8fe93b16ep+7,0x1.697da7c1e95dep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24b1bd3d5797ep+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.df92a2f8f47d7p+5,0x1.e506e5939336cp+8,-0x1.c58d46fa9c079p+6,0x1.24b1bd3d57995p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.39cfb66e33ec5p+4,-0x1.69276278b170ep+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2b80348b7603p+4,0x0p+0,0x0p+0,0x1.04c748a515b99p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,0x1.2cdeff41f66a7p+6,-0x1.5cb33ac05f743p+7,-0x1.1e3b8b4cbcdf6p+7,0x1.b9150f9b3ca54p+5,0x1.83e2126f967cdp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f860151e0af5p+3,-0x1.2b41c7a6f2ee1p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24b1bd3d57995p+1,-0x1.c58d46fa9c079p+6,0x1.efb6b002a81dep+8,-0x1.1020b3028fcf5p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.8b5943110649fp+6,0x0p+0,0x0p+0,0x1.47b5c5d25efafp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e31067ad1615fp+3,0x0p+0,0x0p+0,0x1.147c2143acba2p+4,0x1.1733ea712ebf3p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4cce8b831e0b2p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,0x1.336d5cd5c2462p+6,-0x1.a5ed2a279ad7ep+7,-0x1.ea23b4b843637p+6,0x1.5c77147a66e86p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.793fdb13c884fp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24b1bd3d57995p+1,-0x1.1020b3028fcf5p+6,0x1.1b54000358c81p+9,0x0p+0,0x0p+0,0x0p+0,0x1.c9302e9683ee9p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.48a1a00b30e9dp+3,0x0p+0,0x0p+0,-0x1.9ca44c8792356p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.15fd5af8819eep+4,-0x1.27612238327b6p+7,0x0p+0,0x1.7699501dd8129p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.062e1a815ff38p+5,0x1.336d5cd5c2477p+6,-0x1.a3022c439e497p+7,-0x1.5302f6e283211p+7,0x1.2cdeff41f66ap+6,0x1.062e1a815ff38p+5,0x1.d84d57687afc7p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.33a804c5344a4p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c21bf95a1c632p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.18643e5468c83p+9,-0x1.08c7ed5cd1d5dp+6,0x1.24b1bd3d57995p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e9cf1a2528d6cp+6,0x0p+0,0x0p+0,-0x1.b117976646999p+6,-0x1.576d872855c0dp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dbb9a12366905p+3,0x1.4f99ec924dc25p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d84d57687af6dp+0,0x1.062e1a815ff38p+5,0x1.2cdeff41f6699p+6,-0x1.5cb33ac05f743p+7,-0x1.1e3b8b4cbcdf6p+7,0x1.b98865d5af1adp+5,0x1.6d5a90af0bfe7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3e7008c984447p+7,0x1.53b7e91f2d15ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.08c7ed5cd1d5dp+6,0x1.f50049c0ee09dp+8,-0x1.d335e37a1afd8p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fdd14ca6b2d54p+2,0x0p+0,0x0p+0,0x1.93c7cea89b8b1p+3,-0x1.7ca038520b7a6p+6,0x0p+0,0x0p+0,0x1.75a147b07db46p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.719cc888aa1aap+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.40b05a9a155bfp+3,0x1.b3853934ccc3cp+5,-0x1.61796938aa8ep+7,-0x1.5ef32254f3327p+7,0x1.36a5e97d20774p+6,0x1.0f7a5b36a0a08p+4,0x1.eadf03585e029p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.01a92acbb1723p+4,-0x1.db5842917e83ap+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.24b1bd3d57995p+1,-0x1.d335e37a1afd8p+6,0x1.1866a8fa9ddep+9,0x1.0a8e61c97e157p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6e45f902d3a89p+6,0x0p+0,0x0p+0,0x1.1034e04a36c94p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.00604309308cbp+4,0x0p+0,0x0p+0,0x0p+0,0x1.4d8bd28607cf7p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ff7057c818d8bp+5,-0x1.b6e4fff4551d6p+5,-0x1.12dcb21001dbap+2,0x1.5ad619686e98dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0fc1bb0bc577dp+4,0x1.068270418ffcdp+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9e7e220f9e74ep+2,0x0p+0,-0x1.260052069bb03p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c9302e9683ee9p+2,0x0p+0,0x0p+0,0x1.0a8e61c97e157p+4,0x1.b5d614dbe0984p+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.fa91b83cf08b1p+3,0x1.741298d51f09fp+4,0x0p+0,0x1.ee7facfc6191dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8987c340b9319p+3,-0x1.6a185ecb2c6ebp+7,0x0p+0,-0x1.557df335b38ddp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.30792c993e62fp+3,0x1.0f7a5b36a0a08p+4,0x1.36a5e97d20797p+6,-0x1.5ef32254f334ap+7,-0x1.61298001339d4p+7,0x1.c1adf1d54ac64p+5,0x1.336b8f69a2d5ap+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.20346851c286ep+2,0x0p+0,0x1.1f706f9370f46p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.d5f38c4963698p+7,0x1.d710c826e26c4p+3,0x0p+0,0x0p+0,0x0p+0,-0x1.daa7b4ac0ae2p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.18435d8ac1178p+9,0x0p+0,-0x1.6c567e16b1686p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0b09af4c7d498p+4,0x0p+0,0x1.00604309308afp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3194fa15f71b7p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.61e01c4c8f35cp+4,0x1.791e25fa6443bp+2,0x1.93b824faa12d5p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0cc34e5ad0232p+4,0x1.75b55d4c7005fp+0,0x1.0df7bd7f6c5f7p+4,0x1.630f16efc0d13p+4,0x0p+0,0x1.0cc34e5ad0232p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a97787918e255p+5,-0x1.c6b4de12dafa1p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d3360071445f7p+2,-0x1.4f5ac5e4462efp-2,-0x1.8a44d2fbbaeb7p+6,-0x1.6d4d8caf3b528p+6,0x1.337b12e5bd3ffp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.920435520ddf4p+8,0x0p+0,0x0p+0,0x1.0ac12b76c6a4bp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1227f43659a12p+3,-0x1.4d0cefca95161p+7,0x0p+0,-0x1.3e8f3fb0f6bc5p+4,0x1.6cffed1c8ecep+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.518fcf93a07d5p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.da46fc0511712p+3,0x1.e7c11b1f30495p+3,0x1.4f3fd0814ee9dp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.15f480a0e43cdp+3,0x1.0996b02f31a5dp+1,0x1.0df7bd7f6c5f7p+4,0x1.630f16efc0cf7p+4,0x1.3af00623e6907p-1,0x1.19ab81c1e30f5p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.347bccb87e1fap+4,0x0p+0,-0x1.04690f6bfbf8bp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.040795cd1993bp+6,0x1.13b0c50438682p+1,0x0p+0,0x0p+0,0x0p+0,-0x1.5a48fbd637b23p+6,0x1.49a56eb90f8cfp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.6c567e16b1686p+6,0x0p+0,0x1.6a30d8f15c5afp+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.caaa8b90d63dbp+5,0x0p+0,-0x1.1a1bfcae926a7p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.50f3e722949a1p+3,0x1.6f982149d385fp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6f14321576243p+4,0x1.3e9c52d225e74p+6,-0x1.5ef32254f3327p+7,-0x1.61298001339bp+7,0x1.c10d6128e9b0dp+5,0x1.336b8f69a2d65p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9f94457b7b81cp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e648d530a4d18p+7,0x1.1f828803d39d5p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.e9cf1a2528d6cp+6,0x1.fdd14ca6b2d54p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.19463f28ef3dep+9,0x0p+0,0x0p+0,-0x1.5ec19c30b0bdp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1bea199c721dap+4,0x1.6ae8d25ce7f9p+3,0x0p+0,0x0p+0,0x1.6818185edb00ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.93b824faa130dp+3,0x1.69ebb7104f8cfp+2,0x1.93b824faa130dp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.241ea42f9723ap+4,0x1.0df7bd7f6c5dbp+4,0x1.630f16efc0cdap+4,0x1.0cc34e5ad0232p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3b360383b0d66p+6,0x0p+0,0x0p+0,-0x1.d7ff9add37003p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.55db00cc7254dp+2,-0x1.8e86ab8b3f911p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b5e5afbf38fb2p+6,0x1.39cfb66e33ec5p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0ac12b76c6a4bp+4,0x0p+0,0x0p+0,0x1.af6a3e60ae7f3p+8,0x1.0c54b7d30838dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d5c8372b58c7ap+3,0x0p+0,-0x1.8d2aed2ebee58p+7,-0x1.57295300e0aadp+3,0x0p+0,0x0p+0,0x1.6dcf117faf1dbp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.930db3415cb9p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a5e47f5ac0c02p+3,0x1.696a65a1e5b7ap+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0cc34e5ad0215p+4,0x0p+0,0x1.630f16efc0cf7p+4,0x1.0df7bd7f6c5f7p+4,0x1.75b55d4c7005fp+0,0x1.0cc34e5ad0232p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3c47506560f6p+6,-0x1.d866e76ffa993p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2a6db320e2e2fp+2,-0x1.69276278b170ep+6,-0x1.8b5943110649fp+6,0x1.48a1a00b30e9dp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0c54b7d30838dp+4,0x1.af39e10a9b275p+8,0x0p+0,0x0p+0,0x1.598d439a51eb9p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d5c8372b58c09p+3,-0x1.90dd7cafe67dcp+7,0x0p+0,0x0p+0,-0x1.9affc4c012efdp+1,0x0p+0,0x0p+0,0x1.53dfc319dc20cp+2,0x0p+0,0x0p+0,0x0p+0,0x1.3b46a3c04f002p+3,0x1.f4b61ea1b978cp+3,0x1.10aada8eb6d08p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.241ea42f9723ap+4,0x1.0df7bd7f6c5f7p+4,0x1.630f16efc0cf7p+4,0x1.3af00623e68ebp-1,0x1.051af7f5bfaebp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1089d8aa3585cp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ffef8f16f6876p+5,0x1.fe30e268cac82p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.b117976646999p+6,0x1.93c7cea89b8e9p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5ec19c30b0bdp+6,0x0p+0,0x0p+0,0x1.6d0062c540cc3p+8,0x1.9d89ea8c3ad18p+3,0x0p+0,0x0p+0,0x1.c057012998fe3p+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.18e774793de29p+7,-0x1.084c758ef09ecp+6,0x0p+0,0x0p+0,0x1.7f5ef6fff5e34p+4,0x0p+0,0x0p+0,0x0p+0,0x1.4aeb3b082c13dp+3,0x1.e7c11b1f30495p+3,0x1.047e895db06f2p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2a850a6d079e2p+3,0x1.3af00623e68e2p-1,0x1.630f16efc0d13p+4,0x1.0df7bd7f6c5f7p+4,0x1.75b55d4c7005fp+0,0x1.0cc34e5ad024ep+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a3365fa416109p+5,-0x1.19922aa5673b3p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.576d872855c24p+1,-0x1.7ca038520b7a6p+6,-0x1.6e45f902d3a89p+6,0x1.fa91b83cf08b1p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.9d89ea8c3ad18p+3,0x1.675c97e3a0867p+8,0x0p+0,0x0p+0,-0x1.02d2bb7c2fd29p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.a89200b841d89p+2,-0x1.f5eadf59e80e4p+6,0x1.a020da6688b39p-1,0x0p+0,0x0p+0,0x1.75821c177cffep+2,0x0p+0,0x0p+0,0x1.908f01caeb6f9p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.05c806747cc97p+3,0x1.e9dbe1e3484e5p+1,0x1.247f6d9bc5dc1p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0e43b3039f82ep+4,0x1.8d4381994be0cp+3,0x1.0f6ee503aef53p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2cbbfab195999p+6,0x0p+0,0x1.c6ae5292763aep+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.47b5c5d25efafp+2,-0x1.9ca44c8792356p+5,0x0p+0,0x0p+0,0x0p+0,0x1.741298d51f09fp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.598d439a51eb9p+3,0x0p+0,0x0p+0,0x1.b774ab31f9b9bp+8,0x0p+0,0x1.c8b963bb56613p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d05c28417c38fp+3,0x0p+0,0x0p+0,-0x1.25b2cd1d441dbp+7,-0x1.56dbf2a84be09p+7,0x0p+0,-0x1.33dc8118d9621p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b5c0342b93ffbp+3,-0x1.78168da8f79eap+6,-0x1.316132eb599dbp+6,0x1.d14f8f0d201abp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.712188a528fd3p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.eac55195a6054p+3,-0x1.123abd9eeb4c3p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3edc33049d393p+4,0x1.7eb20becbe981p+4,0x1.0ec4661043526p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.aa8ff814fbf32p+8,0x0p+0,0x0p+0,0x0p+0,0x1.b6d6de59c8195p+4,0x0p+0,0x0p+0,0x1.0062cadc4a81dp+5,0x0p+0,0x0p+0,0x0p+0,-0x1.5204c6944681dp+7,0x0p+0,0x0p+0,-0x1.7302f114c6a59p+7,-0x1.31fe29bc515a8p+6,-0x1.1c9e37fd229fep+6,0x1.867053031adfcp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.734834f8c538cp+3,0x0p+0,0x0p+0,0x1.c6196ecaf39b8p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.60a4604bea137p+3,0x1.0c44f252677f5p+3,-0x1.6f5142de8a35cp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.75a147b07db46p+3,0x1.1034e04a36c78p+4,0x1.ee7facfc6191dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c057012998fe3p+1,-0x1.02d2bb7c2fd29p+6,0x1.c8b963bb56613p+3,0x0p+0,0x1.7833d2c078e1dp+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3cc1d15e9b6f2p+2,0x1.adddc6373bdf7p+2,-0x1.7fd7e303ed878p+4,0x1.f9a346cf85383p+2,0x0p+0,0x0p+0,-0x1.94b7dd0410fc2p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2a1d9c60f5e76p+4,-0x1.09988f8e7a772p+6,-0x1.badb613df8c03p+5,0x1.c6ea49b3c511dp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d1496a2db72b9p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.16fba18fd70eep+2,0x0p+0,0x1.265e30716d90dp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.baae9532ab9dbp+6,0x1.e3b439dd2b5e9p+4,0x0p+0,0x0p+0,0x0p+0,0x1.75a147b07db7ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0b09af4c7d498p+4,0x1.1227f43659a12p+3,-0x1.caaa8b90d63dbp+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.62e64c06b35e4p+8,0x1.5c0056abd3da1p+4,-0x1.3f0e501c326c7p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5b3aea946871ep+7,0x1.66fed59ec062p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.f1769d4365095p+3,-0x1.6ed42b640a49dp+6,-0x1.3d14721db598p+6,0x1.a8a362e3b83cep+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7295c2ca5de59p+3,0x1.ed7c67d73257fp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.c7310a9bb2b58p+2,0x0p+0,0x1.fdfdf365ea8d8p+3,0x1.38c59e0aac1e8p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.4d0cefca95161p+7,0x0p+0,0x0p+0,0x1.d5c8372b58c7ap+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.5c0056abd3da1p+4,0x1.a8c253549c371p+8,0x0p+0,-0x1.bff0d3b5ee58ap+5,0x1.6c88c2dc2e07dp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.2662b614c91d7p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d4d8fe3a90569p+3,-0x1.715d8d700ce4bp+6,-0x1.0fe1b7867330ep+6,0x1.a98e7f012bdd9p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ffe8cf65490dap+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1179ddd81d415p+5,0x1.e1f3b43af054fp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d2b5d16980537p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1a00a34d15a6dp+4,0x1.586940a1c6b95p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.00604309308afp+4,0x0p+0,-0x1.1a1bfcae926a7p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.b6d6de59c8195p+4,0x0p+0,-0x1.3f0e501c326c7p+5,0x0p+0,0x1.7a8bf60d70b5ap+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.ed7cf3d57369cp+3,-0x1.28e05658c60a6p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.675d45cb97cf9p+4,-0x1.6c1696b6c3e54p+6,-0x1.2a8d3e9571221p+6,0x1.a0b2da8bffcdp+1,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.56461e65049a7p+3,-0x1.9b6862dc4a1bep+5,0x0p+0,0x0p+0,0x1.3bb55dfc4133dp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.05c4fded33fe1p+3,0x1.1b43f0fb8bd9dp+4,0x1.2b81115181745p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e8b2c5abde75ep+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.3e8f3fb0f6bc5p+4,0x0p+0,0x0p+0,-0x1.8d2aed2ebee58p+7,0x1.d5c8372b58c09p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.bff0d3b5ee58ap+5,0x0p+0,0x1.89b91d2219bdbp+8,-0x1.7fcffcbcdbf78p+5,0x0p+0,0x0p+0,0x1.6f6c74d9ecdddp+2,0x0p+0,0x0p+0,0x0p+0,0x1.2c54cf456b1a6p+3,0x0p+0,0x1.0df97df1c2c6bp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0d4b80ceb0299p+4,-0x1.6e58589ef504cp+6,-0x1.2a67e1c99dd11p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.edf4107447802p-7,0x0p+0,0x0p+0,-0x1.95b29f6d4920bp+5,0x1.4b36f0d8771f5p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0628d58847693p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1b43f0fb8bd9dp+4,0x1.2b80348b7603p+4,0x1.e31067ad1615fp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6cffed1c8ecep+2,0x0p+0,0x0p+0,-0x1.57295300e0aadp+3,-0x1.90dd7cafe67dcp+7,0x0p+0,0x0p+0,0x1.d05c28417c38fp+3,0x0p+0,0x1.3cc1d15e9b6f2p+2,0x0p+0,0x1.6c88c2dc2e07dp+2,0x0p+0,-0x1.7fcffcbcdbf78p+5,0x1.8923d9f69817bp+8,0x0p+0,0x0p+0,-0x1.8b8b7b5899805p+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.16363fb0b2c27p+3,-0x1.04b094aac0a65p+6,-0x1.8e456772f54c1p+6,0x1.e17e5c670322p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1ff2db8313e8cp+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2e7eeaed1249ap+3,0x0p+0,0x0p+0,0x1.7d8256eda5c73p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.ef6bfac8a5702p+4,0x1.1b1598abded16p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dbb9a12366905p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1bea199c721dap+4,0x0p+0,0x0p+0,-0x1.18e774793de29p+7,0x1.a89200b841d89p+2,0x0p+0,0x1.0062cadc4a81dp+5,0x1.adddc6373bdf7p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.761e8ef1c90bep+8,-0x1.f67bf7e9c712fp+4,0x0p+0,0x0p+0,-0x1.1e0f097f7c50ep+7,0x0p+0,0x0p+0,0x0p+0,0x1.929b5aa49bf0dp+2,-0x1.1266ae5f23fe3p+6,-0x1.19be37ebf4616p+6,0x1.27a70fc5e21e8p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.251e8ec7c5fdcp+6,0x1.9e514c8d468c8p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.2709c1a54f92fp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4f99ec924dc25p+4,0x1.719cc888aa1aap+4,0x1.00604309308cbp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6ae8d25ce7f9p+3,0x0p+0,0x0p+0,-0x1.084c758ef09ecp+6,-0x1.f5eadf59e80e4p+6,0x0p+0,0x0p+0,-0x1.7fd7e303ed878p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.f67bf7e9c712fp+4,0x1.3abbf1c412ba8p+8,0x1.182d9a11402cap+3,0x0p+0,0x1.66dfba9f657f8p+3,0x1.8bc9b5a086e2p+2,0x0p+0,0x0p+0,-0x1.8dd46ca643163p+6,0x1.1ae010713de85p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.0d9048d272de5p+4,-0x1.3fe59c45f93f1p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.784f9d7ead4p-4,-0x1.0a39dd05559p+6,0x0p+0,0x1.6c68fac61e9a8p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.04c748a515b99p+3,0x1.147c2143acba2p+4,0x1.15fd5af8819eep+4,0x0p+0,0x0p+0,0x0p+0,0x1.8987c340b9319p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6dcf117faf1dbp+2,-0x1.9affc4c012efdp+1,0x0p+0,0x1.a020da6688b3p-1,-0x1.25b2cd1d441dbp+7,0x0p+0,0x1.f9a346cf8536dp+2,0x0p+0,0x0p+0,0x0p+0,0x1.6f6c74d9ecdddp+2,-0x1.8b8b7b5899805p+5,0x0p+0,0x1.182d9a11402cap+3,0x1.647cb8115401fp+8,0x1.d16353ee3df43p+4,0x0p+0,-0x1.bb32573f16becp+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.a7631566c5b74p+4,0x1.34cfd20a8d5e2p+2,0x1.50bdbbb351494p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8a6208a1d1cf4p+4,0x1.f6075245f1fap+3,-0x1.c071f49094b9dp+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.90181e24a5dap+4,0x0p+0,0x1.a25ae6da149cap+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.1733ea712ebf3p+3,-0x1.27612238327b6p+7,0x0p+0,0x0p+0,0x0p+0,-0x1.6a185ecb2c6ebp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.56dbf2a84be09p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.d16353ee3df43p+4,0x1.d0876b3f77475p+8,0x0p+0,0x1.00e2ca2ddac6ep+5,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.dee59750b101fp+2,0x1.bbe1d89d61de7p+4,0x1.c44eaaad31d5bp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e5b52cf64f397p+3,0x1.697062be35b05p+1,0x1.421ff3f9efec1p-1,0x1.2451ee3da4063p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.9f05c6ed79e51p+6,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.11d6a33035964p+4,-0x1.19fa7a8b857fep+7,-0x1.1ea42b0ddb3e8p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6818185edb00ep+3,0x0p+0,0x0p+0,0x1.7f5ef6fff5e34p+4,0x0p+0,0x0p+0,-0x1.5204c6944681dp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.1e0f097f7c50ep+7,0x1.66dfba9f657f8p+3,0x0p+0,0x0p+0,0x1.9e24ea12e003p+8,0x0p+0,0x0p+0,0x1.873cc5166ba41p+4,0x1.2924877dc5d46p+4,0x1.09a3f30851ca1p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.23d72b03b9af9p+3,0x1.67fa508fe64ep+3,0x1.af9de00cf4d9bp+1,0x1.1216ea4602118p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7b654d0d2f613p+0,0x0p+0,-0x1.289ab4bcf5458p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.7699501dd8129p+3,0x0p+0,0x0p+0,0x1.4d8bd28607cf7p+1,-0x1.557df335b38ddp+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.53dfc319dc20cp+2,0x0p+0,0x1.75821c177cffep+2,-0x1.33dc8118d9621p+7,0x0p+0,-0x1.94b7dd0410fc2p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.8bc9b5a086e2p+2,-0x1.bb32573f16becp+5,0x1.00e2ca2ddac6ep+5,0x0p+0,0x1.d73893d3c8346p+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.84626b7a6f86ep+3,-0x1.e32fd7fb044bap+3,0x1.79fb1c20b72b2p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6f81647fc2cc7p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.c3246fd6f6608p+7,0x1.6a598b37e98e7p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.dedc1bb71aafap+3,0x1.673c77a74b78fp+3,0x1.66ae694485f35p+4,0x1.65d1c781065cdp+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.3194fa15f71b7p+0,-0x1.518fcf93a07d5p+4,-0x1.50f3e722949a1p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.5b3aea946871ep+7,-0x1.2662b614c91d7p+7,0x1.ed7cf3d57369cp+3,0x1.2c54cf456b1a6p+3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.e4aa1fbdc6b98p+8,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.4fbff30cdcc37p+4,0x1.25deea0c2c1f9p+4,0x1.f0f50b9646f54p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.372a7c92eecb2p+2,0x1.953ae6e6b8987p+1,0x1.b7935228dacd9p+1,0x1.0861c84586355p+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.82eedf26dceabp+6,-0x1.7b15f0fd0b4cap-3,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.08c3865d569fp+3,-0x1.d9711b55b284bp+6,0x0p+0,0x1.f28bc361de6a9p+2,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.6f982149d385fp+4,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,-0x1.7302f114c6a59p+7,0x0p+0,0x1.66fed59ec062p+3,0x0p+0,-0x1.28e05658c60a6p+7,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x0p+0,0x1.873cc5166ba41p+4,0x0p+0,0x0p+0,0x1.8f694fd7f0c1ap+8}; + Eigen::MatrixXd Qexact = Eigen::Map(&(initvec[0]), 99, 99); + + test_common::assert_near(Q,Qexact,1e-12); +} diff --git a/vendor/libigl/tests/include/igl/cut_mesh.cpp b/vendor/libigl/tests/include/igl/cut_mesh.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b91affd61ba24340ed28be1473d126ddc411d92a --- /dev/null +++ b/vendor/libigl/tests/include/igl/cut_mesh.cpp @@ -0,0 +1,86 @@ +#include +#include +#include +#include + +TEST_CASE("seperate mesh", "[igl]") { + + Eigen::MatrixXd V(9,3); + V << 0,0,0, + 0,1,0, + 0,2,0, + 1,2,0, + 2,2,0, + 2,1,0, + 2,0,0, + 1,0,0, + 1,1,0; + Eigen::MatrixXi F(8,3); + F << 0,1,8, + 1,2,8, + 2,3,8, + 3,4,8, + 4,5,8, + 5,6,8, + 6,7,8, + 7,0,8; + + Eigen::MatrixXi C(8,3); + C << 0,1,1, + 0,1,1, + 0,0,1, + 0,0,0, + 0,0,0, + 0,0,0, + 0,0,0, + 0,1,0; + Eigen::VectorXi I; + igl::cut_mesh(V,F,C,I); + Eigen::VectorXi count; + igl::vertex_components(F, count); + REQUIRE(count.maxCoeff() == 2); + +} + +TEST_CASE("single edge", "[igl]") { + + Eigen::MatrixXd V(9,3); + V << 0,0,0, + 0,1,0, + 0,2,0, + 1,2,0, + 2,2,0, + 2,1,0, + 2,0,0, + 1,0,0, + 1,1,0; + Eigen::MatrixXi F(8,3); + F << 0,1,8, + 1,2,8, + 2,3,8, + 3,4,8, + 4,5,8, + 5,6,8, + 6,7,8, + 7,0,8; + + Eigen::MatrixXi C(8,3); + C << 0,1,0, + 0,0,1, + 0,0,0, + 0,0,0, + 0,0,0, + 0,0,0, + 0,0,0, + 0,0,0; + Eigen::VectorXi I; + igl::cut_mesh(V,F,C,I); + Eigen::VectorXi count; + igl::vertex_components(F, count); + REQUIRE(0 == count.maxCoeff()); + Eigen::MatrixXi E; + igl::edges(F, E); + const auto euler = V.rows() - E.rows() + F.rows(); + REQUIRE ( 1 == euler ); + +} \ No newline at end of file diff --git a/vendor/libigl/tests/include/igl/cut_to_disk.cpp b/vendor/libigl/tests/include/igl/cut_to_disk.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4abb625ec86c37fad11a0c8a2bab5058429efa24 --- /dev/null +++ b/vendor/libigl/tests/include/igl/cut_to_disk.cpp @@ -0,0 +1,146 @@ +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace cut_to_disk_helper { + template + void assert_is_disk( + const Eigen::PlainObjectBase& V, + const Eigen::PlainObjectBase& F, + const std::vector>& cuts) { + using namespace igl; + std::set> cut_edges; + for (const auto& cut : cuts) { + const size_t cut_len = cut.size(); + for (size_t i=0; i e{cut[i], cut[i+1]}; + if (e[0] > e[1]) { + std::swap(e[0], e[1]); + } + cut_edges.insert(e); + } + } + + const size_t num_faces = F.rows(); + Eigen::MatrixXi cut_mask(num_faces, 3); + cut_mask.setZero(); + for (size_t i=0; i e0{F(i, 0), F(i, 1)}; + std::array e1{F(i, 1), F(i, 2)}; + std::array e2{F(i, 2), F(i, 0)}; + if (e0[0] > e0[1]) std::swap(e0[0], e0[1]); + if (e1[0] > e1[1]) std::swap(e1[0], e1[1]); + if (e2[0] > e2[1]) std::swap(e2[0], e2[1]); + + if (cut_edges.find(e0) != cut_edges.end()) { + cut_mask(i, 0) = 1; + } + if (cut_edges.find(e1) != cut_edges.end()) { + cut_mask(i, 1) = 1; + } + if (cut_edges.find(e2) != cut_edges.end()) { + cut_mask(i, 2) = 1; + } + } + + Eigen::MatrixXd V2; + Eigen::MatrixXi F2; + igl::cut_mesh(V, F, cut_mask, V2, F2); + + Eigen::MatrixXi E2; + edges(F2, E2); + const auto euler = V2.rows() - E2.rows() + F2.rows(); + CHECK ((1 == euler || 2 == euler)); + } +} + +TEST_CASE("cut_to_disk: simple_tet", "[igl]") +{ + using namespace igl; + Eigen::MatrixXi F(4, 3); + F << 0, 2, 1, + 0, 3, 2, + 1, 2, 3, + 0, 1, 3; + std::vector> cuts; + cut_to_disk(F, cuts); + REQUIRE (cuts.size() == 0); +} + +TEST_CASE("cut_to_disk: two_disconnected_tet", "[igl]") +{ + using namespace igl; + Eigen::MatrixXi F(8, 3); + F << 0, 2, 1, + 0, 3, 2, + 1, 2, 3, + 0, 1, 3, + 4, 6, 5, + 4, 7, 6, + 5, 6, 7, + 4, 5, 7; + std::vector> cuts; + cut_to_disk(F, cuts); + REQUIRE (cuts.size() == 0); +} + +TEST_CASE("cut_to_disk: simple_square", "[igl]") +{ + using namespace igl; + Eigen::MatrixXi F(2, 3); + F << 0, 1, 2, + 2, 1, 3; + std::vector> cuts; + cut_to_disk(F, cuts); + REQUIRE (cuts.size() == 1); + REQUIRE (cuts[0].size() == 5); + REQUIRE (cuts[0][4] == cuts[0][0]); +} + +TEST_CASE("cut_to_disk: torus", "[igl]") +{ + using namespace igl; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("TinyTorus.obj"), V, F); + + std::vector> cuts; + cut_to_disk(F, cuts); + REQUIRE (cuts.size() == 2); + + cut_to_disk_helper::assert_is_disk(V, F, cuts); +} + +TEST_CASE("cut_to_disk: cube", "[igl]") +{ + using namespace igl; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + std::vector> cuts; + cut_to_disk(F, cuts); + REQUIRE (cuts.size() == 0); + + cut_to_disk_helper::assert_is_disk(V, F, cuts); +} + +TEST_CASE("cut_to_disk: annulus", "[igl]") { + // Unit test for https://github.com/libigl/libigl/pull/984 + using namespace igl; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("annulus.obj"), V, F); + + std::vector> cuts; + cut_to_disk(F, cuts); + + cut_to_disk_helper::assert_is_disk(V, F, cuts); +} + diff --git a/vendor/libigl/tests/include/igl/decimate.cpp b/vendor/libigl/tests/include/igl/decimate.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0b889253fb00bbee4daa00e1be6c331e49525741 --- /dev/null +++ b/vendor/libigl/tests/include/igl/decimate.cpp @@ -0,0 +1,74 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +// class decimate : public ::testing::TestWithParam {}; + +TEST_CASE("decimate: hemisphere", "[igl]") +{ + // Load a hemisphere centered at the origin. For each original vertex compute + // its "perfect normal" (i.e., its position treated as unit vectors). + // Decimate the model and using the birth indices of the output vertices grab + // their original "perfect normals" and compare them to their current + // positions treated as unit vectors. If vertices have not moved much, then + // these should be similar (mostly this is checking if the birth indices are + // sane). + Eigen::MatrixXd V,U; + Eigen::MatrixXi F,G; + Eigen::VectorXi J,I; + // Load example mesh: GetParam() will be name of mesh file + igl::read_triangle_mesh(test_common::data_path("hemisphere.obj"), V, F); + // Perfect normals from positions + Eigen::MatrixXd NV = V.rowwise().normalized(); + // Remove half of the faces + igl::decimate(V,F,F.rows()/2,U,G,J,I); + // Expect that all normals still point in same direction as original + Eigen::MatrixXd NU = U.rowwise().normalized(); + Eigen::MatrixXd NVI; + igl::slice(NV,I,1,NVI); + REQUIRE (NU.rows() == NVI.rows()); + REQUIRE (NU.cols() == NVI.cols()); + // Dot product + Eigen::VectorXd D = (NU.array()*NVI.array()).rowwise().sum(); + Eigen::VectorXd O = Eigen::VectorXd::Ones(D.rows()); + // 0.2 chosen to succeed on 256 face hemisphere.obj reduced to 128 faces + test_common::assert_near(D,O,0.02); +} + +TEST_CASE("decimate: closed", "[igl]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V,U; + Eigen::MatrixXi F,G; + Eigen::VectorXi J; + // Load example mesh: GetParam() will be name of mesh file + igl::read_triangle_mesh(test_common::data_path(param), V, F); + igl::decimate(V,F,0,U,G,J); + REQUIRE (4 == U.rows()); + REQUIRE (4 == G.rows()); + { + Eigen::MatrixXi I; + igl::sort(Eigen::MatrixXi(G),2,true,G,I); + } + { + Eigen::VectorXi I; + igl::sortrows(Eigen::MatrixXi(G),true,G,I); + } + // Tet with sorted faces + Eigen::MatrixXi T(4,3); + T<< + 0,1,2, + 0,1,3, + 0,2,3, + 1,2,3; + test_common::assert_eq(G,T); + }; + + test_common::run_test_cases(test_common::closed_genus_0_meshes(), test_case); +} diff --git a/vendor/libigl/tests/include/igl/delaunay_triangulation.cpp b/vendor/libigl/tests/include/igl/delaunay_triangulation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..970ef3039cfb695df305b73ee24e1edaead007a1 --- /dev/null +++ b/vendor/libigl/tests/include/igl/delaunay_triangulation.cpp @@ -0,0 +1,103 @@ +#ifdef IGL_STATIC_LIBRARY +#undef IGL_STATIC_LIBRARY +#endif + +#include +#include + +namespace git_issue { + +constexpr static double EPSILON_LENGTH = 0.0005; // Sketchup support 1/1000 precision +constexpr static double EPSILON_ANGLE = 0.0000000000005; +constexpr static double INV_EPSILON_LENGTH = 2000.0; + +template +inline int orient2d(const T &pa, const T &pb, const T &pc) { + double acx, bcx, acy, bcy; + acx = pa[0] - pc[0]; + bcx = pb[0] - pc[0]; + acy = pa[1] - pc[1]; + bcy = pb[1] - pc[1]; + + double val = acx * bcy - acy * bcx; + if (val < -EPSILON_LENGTH) { + return -1; + } else if (val > EPSILON_LENGTH) { + return 1; + } else { + return 0; + } + return 0; +} + +template +inline int incircle(const T &pa, const T &pb, const T &pc, const T &pd) { + double adx, ady, bdx, bdy, cdx, cdy; + double abdet, bcdet, cadet; + double alift, blift, clift; + + adx = pa[0] - pd[0]; + ady = pa[1] - pd[1]; + bdx = pb[0] - pd[0]; + bdy = pb[1] - pd[1]; + cdx = pc[0] - pd[0]; + cdy = pc[1] - pd[1]; + + abdet = adx * bdy - bdx * ady; + bcdet = bdx * cdy - cdx * bdy; + cadet = cdx * ady - adx * cdy; + alift = adx * adx + ady * ady; + blift = bdx * bdx + bdy * bdy; + clift = cdx * cdx + cdy * cdy; + + double val = alift * bcdet + blift * cadet + clift * abdet; + if (val < -EPSILON_LENGTH) { + return -1; + } else if (val > EPSILON_LENGTH) { + return 1; + } else { + return 0; + } + return 0; +} +} + + +TEST_CASE("delaunay_triangulation_issue_521", "[igl]") { + using namespace Eigen; + using namespace git_issue; + MatrixXd V(16, 2); + MatrixXi F; + + V << 4.55E-13, 2.33E-12, + 248.718, 249.939, + 463.602, 36.1059, + 764.953, 338.937, + -1002.42, 2097.68, + -1303.78, 1794.85, + -1120.79, 1612.75, + -1369.5, 1362.81, + -1552.49, 1544.91, + -1843.04, 1252.94, + -75.6625, -505.806, + 214.883, -213.834, + -191.721, 190.784, + -1166.14, 1160.44, + -917.424, 1410.38, + 56.9975, 440.723; + + const auto &orient2d_predicates = [](const double * pa, const double * pb, const double * pc) { + return orient2d(pa, pb, pc); + }; + const auto &incircle_predicates = [](const double * pa, const double * pb, const double * pc, const double * pd) { + return incircle(pa, pb, pc, pd); + }; + + igl::delaunay_triangulation(V, orient2d_predicates, incircle_predicates, F); + + REQUIRE(F.rows() > 0); + REQUIRE(F.cols() == 3); + REQUIRE(F.maxCoeff() < 16); + REQUIRE(F.minCoeff() == 0); +} + diff --git a/vendor/libigl/tests/include/igl/dijkstra.cpp b/vendor/libigl/tests/include/igl/dijkstra.cpp new file mode 100644 index 0000000000000000000000000000000000000000..021acafa7181847b4b246cba6174c37e128af714 --- /dev/null +++ b/vendor/libigl/tests/include/igl/dijkstra.cpp @@ -0,0 +1,40 @@ +#include +#include +#include +#include + +TEST_CASE("dijkstra: cube", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.off"), V, F); + + std::vector> VV; + igl::adjacency_list(F, VV); + + Eigen::VectorXd min_distance; + Eigen::VectorXi previous; + igl::dijkstra(V, VV, 0, {7}, min_distance, previous); + + REQUIRE(min_distance(0) == 0); + REQUIRE(min_distance(7) == Approx(sqrt(2)).margin(1e-10)); +} + +TEST_CASE("dijkstra: discrete distances", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("cube.off"), V, F); + + std::vector> VV; + igl::adjacency_list(F, VV); + + Eigen::VectorXi min_distance, previous; + int out = igl::dijkstra(0, {3}, VV, min_distance, previous); + REQUIRE(out != -1); + REQUIRE(out == 3); + REQUIRE(min_distance[3] == 1); + REQUIRE(min_distance[0] == 0); +} + diff --git a/vendor/libigl/tests/include/igl/direct_delta_mush.cpp b/vendor/libigl/tests/include/igl/direct_delta_mush.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7419e4b193179dcb2d8a6592f5378ff945511d6a --- /dev/null +++ b/vendor/libigl/tests/include/igl/direct_delta_mush.cpp @@ -0,0 +1,25 @@ +#include +#include +#include +#include + +TEST_CASE("direct_delta_mush: cube", "[igl]") +{ + Eigen::MatrixXd V, W, U, Omega; + Eigen::MatrixXi F; + + // Test that direct delta mush with identity transform reproduces the rest state of the mesh. + // For simplicity, testing on a cube of dimensions 1.0 x 1.0 x 1.0, + // with all vertices bound strictly to one and only one imaginary bone (weight is a column of 1s) + igl::read_triangle_mesh(test_common::data_path("cube.off"), V, F); + W = Eigen::MatrixXd::Ones(V.rows(), 1); + + // Parameters such as p, lambda, kappa, alpha do not matter given identity transform + igl::direct_delta_mush_precomputation(V, F, W, 1, 1., 0.5, 0.5, Omega); + + std::vector> T_list; + T_list.push_back(Eigen::Affine3d::Identity()); + igl::direct_delta_mush(V, T_list, Omega, U); + + test_common::assert_near(U, V, 1e-4); +} diff --git a/vendor/libigl/tests/include/igl/dirname.cpp b/vendor/libigl/tests/include/igl/dirname.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4511b90f0841876effc5816e7a6f0a14bc5f850b --- /dev/null +++ b/vendor/libigl/tests/include/igl/dirname.cpp @@ -0,0 +1,47 @@ +#include +#include + +#include +#include +#include + +TEST_CASE("dirname: examples", "[igl]") +{ + const std::vector< + std::tuple > + examples = + { + std::make_tuple("/foo" ,"/" ), + std::make_tuple("/foo/" ,"/" ), + std::make_tuple("/foo//" ,"/" ), + std::make_tuple("/foo/./" ,"/foo" ), + std::make_tuple("/foo/bar" ,"/foo" ), + std::make_tuple("/foo/bar." ,"/foo" ), + std::make_tuple("/foo/bar.txt" ,"/foo" ), + std::make_tuple("/foo/bar.txt.zip" ,"/foo" ), + std::make_tuple("/foo/bar.dir/" ,"/foo" ), + std::make_tuple("/foo/bar.dir/file" ,"/foo/bar.dir"), + std::make_tuple("/foo/bar.dir/file.txt","/foo/bar.dir"), + std::make_tuple("." ,"." ), + std::make_tuple("../foo" ,".." ), + std::make_tuple("./foo" ,"." ), + std::make_tuple("../foo/" ,".." ), + std::make_tuple("foo/" ,"." ), + std::make_tuple("foo//" ,"." ), + std::make_tuple("foo/./" ,"foo" ), + std::make_tuple("foo/bar" ,"foo" ), + std::make_tuple("foo/bar." ,"foo" ), + std::make_tuple("foo/bar.txt" ,"foo" ), + std::make_tuple("foo/bar.txt.zip" ,"foo" ), + std::make_tuple("foo/bar.dir/" ,"foo" ), + std::make_tuple("foo/bar.dir/file" ,"foo/bar.dir"), + std::make_tuple("foo/bar.dir/file.txt","foo/bar.dir") + }; + for(const auto & example : examples) + { + std::string d; + d = igl::dirname(std::get<0>(example)); + REQUIRE (d == std::get<1>(example)); + } +} + diff --git a/vendor/libigl/tests/include/igl/doublearea.cpp b/vendor/libigl/tests/include/igl/doublearea.cpp new file mode 100644 index 0000000000000000000000000000000000000000..21547548aee79bce9151f8e39969da7886c3b072 --- /dev/null +++ b/vendor/libigl/tests/include/igl/doublearea.cpp @@ -0,0 +1,34 @@ +#include +#include + +TEST_CASE("doublearea: VF_vs_ABC", "[igl]" "[slow]") +{ + auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path(param), V, F); + + // Check that computing double area with (V,F) is the same as computing + // double area with (V1,V2,V2) + Eigen::VectorXd A1,A2; + igl::doublearea(V,F,A1); + Eigen::MatrixXd A(F.rows(),3); + Eigen::MatrixXd B(F.rows(),3); + Eigen::MatrixXd C(F.rows(),3); + for(int f = 0;f +#include +#include + +TEST_CASE("edge_exists_near: tet", "[igl]") +{ + const Eigen::MatrixXi F = (Eigen::MatrixXi(4,3)<< + 0,1,2, + 0,2,3, + 0,3,1, + 1,3,2).finished(); + Eigen::MatrixXi E,uE; + Eigen::VectorXi EMAP; + std::vector > uE2E; + igl::unique_edge_map(F,E,uE,EMAP,uE2E); + for(int uei = 0;uei +#include + +TEST_CASE("edge_flaps: verify", "[igl]" "[slow]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path(param), V, F); + + Eigen::MatrixXi efE,efEF,efEI; + Eigen::VectorXi efEMAP; + igl::edge_flaps(F,efE,efEMAP,efEF,efEI); + REQUIRE (efEF.rows() == efE.rows()); + REQUIRE (2 == efE.cols()); + REQUIRE (efEF.cols() == efE.cols()); + // for each edge, make sure edge appears in face + for(int e = 0;e= 0) + { + // Either efE(e,[1 2]) = [i,j] appears after vertex c of face f + // Or efE(e,[2 1]) = [j,i] appears after vertex c of face f + CHECK(( + ((efE(e,0) == F(f,(c+1)%3)) && (efE(e,1) == F(f,(c+2)%3))) || + ((efE(e,1) == F(f,(c+1)%3)) && (efE(e,0) == F(f,(c+2)%3))))); + } + } + } + }; + + test_common::run_test_cases(test_common::all_meshes(), test_case); +} diff --git a/vendor/libigl/tests/include/igl/edge_lengths.cpp b/vendor/libigl/tests/include/igl/edge_lengths.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c7d5723a9dd4621b8ba2e0f99b04deeaf6eac615 --- /dev/null +++ b/vendor/libigl/tests/include/igl/edge_lengths.cpp @@ -0,0 +1,85 @@ +#include +#include +#include + +TEST_CASE("edge_lengths: cube", "[igl]") +{ + //The allowed error for this test + const double epsilon = 1e-15; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + //Create scaled versions of the cube + double scale = 1.0; + double huge_scale = 1.0e8; + double tiny_scale = 1.0e-8; + Eigen::MatrixXd V_huge = V * huge_scale; + Eigen::MatrixXd V_tiny = V * tiny_scale; + //Prepare another mesh with triangles along side diagonals of the cube + //These triangles are form a regular tetrahedron of side sqrt(2) + Eigen::MatrixXi F_tet(4,3); + F_tet << 4,6,1, + 6,4,3, + 4,1,3, + 1,6,3; + + //2. Check edge_lengths + double side = 1.0; //lenght of a side + double diag = sqrt(2.0); //lenght of a diagonal + Eigen::MatrixXd L; + igl::edge_lengths(V,F,L); + REQUIRE (L.rows() == F.rows()); + REQUIRE (L.cols() == 3); + //All edges in unit cube measure 1.0 or sqrt(2) in diagonals + for(int f = 0;f 1.1*side) + REQUIRE (L(f,e) == diag); + else + REQUIRE (L(f,e) == side); + //All sides sum exactly side + side + diag + REQUIRE (side + side + diag == L.row(f).sum()); + } + + //Check the cube of huge sides + scale = 1.0e8; + side = scale; //lenght of a side + diag = scale*sqrt(2.0); //lenght of a diagonal + igl::edge_lengths(V_huge,F,L); + REQUIRE (L.rows() == F.rows()); + REQUIRE (L.cols() == 3); + for(int f = 0;f 1.1*side) + REQUIRE (L(f,e) == diag); + else + REQUIRE (L(f,e) == side); + //All sides sum exactly side + side + diag + REQUIRE (side + side + diag == Approx (L.row(f).sum()).margin( epsilon)); + } + + //Check the cube of tiny sides + scale = 1.0e-8; + side = scale; //lenght of a side + diag = scale*sqrt(2.0); //lenght of a diagonal + igl::edge_lengths(V_tiny,F,L); + REQUIRE (L.rows() == F.rows()); + REQUIRE (L.cols() == 3); + for(int f = 0;f 1.1*side) + REQUIRE (L(f,e) == diag); + else + REQUIRE (L(f,e) == side); + //All sides sum exactly side + side + diag + REQUIRE (side + side + diag == L.row(f).sum()); + } + +} diff --git a/vendor/libigl/tests/include/igl/embree/EmbreeIntersector.cpp b/vendor/libigl/tests/include/igl/embree/EmbreeIntersector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee87ace06e4c8fbbc1b1b9958c5a7100a080e675 --- /dev/null +++ b/vendor/libigl/tests/include/igl/embree/EmbreeIntersector.cpp @@ -0,0 +1,99 @@ +#include +#include + +TEST_CASE("EmbreeIntersector: cube", "[igl/embree]") +{ + //The allowed error for this test + const double epsilon = 1e-6; + + Eigen::MatrixXd V; + Eigen::MatrixXi F; + // This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + // Initialize embree + igl::embree::EmbreeIntersector embree; + embree.init(V.cast(),F.cast()); + + // These are not expected to be exact if the hit is on a vertex of edge. + const int expected_id[] = {4,8,5,2,7,0}; + const float expected_u[] = {0.5,0.5,0.5,0.5,0.5,0.5}; + const float expected_v[] = {0.5,0.0,0.0,0.0,0.5,0.0}; + Eigen::MatrixXd hit_P(6,3); + for (int dim=0; dim<6; ++dim) + { + hit_P.row(dim) = + V.row(F(expected_id[dim],0))*(1.f - expected_u[dim] - expected_v[dim])+ + V.row(F(expected_id[dim],1))*expected_u[dim] + + V.row(F(expected_id[dim],2))*expected_v[dim]; + } + const auto test_hit = [&](const bool hitP, const igl::Hit& hit, const int dim) + { + CHECK(hitP); + if(hitP) + { + const Eigen::RowVectorXd hit_p = + V.row(F(hit.id,0))*(1.f - hit.u - hit.v) + + V.row(F(hit.id,1))*hit.u + + V.row(F(hit.id,2))*hit.v; + // hits will be along diagonal edge so expected_id may be different + test_common::assert_near(hit_P.row(dim),hit_p,epsilon); + } + }; + + + // Shoot ray from inside out + for (int dim=0; dim<6; ++dim) + { + Eigen::Vector3f pos(0,0,0); + Eigen::Vector3f dir(0,0,0); + // test each dimension, pos and neg + dir[dim/2] = dim%2 ? -1 : 1; + igl::Hit hit; + bool hitP = embree.intersectRay(pos, dir, hit); + test_hit(hitP,hit,dim); + } + + // Shoot ray from outside in + for (int dim=0; dim<6; ++dim) + { + Eigen::Vector3f dir(0,0,0); + // test each dimension, pos and neg + dir[dim/2] = dim%2 ? 1 : -1; + + Eigen::Vector3f pos = -dir; + + igl::Hit hit; + bool hitP = embree.intersectRay(pos, dir, hit); + test_hit(hitP,hit,dim); + } + + // Rays that miss + for (int dim=0; dim<6; ++dim) + { + Eigen::Vector3f pos(0,0,0); + Eigen::Vector3f dir(0,0,0); + // test each dimension, pos and neg + dir[dim/2] = dim%2 ? -1 : 1; + pos[(dim/2+1)%3] = dir[dim/2]; + + igl::Hit hit; + bool hitP = embree.intersectRay(pos, dir, hit); + CHECK_FALSE(hitP); + } + + // intersect beam + { + Eigen::Vector3f pos(1.75,0.25,0); + Eigen::Vector3f dir(-1,0,0); + + igl::Hit hit; + bool hitP = embree.intersectBeam(pos, dir, hit); + CHECK(hitP); + REQUIRE(hit.t == Approx(1.25).margin(epsilon)); + REQUIRE(hit.id == 4); + REQUIRE(hit.u == Approx(0.5).margin(epsilon)); + REQUIRE(hit.v == Approx(0.25).margin(epsilon)); + } +} + diff --git a/vendor/libigl/tests/include/igl/facet_components.cpp b/vendor/libigl/tests/include/igl/facet_components.cpp new file mode 100644 index 0000000000000000000000000000000000000000..30b1a6e7c86e02c58583e2877ad2341750b6ef86 --- /dev/null +++ b/vendor/libigl/tests/include/igl/facet_components.cpp @@ -0,0 +1,36 @@ +#include +#include + +TEST_CASE("facet_components: two_triangles", "[igl]") +{ + const Eigen::MatrixXi F1 = + (Eigen::MatrixXi(2,3)<< + 0,1,3, + 0,3,2).finished(); + Eigen::VectorXi C1; + igl::facet_components(F1,C1); + REQUIRE(C1(0) == 0); + REQUIRE(C1(0) == C1(1)); + + const Eigen::MatrixXi F2 = + (Eigen::MatrixXi(2,3)<< + 0,1,2, + 3,4,5).finished(); + Eigen::VectorXi C2; + igl::facet_components(F2,C2); + REQUIRE(C2(0) != C2(1)); + REQUIRE(C2.minCoeff() == 0); + REQUIRE(C2.maxCoeff() == 1); +} + +TEST_CASE("facet_components: truck", "[igl]") +{ + Eigen::MatrixXi F; + { + Eigen::MatrixXd V; + igl::read_triangle_mesh(test_common::data_path("truck.obj"), V, F); + } + Eigen::VectorXi C; + igl::facet_components(F,C); + REQUIRE(C.maxCoeff()+1 == 59); +} diff --git a/vendor/libigl/tests/include/igl/fast_winding_number.cpp b/vendor/libigl/tests/include/igl/fast_winding_number.cpp new file mode 100644 index 0000000000000000000000000000000000000000..68cacd4d78b962c017dc8cba6548543a5795c0da --- /dev/null +++ b/vendor/libigl/tests/include/igl/fast_winding_number.cpp @@ -0,0 +1,107 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include +#include +#include +#include +#include +#include +#include + +TEST_CASE("fast_winding_number: one_point_cloud", "[igl]") +{ + Eigen::MatrixXd P(1,3); + P<<0.1,0.2,0.3; + // Unit normal + Eigen::MatrixXd N(1,3); + N<<4,5,6; + N /= N.row(0).norm(); + Eigen::VectorXd A(1,1); + A(0) = 0.7; + + std::vector > O_PI; + Eigen::MatrixXi O_CH; + Eigen::MatrixXd O_CN; + Eigen::VectorXd O_W; + igl::octree(P,O_PI,O_CH,O_CN,O_W); + + Eigen::MatrixXd O_CM; + Eigen::VectorXd O_R; + Eigen::MatrixXd O_EC; + igl::fast_winding_number(P,N,A,O_PI,O_CH,2,O_CM,O_R,O_EC); + Eigen::MatrixXd Q(4,3); + Q<< + 0, 0, 0, + 4,-3, 2, + -1, 1, 3, + 0, 5,-2; + Eigen::VectorXd WiP; + igl::fast_winding_number(P,N,A,O_PI,O_CH,O_CM,O_R,O_EC,Q,2,WiP); + Eigen::VectorXd WiP_cached(4); + WiP_cached<< + 0.38779369004261133, + -0.00041235296362485, + -0.00362978253577090, + -0.00041235296362485; + test_common::assert_near(WiP,WiP_cached,1e-15); +} + +TEST_CASE("fast_winding_number: meshes", "[igl]" "[slow]") +{ + const auto test_case = [](const std::string ¶m) + { + INFO(param); + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path(param),V,F); + // vertex centroid will be our query + Eigen::MatrixXd Q = V.array().colwise().mean(); + + Eigen::VectorXd Wexact(1,1); + Wexact(0,0) = igl::winding_number(V,F,Eigen::RowVector3d(Q)); + + // SOUP + { + INFO("soup"); + igl::FastWindingNumberBVH fwn_bvh; + igl::fast_winding_number(V,F,2,fwn_bvh); + Eigen::VectorXd Wfwn_soup; + igl::fast_winding_number(fwn_bvh,2,Q,Wfwn_soup); + test_common::assert_near(Wfwn_soup,Wexact,1e-2); + } + + // CLOUD + // triangle barycenters, normals and areas will be our point cloud + { + INFO("cloud"); + Eigen::MatrixXd BC,N; + Eigen::VectorXd A; + igl::barycenter(V,F,BC); + igl::per_face_normals(V,F,N); + igl::doublearea(V,F,A); + A *= 0.5; + Eigen::VectorXd Wfwn_cloud; + std::vector > O_PI; + Eigen::MatrixXi O_CH; + Eigen::MatrixXd O_CN; + Eigen::VectorXd O_W; + igl::octree(BC,O_PI,O_CH,O_CN,O_W); + Eigen::MatrixXd O_CM; + Eigen::VectorXd O_R; + Eigen::MatrixXd O_EC; + igl::fast_winding_number(BC,N,A,O_PI,O_CH,2,O_CM,O_R,O_EC); + igl::fast_winding_number(BC,N,A,O_PI,O_CH,O_CM,O_R,O_EC,Q,2,Wfwn_cloud); + test_common::assert_near(Wfwn_cloud,Wexact,1e-2); + } + }; + // FWN clouds using barycenters won't work well for very coarse models like the cube + test_common::run_test_cases( + {"bunny.off", "elephant.off", "hemisphere.obj"}, + test_case); +} diff --git a/vendor/libigl/tests/include/igl/fit_cubic_bezier.cpp b/vendor/libigl/tests/include/igl/fit_cubic_bezier.cpp new file mode 100644 index 0000000000000000000000000000000000000000..77fcd386fa5db6a9c1dbae087b665fa70d78d5ff --- /dev/null +++ b/vendor/libigl/tests/include/igl/fit_cubic_bezier.cpp @@ -0,0 +1,38 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include +#include +#include + +TEST_CASE("fit_cubic_bezier: hemicircle", "[igl]") +{ + // Create a hemicircle + Eigen::MatrixXd d(101,2); + for(int i=0;i cubics; + igl::fit_cubic_bezier(d,error,cubics); + REQUIRE(cubics.size()>1); + REQUIRE(cubics.size()<10); + // Generate a dense sampling + const Eigen::VectorXd T = Eigen::VectorXd::LinSpaced(1000,0,1); + Eigen::MatrixXd X; + igl::bezier(cubics,T,X); + for(int j=0;j +#include +#include +#include +#include +#include +#include + +TEST_CASE("grad: laplace_grid", "[igl]") +{ + Eigen::MatrixXd V2; + Eigen::MatrixXi F; + igl::triangulated_grid(3,3,V2,F); + Eigen::MatrixXd V = Eigen::MatrixXd::Zero(V2.rows(),3); + V.topLeftCorner(V2.rows(),2) = V2; + V.col(2) = V.col(1).array() * V.col(0).array() + V.col(1).array(); + Eigen::SparseMatrix L; + igl::cotmatrix(V,F,L); + Eigen::SparseMatrix G; + igl::grad(V,F,G); + Eigen::VectorXd dblA; + igl::doublearea(V,F,dblA); + Eigen::SparseMatrix GTAG = + G.transpose() * (dblA.colwise().replicate(3).asDiagonal()) * G; + test_common::assert_near( + Eigen::MatrixXd(L),Eigen::MatrixXd(-0.5*GTAG),igl::EPS()); +} + diff --git a/vendor/libigl/tests/include/igl/grad_intrinsic.cpp b/vendor/libigl/tests/include/igl/grad_intrinsic.cpp new file mode 100644 index 0000000000000000000000000000000000000000..308ddda8fefbd5ee0ee028509d6011dfb19d9c57 --- /dev/null +++ b/vendor/libigl/tests/include/igl/grad_intrinsic.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include +#include + +TEST_CASE("grad_intrinsic: laplace_grid", "[igl]") +{ + Eigen::MatrixXd V2; + Eigen::MatrixXi F; + igl::triangulated_grid(3,3,V2,F); + Eigen::MatrixXd V = Eigen::MatrixXd::Zero(V2.rows(),3); + V.topLeftCorner(V2.rows(),2) = V2; + V.col(2) = V.col(1).array() * V.col(0).array() + V.col(1).array(); + Eigen::SparseMatrix L; + igl::cotmatrix(V,F,L); + Eigen::MatrixXd l; + igl::edge_lengths(V,F,l); + Eigen::SparseMatrix G; + igl::grad_intrinsic(l,F,G); + Eigen::VectorXd dblA; + igl::doublearea(l,0,dblA); + Eigen::SparseMatrix GTAG = + G.transpose() * (dblA.colwise().replicate(2).asDiagonal()) * G; + test_common::assert_near( + Eigen::MatrixXd(L),Eigen::MatrixXd(-0.5*GTAG),igl::EPS()); +} diff --git a/vendor/libigl/tests/include/igl/grid.cpp b/vendor/libigl/tests/include/igl/grid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0d7ca378c67309a451bbf314bc9c59494eceee80 --- /dev/null +++ b/vendor/libigl/tests/include/igl/grid.cpp @@ -0,0 +1,59 @@ +#include +#include +#include + +TEST_CASE("grid: 3d", "[igl]") +{ + Eigen::Vector3i res(3,3,3); + Eigen::MatrixXd GV; + igl::grid(res,GV); + const Eigen::MatrixXd GVgt = + (Eigen::MatrixXd(27,3)<< + 0, 0, 0, + 0.5, 0, 0, + 1, 0, 0, + 0,0.5, 0, + 0.5,0.5, 0, + 1,0.5, 0, + 0, 1, 0, + 0.5, 1, 0, + 1, 1, 0, + 0, 0,0.5, + 0.5, 0,0.5, + 1, 0,0.5, + 0,0.5,0.5, + 0.5,0.5,0.5, + 1,0.5,0.5, + 0, 1,0.5, + 0.5, 1,0.5, + 1, 1,0.5, + 0, 0, 1, + 0.5, 0, 1, + 1, 0, 1, + 0,0.5, 1, + 0.5,0.5, 1, + 1,0.5, 1, + 0, 1, 1, + 0.5, 1, 1, + 1, 1, 1).finished(); + test_common::assert_eq(GV,GVgt); +} + +TEST_CASE("grid: 2d", "[igl]") +{ + Eigen::Vector2i res(3,3); + Eigen::MatrixXd GV; + igl::grid(res,GV); + const Eigen::MatrixXd GVgt = + (Eigen::MatrixXd(9,2)<< + 0, 0, + 0.5, 0, + 1, 0, + 0,0.5, + 0.5,0.5, + 1,0.5, + 0, 1, + 0.5, 1, + 1, 1).finished(); + test_common::assert_eq(GV,GVgt); +} diff --git a/vendor/libigl/tests/include/igl/guess_extension.cpp b/vendor/libigl/tests/include/igl/guess_extension.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e0b8c72a3bc492389e4097c6779edd1ac5d1d13f --- /dev/null +++ b/vendor/libigl/tests/include/igl/guess_extension.cpp @@ -0,0 +1,26 @@ + +#include +#include +#include +#include + + +TEST_CASE("guess_extension: all_meshes", "[igl]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + std::string path(test_common::data_path(param)); + // Load example mesh: GetParam() will be name of mesh file + std::string d,b,e,f; + igl::pathinfo(path,d,b,e,f); + // Convert extension to lower case + std::transform(e.begin(), e.end(), e.begin(), ::tolower); + FILE * fp = fopen(path.c_str(),"r"); + std::string guess = igl::guess_extension(fp); + REQUIRE (e == guess); + }; + + test_common::run_test_cases(test_common::all_meshes(), test_case); +} diff --git a/vendor/libigl/tests/include/igl/heat_geodesics.cpp b/vendor/libigl/tests/include/igl/heat_geodesics.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f2efd3e8c9abba23f3668a4a1c7cb8860a88fd4 --- /dev/null +++ b/vendor/libigl/tests/include/igl/heat_geodesics.cpp @@ -0,0 +1,27 @@ +#include +#include +#include +#include + +TEST_CASE("heat_geodesic: upsampled cube", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + igl::upsample(V,F,3); + + int vid = 0; + igl::HeatGeodesicsData data; + igl::heat_geodesics_precompute(V,F,data); + Eigen::VectorXd dist; + igl::heat_geodesics_solve(data, (Eigen::VectorXi(1,1)< +#include +#include +#include +#include + +TEST_CASE("intrinsic_delaunay_cotmatrix: skewed_grid", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + const int s = 7; + igl::triangulated_grid(s,s,V,F); + // Skew against diagonal direction + V.col(0) -= 1.1*V.col(1); + Eigen::SparseMatrix L; + Eigen::MatrixXi F_intrinsic; + Eigen::MatrixXd l_intrinsic; + igl::intrinsic_delaunay_cotmatrix(V,F,L,l_intrinsic,F_intrinsic); + Eigen::VectorXi LI,LJ; + Eigen::VectorXd LV; + igl::find(L,LI,LJ,LV); + const auto is_boundary_edge = [](const int i, const int j, const int s)->bool + { + const auto is_boundary_vertex = [](const int i, const int s)->bool + { + return (i=s*s-s) || (i%s == 0) || (i%s == s-1); + }; + return is_boundary_vertex(i,s) && is_boundary_vertex(j,s); + }; + // Off diagonals should be all non-positive + for(int k = 0;k() < LV(k)); + } + } +} + +TEST_CASE("intrinsic_delaunay_cotmatrix: manifold_meshes", "[igl]" "[slow]") +{ + auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path(param), V, F); + Eigen::SparseMatrix L; + Eigen::MatrixXi F_intrinsic; + Eigen::MatrixXd l_intrinsic; + igl::intrinsic_delaunay_cotmatrix(V,F,L,l_intrinsic,F_intrinsic); + Eigen::VectorXi LI,LJ; + Eigen::VectorXd LV; + igl::find(L,LI,LJ,LV); + + const std::vector is_boundary_vertex = igl::is_border_vertex(F); + // Off diagonals should be all non-positive + for(int k = 0;k() < LV(k)); + } + } + }; + + test_common::run_test_cases(test_common::manifold_meshes(), test_case); +} + diff --git a/vendor/libigl/tests/include/igl/intrinsic_delaunay_triangulation.cpp b/vendor/libigl/tests/include/igl/intrinsic_delaunay_triangulation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cf27a4672f6cfae36d0cfac807001f2abb0230b9 --- /dev/null +++ b/vendor/libigl/tests/include/igl/intrinsic_delaunay_triangulation.cpp @@ -0,0 +1,123 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +TEST_CASE("intrinsic_delaunay_triangulation: two_triangles", "[igl]") +{ + const Eigen::MatrixXd V = + (Eigen::MatrixXd(4,2)<< + 0,12, + 1,0, + 1,20, + 2,9).finished(); + const Eigen::MatrixXi FN = + (Eigen::MatrixXi(2,3)<< + 0,1,2, + 2,1,3).finished(); + Eigen::MatrixXd lN; + igl::edge_lengths(V,FN,lN); + Eigen::MatrixXd l; + Eigen::MatrixXi F; + igl::intrinsic_delaunay_triangulation( lN, FN, l, F); + Eigen::MatrixXd lext; + igl::edge_lengths(V,F,lext); + test_common::assert_near(l,lext,1e-10); +} + +TEST_CASE("intrinsic_delaunay_triangulation: skewed_grid", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F_in; + igl::triangulated_grid(4,4,V,F_in); + // Skew against diagonal direction + V.col(0) -= 1.5*V.col(1); + Eigen::MatrixXd l_in; + igl::edge_lengths(V,F_in,l_in); + Eigen::MatrixXd l; + Eigen::MatrixXi F; + igl::intrinsic_delaunay_triangulation( l_in, F_in, l, F); + Eigen::MatrixXd lext; + igl::edge_lengths(V,F,lext); + test_common::assert_near(l,lext,1e-10); + Eigen::Matrix D; + igl::is_delaunay(V,F,D); + const Eigen::Matrix Dtrue = + Eigen::Matrix::Constant(F.rows(),F.cols(),true); + test_common::assert_eq(D,Dtrue); +} + +TEST_CASE("intrinsic_delaunay_triangulation: peaks", "[igl]") +{ + Eigen::MatrixXd V2; + Eigen::MatrixXi F_in; + igl::triangulated_grid(20,20,V2,F_in); + Eigen::MatrixXd V(V2.rows(),3); + for(int v=0;v > uE2E; + igl::intrinsic_delaunay_triangulation(l_in,F_in,l,F,E,uE,EMAP,uE2E); + Eigen::Matrix D; + const Eigen::Matrix D_gt = + Eigen::Matrix::Constant(F.rows(),F.cols(),true); + igl::is_intrinsic_delaunay(l,F,uE2E,D); + test_common::assert_eq(D,D_gt); +} + +TEST_CASE("intrinsic_delaunay_triangulation: tet", "[igl]") +{ + const Eigen::MatrixXd V = (Eigen::MatrixXd(4,3)<< + 10, 4,7, + 5, 9,0, + 8, 8,8, + 1,10,9).finished(); + const Eigen::MatrixXi F_in = (Eigen::MatrixXi(4,3)<< + 0,1,2, + 0,2,3, + 0,3,1, + 1,3,2).finished(); + const Eigen::Matrix D_before = + (Eigen::Matrix(4,3)<< + 1,1,1, + 1,0,1, + 1,1,0, + 1,1,1).finished(); + Eigen::Matrix D; + Eigen::MatrixXd l_in; + igl::edge_lengths(V,F_in,l_in); + igl::is_intrinsic_delaunay(l_in,F_in,D); + test_common::assert_eq(D,D_before); + Eigen::MatrixXd l; + Eigen::MatrixXi F; + Eigen::MatrixXi E,uE; + Eigen::VectorXi EMAP; + std::vector > uE2E; + igl::intrinsic_delaunay_triangulation(l_in,F_in,l,F,E,uE,EMAP,uE2E); + + const Eigen::Matrix D_after = + Eigen::Matrix::Constant(F.rows(),F.cols(),true); + igl::is_intrinsic_delaunay(l,F,uE2E,D); + test_common::assert_eq(D,D_after); +} diff --git a/vendor/libigl/tests/include/igl/is_delaunay.cpp b/vendor/libigl/tests/include/igl/is_delaunay.cpp new file mode 100644 index 0000000000000000000000000000000000000000..091688667aa1f348872191008269f12b6ec54e0f --- /dev/null +++ b/vendor/libigl/tests/include/igl/is_delaunay.cpp @@ -0,0 +1,32 @@ +#include +#include + +TEST_CASE("is_delaunay: two_triangles", "[igl]") +{ + const Eigen::MatrixXd V = + (Eigen::MatrixXd(4,2)<< + 0,10, + 1,0, + 1,20, + 2,10).finished(); + const Eigen::MatrixXi FD = + (Eigen::MatrixXi(2,3)<< + 0,1,3, + 0,3,2).finished(); + Eigen::Matrix DD,DN; + igl::is_delaunay(V,FD,DD); + for(int f=0;f +#include + +TEST_CASE("is_edge_manifold: positive", "[igl]" "[slow]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path(param), V, F); + REQUIRE ( igl::is_edge_manifold(F) ); + }; + + test_common::run_test_cases(test_common::manifold_meshes(), test_case); +} + +TEST_CASE("is_edge_manifold: negative", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + // Known non-manifold mesh + igl::read_triangle_mesh(test_common::data_path("truck.obj"), V, F); + REQUIRE (! igl::is_edge_manifold(F) ); +} diff --git a/vendor/libigl/tests/include/igl/is_intrinsic_delaunay.cpp b/vendor/libigl/tests/include/igl/is_intrinsic_delaunay.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2111042057ac1d0471b691b817f1df0d9e5c14d9 --- /dev/null +++ b/vendor/libigl/tests/include/igl/is_intrinsic_delaunay.cpp @@ -0,0 +1,37 @@ +#include +#include +#include + +TEST_CASE("is_intrinsic_delaunay: two_triangles", "[igl]") +{ + const Eigen::MatrixXd V = + (Eigen::MatrixXd(4,2)<< + 0,10, + 1,0, + 1,20, + 2,10).finished(); + const Eigen::MatrixXi FD = + (Eigen::MatrixXi(2,3)<< + 0,1,3, + 0,3,2).finished(); + Eigen::Matrix DD,DN; + Eigen::MatrixXd lD; + igl::edge_lengths(V,FD,lD); + igl::is_intrinsic_delaunay(lD,FD,DD); + for(int f=0;f +#include + + +TEST_CASE("is_irregular_vertex: simple", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + // Known "bad" mesh (many boundaries + irregular vertices, non-manifold) + igl::read_triangle_mesh(test_common::data_path("truck.obj"), V, F); + std::vector vec = igl::is_irregular_vertex(V,F); + // some vertices are irregular thus the sum over all vertices should evaluate to true + REQUIRE(std::any_of(vec.begin(),vec.end(), [](bool v) { return v; })); + +} \ No newline at end of file diff --git a/vendor/libigl/tests/include/igl/is_symmetric.cpp b/vendor/libigl/tests/include/igl/is_symmetric.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9bbe2ea2cc34673aa00bc97016dbc861bf044bb2 --- /dev/null +++ b/vendor/libigl/tests/include/igl/is_symmetric.cpp @@ -0,0 +1,35 @@ + +#include +#include + +TEST_CASE("is_symmetric: sparse", "[igl]") +{ + { + Eigen::MatrixXd M(3,3); + M<<1,2,3,4,5,6,7,8,9; + Eigen::SparseMatrix S = M.sparseView(); + REQUIRE (!igl::is_symmetric(S)); + } + { + Eigen::MatrixXd M(3,3); + M<<1,2,3,2,4,5,3,5,6; + Eigen::SparseMatrix S = M.sparseView(); + REQUIRE (!igl::is_symmetric(S)); + } +} + +TEST_CASE("is_symmetric: dense", "[igl]") +{ + { + Eigen::MatrixXd M(3,3); + M<<1,2,3,4,5,6,7,8,9; + REQUIRE (!igl::is_symmetric(M)); + } + { + Eigen::MatrixXd M(3,3); + M<<1,2,3, + 2,4,5, + 3,5,6; + REQUIRE (!igl::is_symmetric(M)); + } +} diff --git a/vendor/libigl/tests/include/igl/ismember.cpp b/vendor/libigl/tests/include/igl/ismember.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cb3a031169a0a8578196011b749f2e008addc425 --- /dev/null +++ b/vendor/libigl/tests/include/igl/ismember.cpp @@ -0,0 +1,44 @@ +#include +#include +#include + +TEST_CASE("ismember: simple", "[igl]") +{ + Eigen::MatrixXi A(3,4); + A<<11,12,13,14,21,22,23,24,31,32,33,34; + Eigen::MatrixXi B(2,3); + B<<11,13,11,21,22,34; + + Eigen::Matrix IA; + Eigen::MatrixXi LOCB; + igl::ismember(A,B,IA,LOCB); + Eigen::Map vB = + Eigen::Map(B.data(),B.rows()*B.cols()); + for(int i = 0;i LOCB(i,j)); + REQUIRE (A(i,j) == vB(LOCB(i,j))); + REQUIRE (bi == LOCB(i,j)); + }else + { + REQUIRE (-1 == LOCB(i,j)); + REQUIRE (B.size() == bi); + } + } + } +} + diff --git a/vendor/libigl/tests/include/igl/iterative_closest_point.cpp b/vendor/libigl/tests/include/igl/iterative_closest_point.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b128062748a1e8a7d6efe03a30c6ab3b92284770 --- /dev/null +++ b/vendor/libigl/tests/include/igl/iterative_closest_point.cpp @@ -0,0 +1,32 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include + + +TEST_CASE("iterative_closest_point: identity","[igl]" "[slow]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd VX,VY; + Eigen::MatrixXi FX,FY; + // Load example mesh: GetParam() will be name of mesh file + igl::read_triangle_mesh(test_common::data_path(param), VY, FY); + VX = VY; + FX = FY; + // Single iteration should find a identity + srand(0); + Eigen::Matrix3d R; + Eigen::RowVector3d t; + igl::iterative_closest_point(VX,FX,VY,FY,1000,1,R,t); + test_common::assert_near(R,Eigen::Matrix3d::Identity(),1e-12); + test_common::assert_near(t,Eigen::RowVector3d::Zero(),1e-12); + }; + + test_common::run_test_cases(test_common::all_meshes(), test_case); +} diff --git a/vendor/libigl/tests/include/igl/knn.cpp b/vendor/libigl/tests/include/igl/knn.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0120025838f12ea5db68f2336d771d00f8ae156f --- /dev/null +++ b/vendor/libigl/tests/include/igl/knn.cpp @@ -0,0 +1,78 @@ +#include +#include +#include +#include + + + +TEST_CASE("knn", "[igl]") +{ + + auto run_knn = [](int k, const Eigen::MatrixXd & P, const Eigen::MatrixXd& V, typename Eigen::MatrixXi& I) { + std::vector > point_indices; + Eigen::Matrix CH; + Eigen::Matrix CN; + Eigen::Matrix W; + Eigen::Matrix A; + + igl::octree(V,point_indices,CH,CN,W); + + igl::knn(P,V,k,point_indices,CH,CN,W,I); + }; + Eigen::Matrix V; + Eigen::Matrix P; + Eigen::MatrixXi I; + Eigen::MatrixXi answer; + { + //Test some simple points off a unit cube + V.resize(8,3); + V << + 0,0,1, + 0,1,0, + 0,1,1, + 0,0,0, + 1,0,0, + 1,1,0, + 1,1,1, + 1,0,1; + + P.resize(3,3); + + P << + 0 ,0 ,0.6, + 0.3 ,0.1 ,0.2, + .7,.6,0; + + + answer.resize(3,3); + answer << 0,3,2, + 3,4,0, + 5,4,1; + run_knn(3,P,V,I); + REQUIRE (I == answer); + + } + { + //Test whether the kdtree works when passed things of different size + + V.resize(2,3); + V << 0,0,0, + 1,1,1; + + P << 0,0,0, + -1,-1,-1, + 2,2,2; + + run_knn(10,P,V,I); + answer.resize(3,2); + answer << + 0,1, + 0,1, + 1,0; + + REQUIRE (I == answer); + } + + + +} diff --git a/vendor/libigl/tests/include/igl/linprog.cpp b/vendor/libigl/tests/include/igl/linprog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..030e12815ba75668ae70f5fef8f57e86c8ec2344 --- /dev/null +++ b/vendor/libigl/tests/include/igl/linprog.cpp @@ -0,0 +1,41 @@ +#include +#include + +TEST_CASE("linprog: 2D-inequality", "[igl]" ) +{ + Eigen::VectorXd f(2); f << -2, -1; + Eigen::VectorXd b(3); b << 8, 14, 4; + Eigen::MatrixXd A(3, 2); A << 2, -1, 1, 2, -1, 1; + Eigen::MatrixXd B = Eigen::MatrixXd(0,2); + Eigen::VectorXd c = Eigen::VectorXd(0); + Eigen::VectorXd x; + igl::linprog(f, A, b, B, c, x); + Eigen::VectorXd x_correct(2); x_correct<<6,4; + test_common::assert_near( x, x_correct, 1e-10); +} + +TEST_CASE("linprog: 2D-inequality+2-equality", "[igl]" ) +{ + Eigen::VectorXd f(2); f << -2, -1; + Eigen::VectorXd b(3); b << 8, 14, 4; + Eigen::MatrixXd A(3, 2); A << 2, -1, 1, 2, -1, 1; + Eigen::MatrixXd B = Eigen::MatrixXd(2,2);B<<1,0,0,1; + Eigen::VectorXd c = Eigen::VectorXd(2);c<<4,4; + Eigen::VectorXd x; + igl::linprog(f, A, b, B, c, x); + Eigen::VectorXd x_correct(2); x_correct<<4,4; + test_common::assert_near( x, x_correct, 1e-10); +} + +TEST_CASE("linprog: 2D-inequality+1-equality", "[igl]" ) +{ + Eigen::VectorXd f(2); f << -2, -1; + Eigen::VectorXd b(3); b << 8, 14, 4; + Eigen::MatrixXd A(3, 2); A << 2, -1, 1, 2, -1, 1; + Eigen::MatrixXd B = Eigen::MatrixXd(1,2);B<<1,0; + Eigen::VectorXd c = Eigen::VectorXd(1);c<<4; + Eigen::VectorXd x; + igl::linprog(f, A, b, B, c, x); + Eigen::VectorXd x_correct(2); x_correct<<4,5; + test_common::assert_near( x, x_correct, 1e-10); +} diff --git a/vendor/libigl/tests/include/igl/list_to_matrix.cpp b/vendor/libigl/tests/include/igl/list_to_matrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ae984dc89d68a61b612ec7ef26d059fe8bdc72dd --- /dev/null +++ b/vendor/libigl/tests/include/igl/list_to_matrix.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include + +namespace list_to_matrix +{ + typedef std::tuple NM; + // inline std::string NM_test_name( + // const ::testing::TestParamInfo& info) + // { + // return STR( + // std::get<0>(info.param)<<"x"<< + // std::get<1>(info.param)<<"_"); + // }; +} + +TEST_CASE("ListToMatrixTest: matrix", "[igl]") +{ + const auto test_case = [](const list_to_matrix::NM ¶m) + { + const int n = std::get<0>(param); + const int m = std::get<1>(param); + std::vector > vX(n,std::vector(m)); + for(int i = 0;i params = { + list_to_matrix::NM{100,4}, + list_to_matrix::NM{4,100}, + list_to_matrix::NM{100,1}, + list_to_matrix::NM{1,100}, + }; + + test_common::run_test_cases(params, test_case); +} diff --git a/vendor/libigl/tests/include/igl/lscm.cpp b/vendor/libigl/tests/include/igl/lscm.cpp new file mode 100644 index 0000000000000000000000000000000000000000..61b6c1b8cd960ff60c9e432ec1f2c2c3669e520f --- /dev/null +++ b/vendor/libigl/tests/include/igl/lscm.cpp @@ -0,0 +1,85 @@ +#include +#include +#include +#include +#include +#include +#include + +double compute_lscm_energy( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::VectorXd& W_flat) +{ + const int nV = V.rows(); + const int nF = F.rows(); + + assert(V.cols() == 3); + assert(F.cols() == 3); + + // Compute gradient + Eigen::SparseMatrix G; + igl::grad(V, F, G); + + Eigen::VectorXd nablaU_flat = G * W_flat.head(nV); + Eigen::VectorXd nablaV_flat = G * W_flat.tail(nV); + + Eigen::MatrixXd nablaU(nF, 3); + Eigen::MatrixXd nablaV(nF, 3); + nablaU << nablaU_flat.segment(0, nF), nablaU_flat.segment(nF, nF), nablaU_flat.segment(2 * nF, nF); + nablaV << nablaV_flat.segment(0, nF), nablaV_flat.segment(nF, nF), nablaV_flat.segment(2 * nF, nF); + + // Compute face normal + Eigen::MatrixXd N; + igl::per_face_normals(V, F, N); + + // Compute area + Eigen::VectorXd dblA; + igl::doublearea(V, F, dblA); + + // Sum up + double sum = 0; + + for (int i = 0; i < nF; ++i) { + Eigen::Vector3d N_i = N.row(i); + Eigen::Vector3d nablaU_i = nablaU.row(i); + Eigen::Vector3d nablaV_i = nablaV.row(i); + + // Rotate nablaU_i about N_i by 90 degrees ccw + nablaU_i = N_i.cross(nablaU_i); + + sum += 0.5 * dblA[i] * (nablaU_i - nablaV_i).squaredNorm(); + } + + return 0.5 * sum; +} + +TEST_CASE("lscm: lscm_energy_check", "[igl]") +{ + // Load a mesh in OFF format + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("camelhead.off"), V, F); + + // Fix two points on the boundary + Eigen::VectorXi bnd, b(2, 1); + igl::boundary_loop(F, bnd); + b(0) = bnd(0); + b(1) = bnd(bnd.size() / 2); + Eigen::MatrixXd bc(2, 2); + bc << 0, 0, 1, 0; + + // LSCM parametrization + Eigen::MatrixXd V_uv; + Eigen::SparseMatrix Q; + igl::lscm(V, F, b, bc, V_uv, Q); + + Eigen::VectorXd W_flat(2 * V.rows()); + W_flat << V_uv.col(0), V_uv.col(1); + + // Consistency check + double e1 = compute_lscm_energy(V, F, W_flat); + double e2 = 0.5 * W_flat.transpose() * Q * W_flat; + + REQUIRE(std::abs(e1 - e2) < igl::EPS()); +} diff --git a/vendor/libigl/tests/include/igl/min_quad_with_fixed.cpp b/vendor/libigl/tests/include/igl/min_quad_with_fixed.cpp new file mode 100644 index 0000000000000000000000000000000000000000..512d0865eec7140656ba05732e49770148a0646d --- /dev/null +++ b/vendor/libigl/tests/include/igl/min_quad_with_fixed.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +TEST_CASE("min_quad_with_fixed: dense", "[igl]" ) +{ + const Eigen::Matrix H = (Eigen::Matrix(3,3)<<62,43,76,43,69,62,76,62,101).finished(); + const Eigen::Matrix f = (Eigen::Matrix(3,1)<<9,8,5).finished(); + const Eigen::Matrix A = (Eigen::Matrix(1,3)<<1,1,1).finished(); + const Eigen::Matrix b = (Eigen::Matrix(1,1)<<2).finished(); + const Eigen::Array k = (Eigen::Array()< bc = (Eigen::Matrix(3,1)<<1,0,0).finished(); + // Windows needs template args spelled out + const Eigen::Matrix x = igl::min_quad_with_fixed(H,f,k,bc,A,b); + REQUIRE(abs(x(0)- 1.0)()); + REQUIRE(abs(x(1)- 1.5)()); + REQUIRE(abs(x(2)- -.5)()); +} diff --git a/vendor/libigl/tests/include/igl/mosek/bbw.cpp b/vendor/libigl/tests/include/igl/mosek/bbw.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f30665527c556fd92157b2444abf56c166c4fc90 --- /dev/null +++ b/vendor/libigl/tests/include/igl/mosek/bbw.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include +#include + +TEST_CASE("mosek_bbw: decimated_knight", "[igl/copyleft/mosek]") +{ + Eigen::MatrixXd V,C; + Eigen::MatrixXi T,F,E; + igl::readMESH(test_common::data_path("decimated-knight.mesh"),V,T,F); + igl::readTGF(test_common::data_path("decimated-knight.tgf"),C,E); + Eigen::MatrixXd W_groundtruth, Was, Wmo; + igl::readDMAT( + test_common::data_path("decimated-knight-matlab-active-set.dmat"),W_groundtruth); + Eigen::VectorXi b; + Eigen::MatrixXd bc; + igl::boundary_conditions(V,T,C,Eigen::VectorXi(),E,Eigen::MatrixXi(),b,bc); + igl::BBWData params; + igl::mosek::MosekData mosek_params; + igl::mosek::bbw(V,T,b,bc,params,mosek_params,Wmo); + igl::writeDMAT("decimated-knight-mo.dmat",Wmo); + // Mosek is less accurate + REQUIRE (1e-3 > (Wmo-W_groundtruth).array().abs().maxCoeff()); +} diff --git a/vendor/libigl/tests/include/igl/orient_halfedges.cpp b/vendor/libigl/tests/include/igl/orient_halfedges.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2c2ebecca38e2e11ebb97a02099a281dcc43fcf0 --- /dev/null +++ b/vendor/libigl/tests/include/igl/orient_halfedges.cpp @@ -0,0 +1,102 @@ +#include +#include +#include +#include +#include +#include +#include + +#include + + +TEST_CASE("orient_halfedges: sanity checks", "[igl]") +{ + const auto meshes = test_common::manifold_meshes(); + + for(const auto& mesh : meshes) { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path(mesh), V, F); + Eigen::MatrixXi I; + igl::remove_unreferenced(Eigen::MatrixXd(V), Eigen::MatrixXi(F), V, F, + I); + + Eigen::MatrixXi TT, TTi; + igl::triangle_triangle_adjacency(F, TT, TTi); + // Fix mis-match convention + { + Eigen::PermutationMatrix<3,3> perm(3); + perm.indices() = Eigen::Vector3i(1,2,0); + TT = (TT*perm).eval(); + TTi = (TTi*perm).eval(); + for(int i=0;i b(m); + for(int i=0; i appeared1(m,0), appearedm1(m,0); + for(int i=0; i=0) { + REQUIRE(E(i,j) == E(TT(i,j),TTi(i,j))); + } + } + } + } +} + diff --git a/vendor/libigl/tests/include/igl/path_to_edges.cpp b/vendor/libigl/tests/include/igl/path_to_edges.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d02f2efde0c5ed7c955fbad8b767a89cb932b8dd --- /dev/null +++ b/vendor/libigl/tests/include/igl/path_to_edges.cpp @@ -0,0 +1,53 @@ +#include +#include + +#include + +TEST_CASE("igl_path_to_edges: basic_test", "[igl]") +{ + const Eigen::VectorXi I = (Eigen::VectorXi(6)<<0,1,2,3,4,5).finished(); + const Eigen::MatrixXi Eexpected = (Eigen::MatrixXi(5,2)<<0,1, 1,2, 2,3, 3,4, 4,5).finished(); + + Eigen::MatrixXi Eactual; + igl::path_to_edges(I, Eactual); + + test_common::assert_eq(Eactual, Eexpected); +} + +#include + +TEST_CASE("igl_path_to_edges: loop_test", "[igl]") +{ + const Eigen::VectorXi I = (Eigen::VectorXi(6)<<0,1,2,3,4,5).finished(); + const Eigen::MatrixXi Eexpected = (Eigen::MatrixXi(6,2)<<0,1, 1,2, 2,3, 3,4, 4,5, 5,0).finished(); + + Eigen::MatrixXi Eactual; + const bool make_loop = true; + igl::path_to_edges(I, Eactual, make_loop); + std::cout << Eactual << std::endl; + test_common::assert_eq(Eactual, Eexpected); +} + +TEST_CASE("igl_path_to_edges: vector_basic_test", "[igl]") +{ + const std::vector I{0,1,2,3,4,5}; + const Eigen::MatrixXi Eexpected = (Eigen::MatrixXi(5,2)<<0,1, 1,2, 2,3, 3,4, 4,5).finished(); + + Eigen::MatrixXi Eactual; + igl::path_to_edges(I, Eactual); + + test_common::assert_eq(Eactual, Eexpected); +} + + +TEST_CASE("igl_path_to_edges: vector_loop_test", "[igl]") +{ + const std::vector I{0,1,2,3,4,5}; + const Eigen::MatrixXi Eexpected = (Eigen::MatrixXi(6,2)<<0,1, 1,2, 2,3, 3,4, 4,5, 5,0).finished(); + + Eigen::MatrixXi Eactual; + const bool make_loop = true; + igl::path_to_edges(I, Eactual, make_loop); + + test_common::assert_eq(Eactual, Eexpected); +} \ No newline at end of file diff --git a/vendor/libigl/tests/include/igl/path_to_executable.cpp b/vendor/libigl/tests/include/igl/path_to_executable.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0aee429d4d31c094cd9313f035acab819db15ac0 --- /dev/null +++ b/vendor/libigl/tests/include/igl/path_to_executable.cpp @@ -0,0 +1,15 @@ +#include +#include + +#include + + +TEST_CASE("path_to_executable: example", "[igl]") +{ + std::string path_to_executable = igl::path_to_executable(); + REQUIRE(0 < path_to_executable.size()); + // check if path_to_executable ends with correct file name, on windows .exe suffix is added. + std::string executable = "test_igl_core"; + int pos = path_to_executable.length()-(executable.length() + 4/*".exe"*/); + REQUIRE( std::string::npos != path_to_executable.find(executable, pos)); +} diff --git a/vendor/libigl/tests/include/igl/pathinfo.cpp b/vendor/libigl/tests/include/igl/pathinfo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0469ca9e36a14ec1682809da6017be2e783b6845 --- /dev/null +++ b/vendor/libigl/tests/include/igl/pathinfo.cpp @@ -0,0 +1,35 @@ +#include +#include + +#include +#include +#include + +TEST_CASE("pathinfo: examples", "[igl]") +{ + const std::vector< + std::tuple > + examples = + { + std::make_tuple("/foo" ,"/" ,"foo" ,"" ,"foo"), + std::make_tuple("/foo/" ,"/" ,"foo" ,"" ,"foo"), + std::make_tuple("/foo//" ,"/" ,"foo" ,"" ,"foo"), + std::make_tuple("/foo/./" ,"/foo" ,"." ,"" ,""), + std::make_tuple("/foo/bar" ,"/foo" ,"bar" ,"" ,"bar"), + std::make_tuple("/foo/bar." ,"/foo" ,"bar." ,"" ,"bar"), + std::make_tuple("/foo/bar.txt" ,"/foo" ,"bar.txt" ,"txt","bar"), + std::make_tuple("/foo/bar.txt.zip" ,"/foo" ,"bar.txt.zip","zip","bar.txt"), + std::make_tuple("/foo/bar.dir/" ,"/foo" ,"bar.dir" ,"dir","bar"), + std::make_tuple("/foo/bar.dir/file" ,"/foo/bar.dir","file" ,"" ,"file"), + std::make_tuple("/foo/bar.dir/file.txt","/foo/bar.dir","file.txt" ,"txt","file") + }; + for(const auto & example : examples) + { + std::string d,b,e,f; + igl::pathinfo(std::get<0>(example),d,b,e,f); + REQUIRE (d == std::get<1>(example)); + REQUIRE (b == std::get<2>(example)); + REQUIRE (e == std::get<3>(example)); + REQUIRE (f == std::get<4>(example)); + } +} diff --git a/vendor/libigl/tests/include/igl/per_face_normals.cpp b/vendor/libigl/tests/include/igl/per_face_normals.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a2546b764294bffd85ceb48383872bc9ad68fe0a --- /dev/null +++ b/vendor/libigl/tests/include/igl/per_face_normals.cpp @@ -0,0 +1,31 @@ + +#include +#include +#include + +TEST_CASE("per_face_normals: dot", "[igl]" "[slow]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V,N; + Eigen::MatrixXi F; + // Load example mesh: GetParam() will be name of mesh file + igl::read_triangle_mesh(test_common::data_path(param), V, F); + igl::per_face_normals(V,F,N); + REQUIRE (N.rows() == F.rows()); + for(int f = 0;f a); + }; + + test_common::run_test_cases(test_common::all_meshes(), test_case); +} diff --git a/vendor/libigl/tests/include/igl/polygon_corners.cpp b/vendor/libigl/tests/include/igl/polygon_corners.cpp new file mode 100644 index 0000000000000000000000000000000000000000..75bccc423c73a206a2d868ead6192fdfe7434b1b --- /dev/null +++ b/vendor/libigl/tests/include/igl/polygon_corners.cpp @@ -0,0 +1,28 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include +#include +#include +#include + +TEST_CASE("polygon_corners: quads", "[igl]") +{ + const Eigen::MatrixXi Q = (Eigen::MatrixXi(2,4)<< 0,1,2,3, 1,4,5,2).finished(); + std::vector> vQ; + igl::matrix_to_list(Q,vQ); + const Eigen::VectorXi Iexact = (Eigen::VectorXi(8)<<0,1,2,3,1,4,5,2).finished(); + const Eigen::VectorXi Cexact = (Eigen::VectorXi(3)<<0,4,8).finished(); + Eigen::VectorXi I,C; + igl::polygon_corners(vQ,I,C); + test_common::assert_eq(I,Iexact); + test_common::assert_eq(C,Cexact); + igl::polygon_corners( Q,I,C); + test_common::assert_eq(I,Iexact); + test_common::assert_eq(C,Cexact); +} diff --git a/vendor/libigl/tests/include/igl/predicates/ear_clipping.cpp b/vendor/libigl/tests/include/igl/predicates/ear_clipping.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4c7ef95d6f7d27692032f0257da0e83c0cc47c04 --- /dev/null +++ b/vendor/libigl/tests/include/igl/predicates/ear_clipping.cpp @@ -0,0 +1,16 @@ +#include +#include + +TEST_CASE("ear_clipping: boolean", "[igl/predicates]") +{ + // Example1: simple polygon + Eigen::MatrixXd polygon(10,2); + polygon<<2,-3,4,1,5.5,-2,6,2.5,5,1,4,5,3,0,1,1,1,5,0,0; + Eigen::VectorXi RT,nR,M; + Eigen::MatrixXi eF; + Eigen::MatrixXd nP; + RT.setZero(polygon.rows()); + igl::predicates::ear_clipping(polygon,RT,M,eF,nP); + REQUIRE(nP.rows() == 0); + +} diff --git a/vendor/libigl/tests/include/igl/predicates/predicates.cpp b/vendor/libigl/tests/include/igl/predicates/predicates.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8a090931a368f9dd654057df4a98fa91abdd2236 --- /dev/null +++ b/vendor/libigl/tests/include/igl/predicates/predicates.cpp @@ -0,0 +1,55 @@ +#include +#include +#include + +TEST_CASE("predicates", "[igl][predicates]") { + using namespace igl::predicates; + using Scalar = double; + igl::predicates::exactinit(); + + SECTION("2D") { + using Point = Eigen::Matrix; + Point a(2,1),b(2,1),c(2,1),d(2,1),e(2,1),f(2,1); + a << 0.0, 0.0; + b << 1.0, 0.0; + c << 1.0, 1.0; + d << 2.0, 0.0; + e << 0.0, 1.0; + f << 0.5, 0.5; + + REQUIRE(orient2d(a, b, c) == Orientation::POSITIVE); + REQUIRE(orient2d(a, c, b) == Orientation::NEGATIVE); + REQUIRE(orient2d(a, b, b) == Orientation::COLLINEAR); + REQUIRE(orient2d(a, a, a) == Orientation::COLLINEAR); + REQUIRE(orient2d(a, b, d) == Orientation::COLLINEAR); + REQUIRE(orient2d(a, f, c) == Orientation::COLLINEAR); + + REQUIRE(incircle(a,b,c,e) == Orientation::COCIRCULAR); + REQUIRE(incircle(a,b,c,a) == Orientation::COCIRCULAR); + REQUIRE(incircle(a,b,c,d) == Orientation::OUTSIDE); + REQUIRE(incircle(a,b,c,f) == Orientation::INSIDE); + } + + SECTION("3D") { + using Point = Eigen::Matrix; + Point a(3,1),b(3,1),c(3,1),d(3,1),e(3,1),f(3,1); + a << 0.0, 0.0, 0.0; + b << 1.0, 0.0, 0.0; + c << 0.0, 1.0, 0.0; + d << 0.0, 0.0, 1.0; + e << 1.0, 1.0, 1.0; + f << std::numeric_limits::epsilon(), 0.0, 0.0; + + REQUIRE(orient3d(a, b, c, d) == Orientation::NEGATIVE); + REQUIRE(orient3d(a, b, d, c) == Orientation::POSITIVE); + REQUIRE(orient3d(a, b, d, d) == Orientation::COPLANAR); + REQUIRE(orient3d(a, a, a, a) == Orientation::COPLANAR); + REQUIRE(orient3d(a, b, f, c) == Orientation::COPLANAR); + + REQUIRE(insphere(a, b, c, d, e) == Orientation::COSPHERICAL); + REQUIRE(insphere(a, b, d, e, c) == Orientation::COSPHERICAL); + REQUIRE(insphere(b, c, e, d, ((a+b)*0.5).eval()) == Orientation::INSIDE); + REQUIRE(insphere(b, c, e, d, (-f).eval()) == Orientation::OUTSIDE); + REQUIRE(insphere(f, b, d, c, e) == Orientation::INSIDE); + } +} diff --git a/vendor/libigl/tests/include/igl/predicates/segment_segment_intersect.cpp b/vendor/libigl/tests/include/igl/predicates/segment_segment_intersect.cpp new file mode 100644 index 0000000000000000000000000000000000000000..14f1bb83308e09e52bb4dcb63b98600297ee6d9e --- /dev/null +++ b/vendor/libigl/tests/include/igl/predicates/segment_segment_intersect.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +TEST_CASE("segment_segment_intersect: robust", "[igl/predicates]") +{ + // example 1: vanila intersecting case + auto A1 = Eigen::RowVector2d(0, 128.5); + auto B1 = Eigen::RowVector2d(-77.44,1.2); + auto C1 = Eigen::RowVector2d(-83.2,2.8); + auto D1 = Eigen::RowVector2d(-1.0,-1.0); + + bool check1 = igl::predicates::segment_segment_intersect(A1,B1,C1,D1); + REQUIRE(check1 == true); + + // example 2: colinear overlapping + auto A2 = Eigen::RowVector2d(1.0,5.0); + auto B2 = Eigen::RowVector2d(1.0,9.0); + auto C2 = Eigen::RowVector2d(1.0,8.0); + auto D2 = Eigen::RowVector2d(1.0,12.0); + + bool check2 = igl::predicates::segment_segment_intersect(A2,B2,C2,D2); + REQUIRE(check2 == true); + + // example 3: colinear touching endpoint + auto A3 = Eigen::RowVector2d(0.0,0.0); + auto B3 = Eigen::RowVector2d(1.5,1.5); + auto C3 = Eigen::RowVector2d(1.5,1.5); + auto D3 = Eigen::RowVector2d(2.0,2.0); + + bool check3 = igl::predicates::segment_segment_intersect(A3,B3,C3,D3); + REQUIRE(check3 == true); + + // example 6: colinear not touching endpoint + double eps = 1e-14; + auto A4 = Eigen::RowVector2d(0.0,0.0); + auto B4 = Eigen::RowVector2d(1.5,1.5); + auto C4 = Eigen::RowVector2d(1.5+eps,1.5+eps); + auto D4 = Eigen::RowVector2d(2.0,2.0); + bool check4 = igl::predicates::segment_segment_intersect(A4,B4,C4,D4); + REQUIRE(check4 == false); + +} \ No newline at end of file diff --git a/vendor/libigl/tests/include/igl/principal_curvature.cpp b/vendor/libigl/tests/include/igl/principal_curvature.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8cbd22418f37fad4c3240a31e0c78a5371ac95b8 --- /dev/null +++ b/vendor/libigl/tests/include/igl/principal_curvature.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +TEST_CASE("principal_curvature: cylinder", "[igl]") +{ + using namespace igl; + const int axis_devisions = 20; + const int height_devisions = 20; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + cylinder(axis_devisions,height_devisions,V,F); + Eigen::MatrixXd PD1,PD2; + Eigen::VectorXd PV1,PV2; + //PV1: maximal curvature value for each vertex. + //PV2: minimal curvature value for each vertex. + igl::principal_curvature(V,F,PD1,PD2,PV1,PV2); + REQUIRE (PD1.rows() == V.rows()); + REQUIRE (PD2.rows() == V.rows()); + REQUIRE (PD1.cols() == 3); + REQUIRE (PD2.cols() == 3); + REQUIRE (PV1.size() == V.rows()); + REQUIRE (PV2.size() == V.rows()); + for(int i = 0; i=PV2[i]); + } +} \ No newline at end of file diff --git a/vendor/libigl/tests/include/igl/qslim.cpp b/vendor/libigl/tests/include/igl/qslim.cpp new file mode 100644 index 0000000000000000000000000000000000000000..31d1e7c65191c0f9277025c49e236cdace4553e7 --- /dev/null +++ b/vendor/libigl/tests/include/igl/qslim.cpp @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include +//#include +#include + +TEST_CASE("qslim: cylinder", "[igl]" "[slow]") +{ + using namespace igl; + const int axis_devisions = 5; + const int height_devisions = 2+10; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + cylinder(axis_devisions,height_devisions,V,F); + Eigen::MatrixXd U; + Eigen::MatrixXi G; + Eigen::VectorXi I,J; + qslim(V,F,2*axis_devisions,U,G,I,J); + REQUIRE (U.rows() == axis_devisions*2); + //double l,u; + igl::writePLY("qslim-cylinder-vf.ply",V,F); + igl::writePLY("qslim-cylinder-ug.ply",U,G); + const auto & hausdorff_lower_bound = []( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + Eigen::MatrixXd & U, + Eigen::MatrixXi & G)->double + { + Eigen::MatrixXd Vk; + Eigen::MatrixXi Fk; + igl::upsample(V,F,Vk,Fk,5); + Eigen::MatrixXd C; + Eigen::VectorXi I; + Eigen::VectorXd D; + igl::point_mesh_squared_distance(Vk,U,G,D,I,C); + return D.array().sqrt().maxCoeff(); + }; + //igl::hausdorff(V,F,U,G,1e-14,l,u); + REQUIRE (0 == Approx (hausdorff_lower_bound(V,F,U,G)).margin(2e-10)); + //igl::hausdorff(U,G,V,F,1e-14,l,u); + REQUIRE (0 == Approx (hausdorff_lower_bound(U,G,V,F)).margin(2e-10)); +} diff --git a/vendor/libigl/tests/include/igl/quadprog.cpp b/vendor/libigl/tests/include/igl/quadprog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..91b5e7d4cc3fff98cbfdfcbdcf1136bb959fb85e --- /dev/null +++ b/vendor/libigl/tests/include/igl/quadprog.cpp @@ -0,0 +1,137 @@ +#include +#include +#include + + +TEST_CASE("quadprog: box3", "[igl]" ) +{ + { + Eigen::Matrix3d H = (Eigen::Matrix3d(3,3)<< + 0.240548455386281, 0.237314308102107, 0.0436993831501944, + 0.237314308102107, 0.326254049041854,-0.00021896091952631, + 0.0436993831501944,-0.00021896091952631, 0.171175681280756 + ).finished(); + Eigen::Vector3d f = (Eigen::Vector3d(3,1)<< + 0.222182612270718, + 0.503254616893693, + -0.184619987497072 + ).finished(); + Eigen::Vector3d lb = (Eigen::Vector3d(3,1)<< + -1, + -1, + -1 + ).finished(); + Eigen::Vector3d ub = (Eigen::Vector3d(3,1)<< + 1, + 1, + 1 + ).finished(); + // Windows needs template args spelled out + Eigen::Vector3d x = igl::quadprog(H,f,lb,ub); + //std::cout<(H,f,lb,ub); + REQUIRE(x(0)==0.0); + REQUIRE(x(1)==0.5); + REQUIRE(x(1)==0.5); + } + { + Eigen::Matrix3d H = (Eigen::Matrix3d(3,3)<< + 1.06020279605748, 0.387347953430924,-0.653587847224834, + 0.387347953430924, 0.323001970642631, -0.80259721932688, + -0.653587847224834, -0.80259721932688, 2.73709523329989 + ).finished(); + Eigen::Vector3d f = (Eigen::Vector3d(3,1)<< + -0.0155804986732503, + -0.00161174173383921, + -0.00903647945917485 + ).finished(); + Eigen::Vector3d lb = (Eigen::Vector3d(3,1)<< + 0, + 0, + 0 + ).finished(); + Eigen::Vector3d ub = (Eigen::Vector3d(3,1)<< + 0.015625, + 0.015625, + 0.015625 + ).finished(); + // Windows needs template args spelled out + Eigen::Vector3d x = igl::quadprog(H,f,lb,ub); + Eigen::Vector3d xexact(0.015625, 0.013732474124087, 0.0110593284260843); + REQUIRE((x-xexact).array().abs().maxCoeff() < 1e-4); + } +} + +TEST_CASE("quadprog: box2", "[igl]" ) +{ + { + Eigen::Matrix2d H = (Eigen::Matrix2d(2,2)<< + 0.683698654982294,-0.0521997092763332, + -0.0521997092763332, 0.800535063458999 + ).finished(); + Eigen::Vector2d f = (Eigen::Vector2d(2,1)<< + -0.733716332234936, + 2.56401312736278 + ).finished(); + Eigen::Vector2d lb = (Eigen::Vector2d(2,1)<< + -1, + -1 + ).finished(); + Eigen::Vector2d ub = (Eigen::Vector2d(2,1)<< + 1, + 1 + ).finished(); + // Windows needs template args spelled out + Eigen::Vector2d x = igl::quadprog(H,f,lb,ub); + //std::cout<(H,f,lb,ub); + //std::cout<(H,f,lb,ub); + //std::cout< +#include +#include + +TEST_CASE("randperm: default_rng_reproduce_identity", "[igl]") +{ + int n = 100; + Eigen::VectorXi I1, I2; + + std::srand(6); + igl::randperm(100, I1); + std::srand(6); + igl::randperm(100, I2); + + test_common::assert_eq(I1, I2); +} + +namespace randperm +{ + template + void test_reproduce() + { + int n = 100; + Eigen::VectorXi I1, I2; + Eigen::MatrixXi Ix1, Ix2; + URBG rng1(6); + URBG rng2(6); + + igl::randperm(100, I1, rng1); + igl::randperm(100, I2, rng2); + + igl::randperm(100, Ix1, rng1); + igl::randperm(100, Ix2, rng2); + + test_common::assert_eq(I1, I2); + test_common::assert_eq(Ix1, Ix2); + + test_common::assert_neq(I1, Ix1); + test_common::assert_neq(I2, Ix2); + } +} + +TEST_CASE("randperm: minstd_rand0_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: minstd_rand_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: mt19937_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: mt19937_64_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: ranlux24_base_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: ranlux48_base_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: ranlux24_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: ranlux48_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: knuth_b_reproduce_identity", "[igl]") +{ + randperm::test_reproduce(); +} +TEST_CASE("randperm: default_identity", "[igl]") +{ + int n = 100; + Eigen::VectorXi I1, I2; + Eigen::MatrixXi Ix1, Ix2; + + std::srand(0); + igl::randperm(100, I1); + igl::randperm(100, Ix1); + std::srand(0); + igl::randperm(100, I2); + igl::randperm(100, Ix2); + + test_common::assert_eq(I1, I2); + test_common::assert_eq(Ix1, Ix2); +} diff --git a/vendor/libigl/tests/include/igl/readDMAT.cpp b/vendor/libigl/tests/include/igl/readDMAT.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f442d9ec0ce0f1dfac6e07a3c0fe6d2c823f2517 --- /dev/null +++ b/vendor/libigl/tests/include/igl/readDMAT.cpp @@ -0,0 +1,20 @@ +#include + +TEST_CASE("readDMAT: Comp", "[igl]") +{ + Eigen::MatrixXd N1, N2; + igl::readDMAT(test_common::data_path("duplicated_faces_N1.dmat"), N1); + igl::readDMAT(test_common::data_path("duplicated_faces_N2.dmat"), N2); + + REQUIRE (N2.rows() == N1.rows()); + REQUIRE (N2.cols() == N1.cols()); + REQUIRE (!((N1-N2).array() != 0.0).all()); + + const size_t rows = N1.rows(); + const size_t cols = N1.cols(); + for (size_t i=0; i + +#include + +#include +#include + +TEST_CASE("readMESH: single-tet","[igl]") +{ + const std::string filename = "readMESH_single-tet.mesh"; + std::ofstream(filename)<< R"(MeshVersionFormatted 1 +Dimension 3 +Vertices +4 +0 0 0 0 +0 0 1 0 +0 1 0 0 +1 0 0 0 +Triangles +0 +Tetrahedra +1 +1 2 3 4 0 +End + )"; + + Eigen::MatrixXd V; + Eigen::MatrixXi T,F; + igl::readMESH(filename,V,T,F); + REQUIRE(V.rows() == 4); + REQUIRE(T.rows() == 1); + REQUIRE(T(0,0) == 0); + REQUIRE(F.rows() == 0); + +} + + +TEST_CASE("readMESH: no-triangles-line","[igl]") +{ + const std::string filename = "readMESH_no-triangles-line.mesh"; + std::ofstream(filename)<< R"(MeshVersionFormatted 1 +Dimension 3 +Vertices +4 +0 0 0 0 +0 0 1 0 +0 1 0 0 +1 0 0 0 +Tetrahedra +1 +1 2 3 4 0 + )"; + + Eigen::MatrixXd V; + Eigen::MatrixXi T,F; + igl::readMESH(filename,V,T,F); + REQUIRE(V.rows() == 4); + REQUIRE(T.rows() == 1); + REQUIRE(T(0,0) == 0); + REQUIRE(F.rows() == 0); + +} + + +TEST_CASE("readMESH: mesh-version-formatted-2","[igl]") +{ + const std::string filename = "readMESH_mesh-version-formatted-2.mesh"; + std::ofstream(filename)<< R"(MeshVersionFormatted 2 +Dimension 3 +Vertices +4 +0 0 0 0 +0 0 1 0 +0 1 0 0 +1 0 0 0 +Triangles +0 +Tetrahedra +1 +1 2 3 4 0 +End + )"; + + Eigen::MatrixXd V; + Eigen::MatrixXi T,F; + igl::readMESH(filename,V,T,F); + REQUIRE(V.rows() == 4); + REQUIRE(T.rows() == 1); + REQUIRE(T(0,0) == 0); + REQUIRE(F.rows() == 0); + +} + diff --git a/vendor/libigl/tests/include/igl/readMSH.cpp b/vendor/libigl/tests/include/igl/readMSH.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d2cfaa1c9825983a2369cc6b07f7881447551e55 --- /dev/null +++ b/vendor/libigl/tests/include/igl/readMSH.cpp @@ -0,0 +1,72 @@ +#include + +#include + +#include + +#include + + +TEST_CASE("readMSH","[igl]") +{ + Eigen::MatrixXd X; + Eigen::MatrixXi Tri; + Eigen::MatrixXi Tet; + Eigen::VectorXi TriTag; + Eigen::VectorXi TetTag; + + std::vector XFields; + std::vector EFields; + + std::vector XF; + std::vector TriF; + std::vector TetF; + + REQUIRE(igl::readMSH(test_common::data_path("sphere_lowres_TMS_1-0001_Magstim_70mm_Fig8_nii_scalar.msh"), + X, Tri, Tet, TriTag, TetTag, XFields, XF, EFields, TriF, TetF)); + + REQUIRE(X.cols() == 3); + REQUIRE(X.rows() == (398+4506)); + + REQUIRE(Tri.cols() == 3); + REQUIRE(Tri.rows() == 8988); + REQUIRE(TriTag.rows() == 8988); + + // determine all tags + std::set tri_tags_unique; + for(size_t i=0; i tet_tags_unique; + for(size_t i=0; i +#include +#include +#include +#include + +TEST_CASE("readOBJ: simple", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + // wait... so this is actually testing test_common::load_mesh not readOBJ + // directly... + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + REQUIRE (V.rows() == 8); + REQUIRE (F.rows() == 12); +} + +TEST_CASE("readOBJ: Obj with material", "[igl]") +{ + std::vector > V; + std::vector > TC; + std::vector > N; + std::vector > F; + std::vector > FTC; + std::vector > FN; + std::vector> FM; + igl::readOBJ(test_common::data_path("cubewithmaterial.obj"), V, TC, N, F, FTC, FN, FM); + + REQUIRE (V.size() == 8); + REQUIRE (F.size() == 6); + for ( const auto& i : FM ) { + std::cout << "material "; + std::cout << std::get<0>(i) << ' '; + std::cout << "fstart "; + std::cout << std::get<1>(i) << ' '; + std::cout << "fend "; + std::cout << std::get<2>(i) << ' '; + std::cout << std::endl; + } + REQUIRE (FM.size() == 2); +} diff --git a/vendor/libigl/tests/include/igl/readOFF.cpp b/vendor/libigl/tests/include/igl/readOFF.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bc89053909d647c083fbf5e43d6f3d55ea365cb9 --- /dev/null +++ b/vendor/libigl/tests/include/igl/readOFF.cpp @@ -0,0 +1,14 @@ +#include + +TEST_CASE("readOFF: simple", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + // wait... so this is actually testing test_common::load_mesh not readOFF + // directly... + igl::read_triangle_mesh(test_common::data_path("cube.off"), V, F); + REQUIRE (V.rows() == 8); + REQUIRE (V.cols() == 3); + REQUIRE (F.rows() == 12); + REQUIRE (F.cols() == 3); +} diff --git a/vendor/libigl/tests/include/igl/readPLY.cpp b/vendor/libigl/tests/include/igl/readPLY.cpp new file mode 100644 index 0000000000000000000000000000000000000000..72e7881f8ef11e16a73d7cfc124c3336ee08b71a --- /dev/null +++ b/vendor/libigl/tests/include/igl/readPLY.cpp @@ -0,0 +1,188 @@ +#include +#include +#include +#include +#include + +TEST_CASE("readPLY: cube_with_fold.ply", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + REQUIRE (igl::readPLY(test_common::data_path("cube_with_fold.ply"), V, F)); + REQUIRE (V.rows() == 26); + REQUIRE (V.cols() == 3); + REQUIRE (F.rows() == 48); + REQUIRE (F.cols() == 3); +} + +TEST_CASE("readPLY: bunny.ply", "[igl]") +{ + std::ifstream f(test_common::data_path("bunny.ply")); + REQUIRE (f.good()); + f.close(); + + Eigen::MatrixXd V,N,UV,VD,FD,ED; + std::vector Vheader,Fheader,Eheader,comments; + + Eigen::MatrixXi F,E; + + REQUIRE (igl::readPLY(test_common::data_path("bunny.ply"), V, F, E, N, UV, VD,Vheader, FD,Fheader, ED,Eheader,comments)); + REQUIRE (V.rows() == 35947); + REQUIRE (V.cols() == 3); + REQUIRE (F.rows() == 69451); + REQUIRE (F.cols() == 3); + // no edge data + REQUIRE (E.rows() == 0); + REQUIRE (E.cols() == 0); + + // no normals or texture coordinates + REQUIRE (N.rows() == 0); + REQUIRE (N.cols() == 0); + REQUIRE (UV.rows() == 0); + REQUIRE (UV.cols() == 0); + + // this bunny have additonal data + REQUIRE (VD.rows() == 35947); + REQUIRE (VD.cols() == 2); + + REQUIRE (Vheader.size() == 2); + REQUIRE (Vheader[0] == "confidence" ); + REQUIRE (Vheader[1] == "intensity" ); + + // no Face data or edge data + REQUIRE (FD.rows() == 0); + REQUIRE (FD.cols() == 0); + REQUIRE (Fheader.size() == 0); + + REQUIRE (ED.rows() == 0); + REQUIRE (ED.cols() == 0); + REQUIRE (Eheader.size() == 0); + + // there are comments + REQUIRE (comments.size() == 2); +} + +TEST_CASE("readPLY: mesh_error.ply", "[igl]") +{ + // test on a non-existent file + std::ifstream f(test_common::data_path("mesh_error.ply")); + REQUIRE (f.good() == false); + f.close(); + + Eigen::MatrixXd V; + Eigen::MatrixXi F; + REQUIRE (igl::readPLY(test_common::data_path("mesh_error.ply"), V, F) == false); + REQUIRE (V.rows() == 0); + REQUIRE (F.rows() == 0); +} + +TEST_CASE("readPLY: quad_cube.ply", "[igl]") +{ + // small qube from blender + const char *ply_quad_cube= +"ply\n" +"format ascii 1.0\n" +"comment Created by Blender 2.81 (sub 16) - www.blender.org, source file: ''\n" +"element vertex 24\n" +"property float x\n" +"property float y\n" +"property float z\n" +"property float nx\n" +"property float ny\n" +"property float nz\n" +"property float s\n" +"property float t\n" +"element face 6\n" +"property list uchar uint vertex_indices\n" +"property uchar red\n" +"property uchar green\n" +"property uchar blue\n" +"property uchar alpha\n" +"end_header\n" +"1.000000 1.000000 1.000000 0.000000 -0.000000 1.000000 0.625000 0.500000\n" +"-1.000000 1.000000 1.000000 0.000000 -0.000000 1.000000 0.875000 0.500000\n" +"-1.000000 -1.000000 1.000000 0.000000 -0.000000 1.000000 0.875000 0.750000\n" +"1.000000 -1.000000 1.000000 0.000000 -0.000000 1.000000 0.625000 0.750000\n" +"1.000000 -1.000000 -1.000000 0.000000 -1.000000 0.000000 0.375000 0.750000\n" +"1.000000 -1.000000 1.000000 0.000000 -1.000000 0.000000 0.625000 0.750000\n" +"-1.000000 -1.000000 1.000000 0.000000 -1.000000 0.000000 0.625000 1.000000\n" +"-1.000000 -1.000000 -1.000000 0.000000 -1.000000 0.000000 0.375000 1.000000\n" +"-1.000000 -1.000000 -1.000000 -1.000000 -0.000000 0.000000 0.375000 0.000000\n" +"-1.000000 -1.000000 1.000000 -1.000000 -0.000000 0.000000 0.625000 0.000000\n" +"-1.000000 1.000000 1.000000 -1.000000 -0.000000 0.000000 0.625000 0.250000\n" +"-1.000000 1.000000 -1.000000 -1.000000 -0.000000 0.000000 0.375000 0.250000\n" +"-1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000 0.125000 0.500000\n" +"1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000 0.375000 0.500000\n" +"1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000 0.375000 0.750000\n" +"-1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000 0.125000 0.750000\n" +"1.000000 1.000000 -1.000000 1.000000 -0.000000 0.000000 0.375000 0.500000\n" +"1.000000 1.000000 1.000000 1.000000 -0.000000 0.000000 0.625000 0.500000\n" +"1.000000 -1.000000 1.000000 1.000000 -0.000000 0.000000 0.625000 0.750000\n" +"1.000000 -1.000000 -1.000000 1.000000 -0.000000 0.000000 0.375000 0.750000\n" +"-1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000 0.375000 0.250000\n" +"-1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.625000 0.250000\n" +"1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.625000 0.500000\n" +"1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000 0.375000 0.500000\n" +"4 0 1 2 3 0 0 255 255\n" +"4 4 5 6 7 0 0 255 255\n" +"4 8 9 10 11 0 0 255 255\n" +"4 12 13 14 15 0 0 255 255\n" +"4 16 17 18 19 0 0 255 255\n" +"4 20 21 22 23 0 0 255 255\n"; + + + std::ofstream f("quad_cube.ply"); + f.write(ply_quad_cube,strlen(ply_quad_cube)); + f.close(); + + Eigen::MatrixXd V; + Eigen::MatrixXi F; + REQUIRE (igl::readPLY("quad_cube.ply", V, F)); + REQUIRE (V.rows() == 24); + REQUIRE (V.cols() == 3); + REQUIRE (F.rows() == 6); + REQUIRE (F.cols() == 4); + + Eigen::MatrixXd N,UV,VD,FD,ED; + Eigen::MatrixXi E; + std::vector headerV; + std::vector headerF, headerE, comments; + + REQUIRE (igl::readPLY("quad_cube.ply", V, F, E, N, UV, + VD, headerV, + FD, headerF, + ED, headerE, + comments)); + + REQUIRE (V.rows() == 24); + REQUIRE (V.cols() == 3); + REQUIRE (F.rows() == 6); + REQUIRE (F.cols() == 4); + + REQUIRE (E.rows() == 0); + REQUIRE (E.cols() == 0); + + REQUIRE (N.rows() == 24); + REQUIRE (N.cols() == 3); + + REQUIRE (UV.rows() == 24); + REQUIRE (UV.cols() == 2); + + REQUIRE (VD.rows() == 0); + REQUIRE (VD.cols() == 0); + REQUIRE (headerV.empty()); + + REQUIRE (FD.rows() == 6); + REQUIRE (FD.cols() == 4); + REQUIRE (headerF.size() == 4); + + REQUIRE (headerF[0] == "red"); + REQUIRE (headerF[1] == "green"); + REQUIRE (headerF[2] == "blue"); + REQUIRE (headerF[3] == "alpha"); + + REQUIRE (ED.rows() == 0); + REQUIRE (ED.cols() == 0); + + REQUIRE (headerE.size() == 0); +} \ No newline at end of file diff --git a/vendor/libigl/tests/include/igl/remesh_along_isoline.cpp b/vendor/libigl/tests/include/igl/remesh_along_isoline.cpp new file mode 100644 index 0000000000000000000000000000000000000000..855b421b3ff92f31a7d66844a96dcc8cccd24071 --- /dev/null +++ b/vendor/libigl/tests/include/igl/remesh_along_isoline.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +#include + +TEST_CASE("remesh_along_isoline: triangle_mesh", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + const double mean_z = V.col(2).mean(); + + Eigen::VectorXi C; + igl::facet_components(F, C); + const int fc_count_before = C.maxCoeff(); + + Eigen::VectorXd S = V.col(2); + Eigen::MatrixXd U; + Eigen::MatrixXi G; + Eigen::VectorXd SU; + Eigen::VectorXi J; + Eigen::SparseMatrix BC; + Eigen::VectorXi L; + igl::remesh_along_isoline(V,F,S,mean_z,U,G,SU,J,BC,L); + + igl::facet_components(G, C); + const int fc_count_after = C.maxCoeff(); + + // number of face connected components should not change + REQUIRE(fc_count_before == fc_count_after); +} diff --git a/vendor/libigl/tests/include/igl/rigid_alignment.cpp b/vendor/libigl/tests/include/igl/rigid_alignment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4a71871ec224639e160c29955137e9f0097694f1 --- /dev/null +++ b/vendor/libigl/tests/include/igl/rigid_alignment.cpp @@ -0,0 +1,34 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2019 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include +#include +#include + + +TEST_CASE("rigid_alignment: identity", "[igl]") +{ + const Eigen::MatrixXd X = (Eigen::MatrixXd(10,3)<< + 0.814724,0.157613,0.655741, + 0.905792,0.970593,0.035712, + 0.126987,0.957167,0.849129, + 0.913376,0.485376,0.933993, + 0.632359,0.800280,0.678735, + 0.097540,0.141886,0.757740, + 0.278498,0.421761,0.743132, + 0.546882,0.915736,0.392227, + 0.957507,0.792207,0.655478, + 0.964889,0.959492,0.171187).finished(); + const Eigen::MatrixXd Y = X; + const Eigen::MatrixXd N = (Y.array()-0.5).matrix().rowwise().normalized(); + Eigen::Matrix3d R; + Eigen::RowVector3d t; + igl::rigid_alignment(X,Y,N,R,t); + test_common::assert_near(R,Eigen::Matrix3d::Identity(),1e-12); + test_common::assert_near(t,Eigen::RowVector3d::Zero(),1e-12); +} diff --git a/vendor/libigl/tests/include/igl/seam_edges.cpp b/vendor/libigl/tests/include/igl/seam_edges.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d9e66d97af2259b5ab7df00a2e9845c98c6a9009 --- /dev/null +++ b/vendor/libigl/tests/include/igl/seam_edges.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +TEST_CASE("seam_edges: tet", "[igl]") +{ + Eigen::MatrixXd V,TC,CN; + Eigen::MatrixXi F,FTC,FN; + // Load example mesh: GetParam() will be name of mesh file + igl::readOBJ(test_common::data_path("tet.obj"), V, TC,CN,F,FTC,FN); + Eigen::MatrixXi seams,boundaries,foldovers; + igl::seam_edges(V,TC,F,FTC,seams,boundaries,foldovers); + + Eigen::MatrixXi seams_gt(3,4); + seams_gt<< + 0,0,1,2, + 3,0,0,2, + 1,0,3,2; + test_common::assert_eq(seams,seams_gt); + REQUIRE (0 == boundaries.size()); + REQUIRE (0 == foldovers.size()); +} + diff --git a/vendor/libigl/tests/include/igl/segment_segment_intersect.cpp b/vendor/libigl/tests/include/igl/segment_segment_intersect.cpp new file mode 100644 index 0000000000000000000000000000000000000000..76cf170d9ee68335407a37ab09d41662e3917ab8 --- /dev/null +++ b/vendor/libigl/tests/include/igl/segment_segment_intersect.cpp @@ -0,0 +1,39 @@ +#include +#include + +TEST_CASE("segment_segment_intersect: examples", "[igl]") +{ + // example 1 + // https://github.com/libigl/libigl/issues/965 + + auto s1 = Eigen::RowVector3d(581, 388, -54); + auto dir1 = Eigen::RowVector3d(0.75, -4.36, 0.64); + + auto s2 = Eigen::RowVector3d(636, 77, -10); + auto dir2 = Eigen::RowVector3d(-2.79, 0.96, 0.39); + + double a1, a2; + bool sect1 = igl::segment_segment_intersect(s1, dir1, s2, dir2, a1, a2); + + bool intersectCondition1 = (a1 >= 0 && a1 <= 1 && a2 >= 0 && a2 <= 1); + + REQUIRE(sect1 == false); + REQUIRE(intersectCondition1 == false); + + // example 2 + // https://github.com/libigl/libigl/issues/957 + + auto s3 = Eigen::RowVector3d(-56.6, 0, -201.7); + auto dir3 = Eigen::RowVector3d(0, 0, 1); + + auto s4 = Eigen::RowVector3d(-65.6, 0, 258.8); + auto dir4 = Eigen::RowVector3d(15.4, 0, 1.9); + + double a3, a4; + bool sect2 = igl::segment_segment_intersect(s3, dir3, s4, dir4, a3, a4); + + bool intersectCondition2 = (a3 >= 0 && a3 <= 1 && a4 >= 0 && a4 <= 1); + + REQUIRE(sect2 == false); + REQUIRE(intersectCondition2 == false); +} diff --git a/vendor/libigl/tests/include/igl/setdiff.cpp b/vendor/libigl/tests/include/igl/setdiff.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b7d67a3b6b8a064faf11f543802f024d23fae887 --- /dev/null +++ b/vendor/libigl/tests/include/igl/setdiff.cpp @@ -0,0 +1,46 @@ +#include +#include + +TEST_CASE("setdiff: matrix", "[igl]") +{ + // Base cases + { + const Eigen::VectorXi A = (Eigen::VectorXi(4)<<1,2,1,3).finished(); + const Eigen::VectorXi B(0,1); + Eigen::VectorXi C,IA; + const Eigen::VectorXi cC = (Eigen::VectorXi(3)<<1,2,3).finished(); + const Eigen::VectorXi cIA = (Eigen::VectorXi(3)<<0,1,3).finished(); + igl::setdiff(A,B,C,IA); + test_common::assert_eq(C,cC); + test_common::assert_eq(IA,cIA); + } + { + const Eigen::VectorXi A(0,1); + const Eigen::VectorXi B = (Eigen::VectorXi(4)<<1,2,1,3).finished(); + Eigen::VectorXi C,IA; + const Eigen::VectorXi cC(0,1); + const Eigen::VectorXi cIA(0,1); + igl::setdiff(A,B,C,IA); + test_common::assert_eq(C,cC); + test_common::assert_eq(IA,cIA); + } + + { + // Monkey test + Eigen::VectorXi A(12); + A = (Eigen::VectorXd::Random(A.size(),1).array().abs()*9).cast(); + Eigen::VectorXi B(12); + B = (Eigen::VectorXd::Random(B.size(),1).array().abs()*9).cast(); + Eigen::VectorXi C,IA; + igl::setdiff(A,B,C,IA); + for(int i = 0;i +#include + +TEST_CASE("signed_distance: single_tet", "[igl]") +{ + Eigen::MatrixXd V(4,3); + V<< + 0,0,0, + 1,0,0, + 0,1,0, + 0,0,1; + Eigen::MatrixXi F(4,3); + F<< + 0,1,3, + 0,2,1, + 0,3,2, + 1,2,3; + + Eigen::MatrixXd P(1,3); + P<<0.5,0.5,0.5; + for(const igl::SignedDistanceType type : + { + igl::SIGNED_DISTANCE_TYPE_PSEUDONORMAL , + igl::SIGNED_DISTANCE_TYPE_WINDING_NUMBER, + igl::SIGNED_DISTANCE_TYPE_DEFAULT , + igl::SIGNED_DISTANCE_TYPE_UNSIGNED , + igl::SIGNED_DISTANCE_TYPE_FAST_WINDING_NUMBER + }) + { + Eigen::VectorXd S; + Eigen::VectorXi I; + Eigen::MatrixXd C,N; + igl::signed_distance( P,V,F,type,S,I,C,N); + Eigen::VectorXd Sexact (1,1);Sexact< +#include +#include + +TEST_CASE("slice: dense_identity", "[igl]") +{ + // https://en.wikipedia.org/wiki/Monkey_testing + Eigen::MatrixXd A = Eigen::MatrixXd::Random(10,9); + Eigen::VectorXi I = igl::LinSpaced(A.rows(),0,A.rows()-1); + Eigen::VectorXi J = igl::LinSpaced(A.cols(),0,A.cols()-1); + { + Eigen::MatrixXd B; + igl::slice(A,I,J,B); + test_common::assert_eq(A,B); + } + { + Eigen::MatrixXd B; + igl::slice(A,I,1,B); + test_common::assert_eq(A,B); + } + { + Eigen::MatrixXd B; + igl::slice(A,J,2,B); + test_common::assert_eq(A,B); + } +} + +TEST_CASE("slice: sparse_identity", "[igl]") +{ + Eigen::SparseMatrix A = Eigen::MatrixXd::Random(10,9).sparseView(); + Eigen::VectorXi I = igl::LinSpaced(A.rows(),0,A.rows()-1); + Eigen::VectorXi J = igl::LinSpaced(A.cols(),0,A.cols()-1); + { + Eigen::SparseMatrix B; + igl::slice(A,I,J,B); + test_common::assert_eq(A,B); + } + { + Eigen::SparseMatrix B; + igl::slice(A,I,1,B); + test_common::assert_eq(A,B); + } + { + Eigen::SparseMatrix B; + igl::slice(A,J,2,B); + test_common::assert_eq(A,B); + } +} + +TEST_CASE("slice: density_reverse", "[igl]") +{ + { + Eigen::MatrixXd A = Eigen::MatrixXd::Random(10,9); + Eigen::VectorXi I = igl::LinSpaced(A.rows(),A.rows()-1,0); + Eigen::VectorXi J = igl::LinSpaced(A.cols(),0,A.cols()-1); + Eigen::MatrixXd B; + igl::slice(A,I,J,B); + // reverse rows (i.e., reverse each column vector) + Eigen::MatrixXd C = A.colwise().reverse().eval(); + test_common::assert_eq(B,C); + } + { + Eigen::MatrixXd A = Eigen::MatrixXd::Random(10,9); + Eigen::VectorXi I = igl::LinSpaced(A.rows(),0,A.rows()-1); + Eigen::VectorXi J = igl::LinSpaced(A.cols(),A.cols()-1,0); + Eigen::MatrixXd B; + igl::slice(A,I,J,B); + // reverse cols (i.e., reverse each row vector) + Eigen::MatrixXd C = A.rowwise().reverse().eval(); + test_common::assert_eq(B,C); + } +} + +TEST_CASE("slice: random", "[igl]") +{ + // Test whether unsorted indices are handled correctly by Randomly grow and + // shrink a matrix by slicing out rows and columns: note that growing will + // test whether repeated indices are correctly handled + std::vector > sizes = {{30,27},{3,4}}; + for(const auto & size : sizes) + { + Eigen::MatrixXd A(10,9); + for(int i = 0;i(); + Eigen::VectorXi J = + ((Eigen::VectorXd::Random(size.second,1).array()*0.5+0.5)*A.cols() + ).cast(); + Eigen::MatrixXd B; + igl::slice(A,I,J,B); + Eigen::MatrixXd C(I.size(),J.size()); + for(int i = 0;i +#include +#include + +TEST_CASE("slice_into: dense_identity", "[igl]") +{ + Eigen::MatrixXd A = Eigen::MatrixXd::Random(10,9); + Eigen::VectorXi I = igl::LinSpaced(A.rows(),0,A.rows()-1); + Eigen::VectorXi J = igl::LinSpaced(A.cols(),0,A.cols()-1); + { + Eigen::MatrixXd B(I.maxCoeff()+1,J.maxCoeff()+1); + igl::slice_into(A,I,J,B); + test_common::assert_eq(A,B); + } + { + Eigen::MatrixXd B(I.maxCoeff()+1,A.cols()); + igl::slice_into(A,I,1,B); + test_common::assert_eq(A,B); + } + { + Eigen::MatrixXd B(A.rows(),J.maxCoeff()+1); + igl::slice_into(A,J,2,B); + test_common::assert_eq(A,B); + } +} + +TEST_CASE("slice_into: density_reverse", "[igl]") +{ + { + Eigen::MatrixXd A = Eigen::MatrixXd::Random(10,9); + Eigen::VectorXi I = igl::LinSpaced(A.rows(),A.rows()-1,0); + Eigen::VectorXi J = igl::LinSpaced(A.cols(),0,A.cols()-1); + Eigen::MatrixXd B(I.maxCoeff()+1,J.maxCoeff()+1); + igl::slice_into(A,I,J,B); + // reverse rows (i.e., reverse each column vector) + Eigen::MatrixXd C = A.colwise().reverse().eval(); + test_common::assert_eq(B,C); + } + { + Eigen::MatrixXd A = Eigen::MatrixXd::Random(10,9); + Eigen::VectorXi I = igl::LinSpaced(A.rows(),0,A.rows()-1); + Eigen::VectorXi J = igl::LinSpaced(A.cols(),A.cols()-1,0); + Eigen::MatrixXd B(I.maxCoeff()+1,J.maxCoeff()+1); + igl::slice_into(A,I,J,B); + // reverse cols (i.e., reverse each row vector) + Eigen::MatrixXd C = A.rowwise().reverse().eval(); + test_common::assert_eq(B,C); + } +} + + +TEST_CASE("slice_into: sparse_identity", "[igl]") +{ + Eigen::SparseMatrix A = Eigen::MatrixXd::Random(10,9).sparseView(); + Eigen::VectorXi I = igl::LinSpaced(A.rows(),0,A.rows()-1); + Eigen::VectorXi J = igl::LinSpaced(A.cols(),0,A.cols()-1); + { + Eigen::SparseMatrix B(I.maxCoeff()+1,J.maxCoeff()+1); + igl::slice_into(A,I,J,B); + test_common::assert_eq(A,B); + } + { + Eigen::SparseMatrix B(I.maxCoeff()+1,A.cols()); + igl::slice_into(A,I,1,B); + test_common::assert_eq(A,B); + } + { + Eigen::SparseMatrix B(A.rows(),J.maxCoeff()+1); + igl::slice_into(A,J,2,B); + test_common::assert_eq(A,B); + } +} diff --git a/vendor/libigl/tests/include/igl/slice_sorted.cpp b/vendor/libigl/tests/include/igl/slice_sorted.cpp new file mode 100644 index 0000000000000000000000000000000000000000..026c070ed1de04ab97c0ce22448d95c2cd54e4a0 --- /dev/null +++ b/vendor/libigl/tests/include/igl/slice_sorted.cpp @@ -0,0 +1,79 @@ +#include +#include +#include +#include + +namespace +{ + Eigen::SparseMatrix generate_random_sparse_matrix(int rows, int cols) + { + std::mt19937 gen; + std::uniform_real_distribution dist(0.0, 1.0); + + using T = Eigen::Triplet; + std::vector tripletList; + for (int i = 0; i < rows; ++i) + { + for (int j = 0; j < cols; ++j) + { + auto v_ij = dist(gen); // generate random number + if (v_ij < 0.1) + { + tripletList.push_back(T(i, j, v_ij)); // if larger than treshold, insert it + } + } + } + Eigen::SparseMatrix mat(rows, cols); + mat.setFromTriplets(tripletList.begin(), tripletList.end()); // create the matrix + return mat; + } + +} // namespace + +TEST_CASE("slice_sorted: correctness", "[igl]") +{ + constexpr int rows = 1e3; + constexpr int cols = 1e3; + + Eigen::SparseMatrix M = generate_random_sparse_matrix(rows, cols); + + Eigen::Matrix R(rows / 2); + Eigen::Matrix C(cols / 2); + for (int i = 0; i < rows; i += 2) R[i / 2] = i; + for (int i = 0; i < cols; i += 2) C[i / 2] = i; + + SECTION("correctness") + { + // Check for correctness + Eigen::SparseMatrix A, B; + igl::slice(M, R, C, A); + igl::slice_sorted(M, R, C, B); + REQUIRE((A - B).norm() == 0); + } +} + +TEST_CASE("slice_sorted: benchmark", "[igl]" IGL_DEBUG_OFF) +{ + constexpr int rows = 1e3; + constexpr int cols = 1e3; + + Eigen::SparseMatrix M = generate_random_sparse_matrix(rows, cols); + + Eigen::Matrix R(rows / 2); + Eigen::Matrix C(cols / 2); + for (int i = 0; i < rows; i += 2) R[i / 2] = i; + for (int i = 0; i < cols; i += 2) C[i / 2] = i; + + BENCHMARK("igl::slice") { + Eigen::SparseMatrix A; + igl::slice(M, R, C, A); + return A.norm(); + }; + + BENCHMARK("igl::slice_sorted") { + Eigen::SparseMatrix A; + igl::slice_sorted(M, R, C, A); + return A.norm(); + }; +} + diff --git a/vendor/libigl/tests/include/igl/sort.cpp b/vendor/libigl/tests/include/igl/sort.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0887542106f8698757a1be5856c8b037c8ce5709 --- /dev/null +++ b/vendor/libigl/tests/include/igl/sort.cpp @@ -0,0 +1,87 @@ +#include +#include +#include +#include + +namespace sort +{ + typedef std::tuple NMDimAscending; + // inline std::string NMDimAscending_test_name( + // const ::testing::TestParamInfo& info) + // { + // return STR( + // std::get<0>(info.param)<<"x"<< + // std::get<1>(info.param)<<"_"<< + // "dim_"<(info.param)<<"_"<< + // "ascending_"<<(std::get<3>(info.param)?"true":"false")); + // }; +} + +TEST_CASE("SortTest: random", "[igl]") +{ + const auto test_case = [](const sort::NMDimAscending ¶m) + { + const int n = std::get<0>(param); + const int m = std::get<1>(param); + const int dim = std::get<2>(param); + const bool ascending = std::get<3>(param); + Eigen::MatrixXd X = Eigen::MatrixXd::Random(n,m); + // sort ascending + Eigen::MatrixXd Y; + Eigen::MatrixXi IX; + igl::sort(X,dim,ascending,Y,IX); + REQUIRE (Y.rows() == X.rows()); + REQUIRE (Y.cols() == X.cols()); + REQUIRE (IX.rows() == X.rows()); + REQUIRE (IX.cols() == X.cols()); + for(int i = 0;i= Y(i-(dim==1?1:0),j-(dim==2?1:0))); + }else + { + REQUIRE (Y(i,j) <= Y(i-(dim==1?1:0),j-(dim==2?1:0))); + } + } + } + }; + + std::vector params = { + sort::NMDimAscending{100,3,1,true}, + sort::NMDimAscending{100,3,2,true}, + sort::NMDimAscending{100,3,1,false}, + sort::NMDimAscending{100,3,2,false}, + sort::NMDimAscending{3,100,1,true}, + sort::NMDimAscending{3,100,2,true}, + sort::NMDimAscending{3,100,1,false}, + sort::NMDimAscending{3,100,2,false}, + sort::NMDimAscending{100,2,1,true}, + sort::NMDimAscending{100,2,2,true}, + sort::NMDimAscending{100,2,1,false}, + sort::NMDimAscending{100,2,2,false}, + sort::NMDimAscending{2,100,1,true}, + sort::NMDimAscending{2,100,2,true}, + sort::NMDimAscending{2,100,1,false}, + sort::NMDimAscending{2,100,2,false}, + sort::NMDimAscending{100,4,1,true}, + sort::NMDimAscending{100,4,2,true}, + sort::NMDimAscending{100,4,1,false}, + sort::NMDimAscending{100,4,2,false}, + sort::NMDimAscending{4,100,1,true}, + sort::NMDimAscending{4,100,2,true}, + sort::NMDimAscending{4,100,1,false}, + sort::NMDimAscending{4,100,2,false}, + }; + + test_common::run_test_cases(params, test_case); +} diff --git a/vendor/libigl/tests/include/igl/sparse_voxel_grid.cpp b/vendor/libigl/tests/include/igl/sparse_voxel_grid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bfcdf7b85f5af32d8a9a068e2f383eee9d521b18 --- /dev/null +++ b/vendor/libigl/tests/include/igl/sparse_voxel_grid.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +TEST_CASE("sparse_voxel_grid: unique", "[igl]" ) +{ + const std::function f = + [&](const Eigen::RowVector3d & x)->double + { + return x.norm() - 1.0; + }; + Eigen::RowVector3d p0(0,1.0,0); + Eigen::MatrixXd GV; + Eigen::VectorXd Gf; + Eigen::Matrix GI; + igl::sparse_voxel_grid(p0,f,1,1024,Gf,GV,GI); + Eigen::MatrixXd uGV; + Eigen::VectorXi _1,_2; + igl::unique_rows(GV,uGV,_1,_2); + REQUIRE(GV.rows() == uGV.rows()); +} + diff --git a/vendor/libigl/tests/include/igl/squared_edge_lengths.cpp b/vendor/libigl/tests/include/igl/squared_edge_lengths.cpp new file mode 100644 index 0000000000000000000000000000000000000000..29bc76065354484d2e2aee159db1b84d8740ed40 --- /dev/null +++ b/vendor/libigl/tests/include/igl/squared_edge_lengths.cpp @@ -0,0 +1,121 @@ +#include +#include +#include + + +TEST_CASE("squared_edge_lengths: cube", "[igl]") +{ + //The allowed error for this test + const double epsilon = 1e-15; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + //This is a cube of dimensions 1.0x1.0x1.0 + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + //Create scaled versions of the cube + double scale = 1.0; + double huge_scale = 1.0e8; + double tiny_scale = 1.0e-8; + Eigen::MatrixXd V_huge = V * huge_scale; + Eigen::MatrixXd V_tiny = V * tiny_scale; + //Prepare another mesh with triangles along side diagonals of the cube + //These triangles are form a regular tetrahedron of side sqrt(2) + Eigen::MatrixXi F_tet(4,3); + F_tet << 4,6,1, + 6,4,3, + 4,1,3, + 1,6,3; + + //1. Check edge_lengths_squared function + double side_sq = 1.0; //squared lenght of a side + double diag_sq = 2.0; //squared lenght of a diagonal + Eigen::MatrixXd L_sq; + igl::squared_edge_lengths(V,F,L_sq); + REQUIRE (L_sq.rows() == F.rows()); + REQUIRE (L_sq.cols() == 3); + //All edges in unit cube measure 1.0 or sqrt(2) in diagonals + for(int f = 0;f 1.1) + REQUIRE (L_sq(f,e) == diag_sq); + else + REQUIRE (L_sq(f,e) == side_sq); + //All sides sum exactly side_sq + side_sq + diag_sq + REQUIRE (side_sq + side_sq + diag_sq == L_sq.row(f).sum()); + } + + //Check the regular tetrahedron + igl::squared_edge_lengths(V,F_tet,L_sq); + REQUIRE (L_sq.rows() == F_tet.rows()); + REQUIRE (L_sq.cols() == 3); + //All edges measure sqrt(2) + for(int f = 0;f 1.1*side_sq) + REQUIRE (L_sq(f,e) == diag_sq); + else + REQUIRE (L_sq(f,e) == side_sq); + //All sides sum exactly side_sq + side_sq + diag_sq + REQUIRE (side_sq + side_sq + diag_sq == L_sq.row(f).sum()); + } + + //Check the equilateral triangles + igl::squared_edge_lengths(V_huge,F_tet,L_sq); + REQUIRE (L_sq.rows() == F_tet.rows()); + REQUIRE (L_sq.cols() == 3); + //All edges measure sqrt(2) + for(int f = 0;f 1.1*side_sq) + REQUIRE (L_sq(f,e) == diag_sq); + else + REQUIRE (L_sq(f,e) == side_sq); + //All sides sum exactly side_sq + side_sq + diag_sq + REQUIRE (side_sq + side_sq + diag_sq == L_sq.row(f).sum()); + } + + //Check the regular tetrahedron + igl::squared_edge_lengths(V_tiny,F_tet,L_sq); + REQUIRE (L_sq.rows() == F_tet.rows()); + REQUIRE (L_sq.cols() == 3); + //All edges measure sqrt(2) + for(int f = 0;f +#include +#include +#include + + + +TEST_CASE("tet_tet_adjacency: dot", "[igl]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F, T, TT,TTi; + // Load example mesh: GetParam() will be name of mesh file + igl::readMESH(test_common::data_path(param), V, T, F); + igl::tet_tet_adjacency(T, TT, TTi); + REQUIRE (TT.rows() == T.rows()); + REQUIRE (TTi.rows() == T.rows()); + REQUIRE (TT.cols() == T.cols()); + REQUIRE (TTi.cols() == T.cols()); + for(int t = 0;t= 0) + { + REQUIRE (T.rows() > TT(t, c)); + REQUIRE (0 <= TTi(t, c)); + REQUIRE (4 > TTi(t, c)); + REQUIRE (t == TT(TT(t, c), TTi(t,c))); + } + } + } + }; + + test_common::run_test_cases(test_common::tet_meshes(), test_case); +} diff --git a/vendor/libigl/tests/include/igl/triangle/predicates.cpp b/vendor/libigl/tests/include/igl/triangle/predicates.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c27d148e522fb6ccc677e0edad451c66eaf716e --- /dev/null +++ b/vendor/libigl/tests/include/igl/triangle/predicates.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include + +TEST_CASE("predicates and triangle", "[igl][predicates][triangle]") { + using namespace igl::predicates; + using Scalar = double; + igl::predicates::exactinit(); + + SECTION("Predicate and triangle") { + Eigen::Matrix vertices(4, 2); + Eigen::Matrix holes; + Eigen::Matrix edges; + vertices << 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0; + + Eigen::Matrix out_vertices; + Eigen::Matrix out_faces; + + // Run constrained Delaunay. + igl::triangle::triangulate(vertices, edges, holes, "QcYY", + out_vertices, out_faces); + REQUIRE(out_vertices.rows() == 4); + REQUIRE(out_vertices.cols() == 2); + REQUIRE(out_faces.rows() == 2); + REQUIRE(out_faces.cols() == 3); + } +} diff --git a/vendor/libigl/tests/include/igl/triangle/scaf.cpp b/vendor/libigl/tests/include/igl/triangle/scaf.cpp new file mode 100644 index 0000000000000000000000000000000000000000..594907dc1b18f6b5ef6195a6944b60bc7aa710d5 --- /dev/null +++ b/vendor/libigl/tests/include/igl/triangle/scaf.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +// Assert that building the SCAF equation system via scaf_system() and +// solving it manually yields the same result as calling scaf_solve() directly. +TEST_CASE("scaf_system: Test scaf_system() vs scaf_solve()", "[igl]") +{ + // Read cube mesh + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F); + + // Cut to disk + F = F.topRows(F.rows() - 1).eval(); + + // Compute Tutte's embedding + Eigen::MatrixXd uv_init; + { + Eigen::MatrixXd bnd_uv; + std::vector boundary; + igl::boundary_loop(F, boundary); + Eigen::VectorXi bnd = Eigen::Map(boundary.data(), boundary.size()); + igl::map_vertices_to_circle(V, bnd, bnd_uv); + igl::harmonic(F, bnd, bnd_uv ,1, uv_init); + uv_init.conservativeResize(V.rows(), 2); + } + + // Init empty constraint vectors + Eigen::VectorXi b; + Eigen::MatrixXd bc; + + // Run one scaf iteration as reference + igl::triangle::SCAFData s_ref; + { + igl::triangle::scaf_precompute(V, F, uv_init, s_ref, igl::MappingEnergyType::SYMMETRIC_DIRICHLET, b, bc, 0); + igl::triangle::scaf_solve(s_ref, 1); + } + + // Obtain SCAF linear system perform iteration manually + igl::triangle::SCAFData s_test; + { + // Set up system + igl::triangle::scaf_precompute(V, F, uv_init, s_test, igl::MappingEnergyType::SYMMETRIC_DIRICHLET, b, bc, 0); + Eigen::SparseMatrix L; + Eigen::VectorXd rhs; + igl::triangle::scaf_system(s_test, L, rhs); + + // Solve + Eigen::SimplicialLDLT> solver; + auto x = solver.compute(L).solve(rhs); + + // Write result to uv_target + Eigen::MatrixXd uv_target = s_test.w_uv; + const int n_v_var = s_test.w_uv.rows() - s_test.frame_ids.size(); + for (int i = 0; i < n_v_var; ++i) + { + int row = i; + if (i >= s_test.v_num) + row += s_test.frame_ids.size(); + + uv_target(row, 0) = x[i]; + uv_target(row, 1) = x[i + n_v_var]; + } + + // Line search + std::function E = + [&s_test](Eigen::MatrixXd &uv) { return igl::triangle::scaf::compute_energy(s_test, uv, true); }; + Eigen::MatrixXi w_T; + igl::cat(1, s_test.m_T, s_test.s_T, w_T); + igl::flip_avoiding_line_search(w_T, s_test.w_uv, uv_target, E, -1); + } + + // Compare both results + REQUIRE(s_test.w_uv == s_ref.w_uv); +} diff --git a/vendor/libigl/tests/include/igl/triangle_triangle_adjacency.cpp b/vendor/libigl/tests/include/igl/triangle_triangle_adjacency.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1cb11a14758a4c94ddf80512e8d9daf321f1186c --- /dev/null +++ b/vendor/libigl/tests/include/igl/triangle_triangle_adjacency.cpp @@ -0,0 +1,39 @@ + +#include +#include +#include + +TEST_CASE("triangle_triangle_adjacency: dot", "[igl]" "[slow]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V; + Eigen::MatrixXi F,TT,TTi; + // Load example mesh: GetParam() will be name of mesh file + igl::read_triangle_mesh(test_common::data_path(param), V, F); + igl::triangle_triangle_adjacency(F,TT,TTi); + REQUIRE (TT.rows() == F.rows()); + REQUIRE (TTi.rows() == F.rows()); + REQUIRE (TT.cols() == F.cols()); + REQUIRE (TTi.cols() == F.cols()); + for(int f = 0;f= 0) + { + REQUIRE (F.rows() > TT(f,c)); + REQUIRE (0 <= TTi(f,c)); + REQUIRE (3 > TTi(f,c)); + REQUIRE (f == TT(TT(f,c),TTi(f,c))); + } + } + } + // REQUIRE (b == a); + // REQUIRE (a==b); + // REQUIRE(a == Approx(b).margin(1e-15)) + // REQUIRE (1e-12 > a); + }; + + test_common::run_test_cases(test_common::manifold_meshes(), test_case); +} diff --git a/vendor/libigl/tests/include/igl/triangulated_grid.cpp b/vendor/libigl/tests/include/igl/triangulated_grid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..52a287261f743accc6dd8f848c367309c7883872 --- /dev/null +++ b/vendor/libigl/tests/include/igl/triangulated_grid.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +TEST_CASE("triangulated_grid: area", "[igl]") +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + const int nx = 4; + const int ny = 7; + igl::triangulated_grid(nx,ny,V,F); + REQUIRE (nx*ny == V.rows()); + REQUIRE (2*(nx-1)*(ny-1) == F.rows()); + Eigen::VectorXd dblA; + igl::doublearea(V,F,dblA); + REQUIRE (2.0 == Approx (dblA.array().sum()).margin(1e-10)); + const Eigen::VectorXd dblAgt = + Eigen::VectorXd::Constant( + 2*(nx-1)*(ny-1), + 1, + 2.0/double(2*(nx-1)*(ny-1))); + test_common::assert_near(dblA,dblAgt,1e-10); +} diff --git a/vendor/libigl/tests/include/igl/unique.cpp b/vendor/libigl/tests/include/igl/unique.cpp new file mode 100644 index 0000000000000000000000000000000000000000..20d3738a1fb94aa7b9ed273e77377bee70ca1168 --- /dev/null +++ b/vendor/libigl/tests/include/igl/unique.cpp @@ -0,0 +1,84 @@ +#include +#include +#include + +TEST_CASE("unique: matrix", "[igl]") +{ + Eigen::VectorXi A(12); + A = (Eigen::VectorXd::Random(A.size(),1).array().abs()*9).cast(); + Eigen::VectorXi C,IA,IC; + igl::unique_rows(A,C,IA,IC); + std::vector inA(A.maxCoeff()+1,false); + for(int i = 0;i inC(inA.size(),false); + // Expect a column vector + REQUIRE (C.cols() == 1); + for(int i = 0;i(); + Eigen::MatrixXi C; + Eigen::VectorXi IA,IC; + igl::unique_rows(A,C,IA,IC); + REQUIRE (C.cols() == A.cols()); + REQUIRE (IC.size() == A.rows()); + REQUIRE (IA.size() == C.rows()); + std::map,bool> inA; + for(int i = 0;i vAi; + igl::matrix_to_list(Ai,vAi); + inA[vAi] = true; + for(int j = 0;j,bool> inC; + for(int i = 0;i vCi; + igl::matrix_to_list(Ci,vCi); + // Should be the first time finding this + REQUIRE (!inC[vCi]); + // Mark as found + inC[vCi] = true; + // Should be something also found in A + REQUIRE (inA[vCi]); + for(int j = 0;j +#include + +TEST_CASE("igl_unique_simplices: duplicate_triangles", "[igl]") +{ + const Eigen::MatrixXi F = (Eigen::MatrixXi(2,3)<<0,1,2,0,1,2).finished(); + + // All possible permutations of the same triangle + for(int di = -1;di<2;di+=2) + { + for(int dj = -1;dj<2;dj+=2) + { + for(int i = 0;i<3;i++) + { + for(int j = 0;j<3;j++) + { + Eigen::MatrixXi Fij = F; + for(int c = 0;c<3;c++) + { + Fij(0,c) = (Fij(0,c)+3+di*i)%3; + Fij(1,c) = (Fij(1,c)+3+dj*j)%3; + } + Eigen::MatrixXi Fu; + Eigen::VectorXi IA,IC; + igl::unique_simplices(Fij,Fu,IA,IC); + // There's only one unique simplex + REQUIRE (1 == Fu.rows()); + } + } + } + } + +} diff --git a/vendor/libigl/tests/include/igl/upsample.cpp b/vendor/libigl/tests/include/igl/upsample.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6864c6883e3e9f916cd68a371e908643d8d2f4ae --- /dev/null +++ b/vendor/libigl/tests/include/igl/upsample.cpp @@ -0,0 +1,53 @@ + +#include +#include + + +TEST_CASE("upsample: single_triangle", "[igl]") +{ + Eigen::MatrixXi NF_groundtruth(4,3); + NF_groundtruth << 0,3,5 ,1,4,3 ,3,4,5 ,4,2,5; + Eigen::MatrixXd NV_groundtruth(6,2); + NV_groundtruth <<0,0 ,1,0 ,0,1 ,0.5,0 ,0.5,0.5 ,0,0.5; + Eigen::MatrixXd S_groundtruth(6,3); + S_groundtruth<<1,0,0 ,0,1,0 ,0,0,1 ,0.5,0.5,0 ,0,0.5,0.5 ,0.5,0,0.5; + + Eigen::MatrixXi F(1,3); + F<<0,1,2; + Eigen::MatrixXd V(3,2); + V<<0,0,1,0,0,1; + Eigen::MatrixXi NF; + Eigen::MatrixXd NV; + Eigen::SparseMatrix S; + igl::upsample(V.rows(),F,S,NF); + test_common::assert_eq(NF_groundtruth,NF); + test_common::assert_eq(S_groundtruth,Eigen::MatrixXd(S)); + igl::upsample(V,F,NV,NF); + test_common::assert_eq(NF_groundtruth,NF); + test_common::assert_eq(NV_groundtruth,NV); +} + +TEST_CASE("upsample: V_comes_first_F_ordering", "[igl]" "[slow]") +{ + const auto test_case = [](const std::string ¶m) + { + Eigen::MatrixXd V,NV; + Eigen::MatrixXi F,NF; + // Load example mesh: GetParam() will be name of mesh file + igl::read_triangle_mesh(test_common::data_path(param), V, F); + igl::upsample(V,F,NV,NF); + REQUIRE (V.rows() <= NV.rows()); + REQUIRE (4*F.rows() == NF.rows()); + // V should be first part of V + test_common::assert_eq(V,NV.topLeftCorner(V.rows(),V.cols())); + // Expect a particular order + for(int f = 0;f +#include + +#include +#include + +#include + +TEST_CASE("writeMSH","[igl]") +{ + Eigen::MatrixXd X; + Eigen::MatrixXi Tri; + Eigen::MatrixXi Tet; + Eigen::VectorXi TriTag; + Eigen::VectorXi TetTag; + + std::vector XFields; + std::vector EFields; + + std::vector XF; + std::vector TriF; + std::vector TetF; + + // load source data + REQUIRE(igl::readMSH(test_common::data_path("sphere_lowres_TMS_1-0001_Magstim_70mm_Fig8_nii_scalar.msh"), + X, Tri, Tet, TriTag, TetTag, XFields, XF, EFields, TriF, TetF)); + + // save check data + REQUIRE(igl::writeMSH("test_binary_sphere_2.msh", + X, Tri, Tet, TriTag, TetTag, XFields, XF, EFields, TriF, TetF)); + + // load again + Eigen::MatrixXd _X; + Eigen::MatrixXi _Tri; + Eigen::MatrixXi _Tet; + Eigen::VectorXi _TriTag; + Eigen::VectorXi _TetTag; + + std::vector _XFields; + std::vector _EFields; + + std::vector _XF; + std::vector _TriF; + std::vector _TetF; + + REQUIRE(igl::readMSH("test_binary_sphere_2.msh", + _X, _Tri, _Tet, _TriTag, _TetTag, _XFields, _XF, _EFields, _TriF, _TetF)); + + REQUIRE(_X.size() == X.size()); + REQUIRE(_Tri.size() == Tri.size()); + REQUIRE(_Tet.size() == Tet.size()); + REQUIRE(_TriTag.size() == TriTag.size()); + REQUIRE(_TetTag.size() == TetTag.size()); + REQUIRE(_XFields.size() == XFields.size()); + REQUIRE(_XF.size() == XF.size()); + REQUIRE(_EFields.size() == EFields.size()); + REQUIRE(_TriF.size() == TriF.size()); + REQUIRE(_TetF.size() == TetF.size()); + + REQUIRE(_X.cols() == 3); + REQUIRE(_X.rows() == (398+4506)); + + REQUIRE(_Tri.cols() == 3); + REQUIRE(_Tri.rows() == 8988); + REQUIRE(_TriTag.rows() == 8988); + + REQUIRE(_Tet.cols() == 4); + REQUIRE(_Tet.rows() == 25937); + REQUIRE(_TetTag.rows() == 25937); + + //make sure field sizes are correct + REQUIRE(_XF.size()==0); + REQUIRE(_TriF.size()==1); + REQUIRE(_TetF.size()==1); + + // normE , scalar field + REQUIRE(_TriF[0].cols()==1); + REQUIRE(_TriF[0].rows()==8988); + + REQUIRE(_TetF[0].cols()==1); + REQUIRE(_TetF[0].rows()==25937); + + // check the contents too + for(size_t i=0;i +#include +#include +#include +#include +#include +#include + +TEST_CASE("writePLY: bunny.ply", "[igl]") +{ + std::ifstream f(test_common::data_path("bunny.ply")); + REQUIRE (f.good()); + f.close(); + + Eigen::MatrixXd V1,N1,UV1,VD1,FD1,ED1; + std::vector Vheader1,Fheader1,Eheader1,comments1; + + Eigen::MatrixXi F1,E1; + + // load test data first + REQUIRE (igl::readPLY(test_common::data_path("bunny.ply"), V1, F1, E1, N1, UV1, VD1,Vheader1, FD1,Fheader1, ED1,Eheader1,comments1)); + + // add more data + Vheader1.push_back("dummy_data"); + Eigen::VectorXd dummy_data(V1.rows()); + for(size_t i=0;i Eheader2; + + //generate edges + igl::edges(F1,E2); + + //generate edge data + Eheader2.push_back("edge_data"); + Eigen::VectorXd edge_data(E2.rows()); + for(size_t i=0;i Vheader,Fheader,Eheader,comments; + + // test that saving preserves all the data + REQUIRE (igl::readPLY("writePLY_test_bunny.ply", V, F, E, N, UV, VD,Vheader, FD,Fheader, ED,Eheader, comments)); + + REQUIRE (V.rows() == 35947); + REQUIRE (V.cols() == 3); + REQUIRE (F.rows() == 69451); + REQUIRE (F.cols() == 3); + + // generated edges + REQUIRE (E.rows() == E2.rows()); + REQUIRE (E.cols() == E2.cols()); + + // no normals or texture coordinates + REQUIRE (N.rows() == 0); + REQUIRE (N.cols() == 0); + REQUIRE (UV.rows() == 0); + REQUIRE (UV.cols() == 0); + + // this bunny have additional data + REQUIRE (VD.rows() == 35947); + REQUIRE (VD.cols() == 3); + + // the dummy column contents check + for(size_t i=0;i Vheader1,Fheader1,Eheader1,comments1; + + Eigen::MatrixXi F1,E1; + + // load test data first + REQUIRE (igl::readPLY(test_common::data_path("bunny.ply"), V1, F1, E1, N1, UV1, VD1,Vheader1, FD1,Fheader1, ED1,Eheader1,comments1)); + + // add more data + Vheader1.push_back("dummy_data"); + Eigen::VectorXf dummy_data(V1.rows()); + for(size_t i=0;i Vheader,Fheader,Eheader,comments; + + // test that saving preserves all the data + REQUIRE (igl::readPLY("writePLY_test_bunny_float.ply", V, F, E, N, UV, VD,Vheader, FD,Fheader, ED,Eheader, comments)); + + REQUIRE (V.rows() == 35947); + REQUIRE (V.cols() == 3); + REQUIRE (F.rows() == 69451); + REQUIRE (F.cols() == 3); + // no edge data + REQUIRE (E.rows() == 0); + REQUIRE (E.cols() == 0); + + // no normals or texture coordinates + REQUIRE (N.rows() == 0); + REQUIRE (N.cols() == 0); + REQUIRE (UV.rows() == 0); + REQUIRE (UV.cols() == 0); + + // this bunny have additonal data + REQUIRE (VD.rows() == 35947); + REQUIRE (VD.cols() == 3); + + // the dummy column contents check + for(size_t i=0;i + + +// TODO: Fix floating point exceptions raised in debug mode before re-enabling this. +// #ifndef NDEBUG +// #ifdef __linux__ +// #include +// #endif +// #endif + +// #ifndef NDEBUG +// #ifdef __linux__ +// void beforeMain (void) __attribute__((constructor)); +// void beforeMain (void) +// { +// feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); +// } +// #endif +// #endif diff --git a/vendor/libigl/tests/test_common.h b/vendor/libigl/tests/test_common.h new file mode 100644 index 0000000000000000000000000000000000000000..7db546e70dccca5e81cda8f84f033069e7de73b3 --- /dev/null +++ b/vendor/libigl/tests/test_common.h @@ -0,0 +1,221 @@ +#pragma once + +// These are not directly used but would otherwise be included in most files. +// Leaving them included here. +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include + + +// Disable lengthy tests in debug mode +#ifdef NDEBUG +#define IGL_DEBUG_OFF "" +#else +#define IGL_DEBUG_OFF "[!hide]" +#endif + + +#include +template<> +struct Catch::StringMaker > +{ + static std::string convert(std::tuple const& t) + { + return + STR("("<(t)<<","<(t)<<","<(t)<<")"); + } +}; +template<> +struct Catch::StringMaker > +{ + static std::string convert(std::tuple const& t) + { + return + STR("("<(t)<<","<(t)<<","<(t)<<")"); + } +}; + + +namespace test_common +{ + template + void run_test_cases(const std::vector ¶ms, Fun test_case) + { + for(const auto &p : params) + { + // Can't use INFO( p ) because we're not sure how to print p + test_case(p); + } + } + + template + void run_test_cases(const std::vector ¶ms, Fun test_case) + { + for(const auto &p : params) + { + INFO( p ); + test_case(p); + } + } + + inline std::vector closed_genus_0_meshes() + { + return + { + "cube.obj", + "decimated-knight.obj", + "boolean_minus_test_cube.obj", + "boolean_minus_test_green.obj", + }; + }; + inline std::vector closed_manifold_meshes() + { + std::vector meshes = closed_genus_0_meshes(); + meshes.insert(meshes.end(), + { + "TinyTorus.obj", + }); + return meshes; + }; + inline std::vector manifold_meshes() + { + std::vector meshes = closed_manifold_meshes(); + meshes.insert(meshes.end(), + { + "bunny.off", + "elephant.off", + "hemisphere.obj", + }); + return meshes; + }; + inline std::vector tet_meshes() + { + return + { + "decimated-knight.mesh" + }; + }; + inline std::vector all_meshes() + { + std::vector meshes = manifold_meshes(); + meshes.insert(meshes.end(), + { + "truck.obj", + }); + return meshes; + }; + inline std::string data_path(std::string s) + { + return std::string(LIBIGL_DATA_DIR) + "/" + s; + }; + + template + void assert_eq( + const Eigen::MatrixBase & A, + const Eigen::MatrixBase & B) + { + // Sizes should match + REQUIRE(A.rows() == B.rows()); + REQUIRE(A.cols() == B.cols()); + for(int i = 0;i Aijv {i,j,A(i,j)}; + std::tuple Bijv {i,j,B(i,j)}; + REQUIRE(Aijv == Bijv); + } + } + } + + template + void assert_neq( + const Eigen::MatrixBase & A, + const Eigen::MatrixBase & B) + { + // Sizes should match + REQUIRE(A.rows() == B.rows()); + REQUIRE(A.cols() == B.cols()); + bool all_equals = true; + for(int i = 0;i + void assert_eq( + const Eigen::SparseMatrix & A, + const Eigen::SparseMatrix & B) + { + // Sizes should match + REQUIRE(A.rows() == B.rows()); + REQUIRE(A.cols() == B.cols()); + Eigen::Matrix AI,AJ; + Eigen::Matrix BI,BJ; + Eigen::Matrix AV; + Eigen::Matrix BV; + // Assumes A and B are in same Major Ordering + igl::find(A,AI,AJ,AV); + igl::find(B,BI,BJ,BV); + // This doesn't generalized to assert_near nicely, and it makes it hard to + // tell which entries are different: + assert_eq(AI,BI); + assert_eq(AJ,BJ); + assert_eq(AV,BV); + } + + template + void assert_near( + const Eigen::MatrixBase & A, + const Eigen::MatrixBase & B, + const EpsType & eps) + { + // Sizes should match + REQUIRE(A.rows() == B.rows()); + REQUIRE(A.cols() == B.cols()); + for(int i = 0;i Aijv {i,j,A(i,j)}; + // std::tuple Bijv {i,j,B(i,j)+eps}; + REQUIRE(A(i,j) < B(i,j)+eps); + } + { + // std::tuple Aijv {i,j,A(i,j)+eps}; + // std::tuple Bijv {i,j,B(i,j)}; + REQUIRE(A(i,j)+eps > B(i,j)); + } + } + } + } + +} diff --git a/vendor/libigl/tutorial/101_FileIO/main.cpp b/vendor/libigl/tutorial/101_FileIO/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c4b10e9f3029ed15a63185f0cffe0f399f344959 --- /dev/null +++ b/vendor/libigl/tutorial/101_FileIO/main.cpp @@ -0,0 +1,19 @@ +#include +#include +#include + +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +int main(int argc, char *argv[]) +{ + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/cube.off", V, F); + + // Print the vertices and faces matrices + std::cout << "Vertices: " << std::endl << V << std::endl; + std::cout << "Faces: " << std::endl << F << std::endl; + + // Save the mesh in OBJ format + igl::writeOBJ("cube.obj",V,F); +} diff --git a/vendor/libigl/tutorial/102_DrawMesh/main.cpp b/vendor/libigl/tutorial/102_DrawMesh/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3bc172a2f4221772ac004242db070e12313d54d7 --- /dev/null +++ b/vendor/libigl/tutorial/102_DrawMesh/main.cpp @@ -0,0 +1,16 @@ +#include +#include + +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +int main(int argc, char *argv[]) +{ + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/bunny.off", V, F); + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/103_Events/main.cpp b/vendor/libigl/tutorial/103_Events/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..088fe468ef623e82fbfa8833dc37cfe7fb41f4a9 --- /dev/null +++ b/vendor/libigl/tutorial/103_Events/main.cpp @@ -0,0 +1,49 @@ +#include +#include +#include + +Eigen::MatrixXd V1,V2; +Eigen::MatrixXi F1,F2; + +// This function is called every time a keyboard button is pressed +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + std::cout<<"Key: "< +#include + +Eigen::MatrixXd V; +Eigen::MatrixXi F; +Eigen::MatrixXd C; + +int main(int argc, char *argv[]) +{ + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/screwdriver.off", V, F); + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + + // Use the (normalized) vertex positions as colors + C = + (V.rowwise() - V.colwise().minCoeff()).array().rowwise()/ + (V.colwise().maxCoeff() - V.colwise().minCoeff()).array(); + + // Add per-vertex colors + viewer.data().set_colors(C); + + // Launch the viewer + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/105_Overlays/main.cpp b/vendor/libigl/tutorial/105_Overlays/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1a5bf27b9dcfe53a74c7290fa4fb71352d805a00 --- /dev/null +++ b/vendor/libigl/tutorial/105_Overlays/main.cpp @@ -0,0 +1,83 @@ +#include +#include +#include +#include +#include + +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +int main(int argc, char *argv[]) +{ + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/bunny.off", V, F); + + // Find the bounding box + Eigen::Vector3d m = V.colwise().minCoeff(); + Eigen::Vector3d M = V.colwise().maxCoeff(); + + // Corners of the bounding box + Eigen::MatrixXd V_box(8,3); + V_box << + m(0), m(1), m(2), + M(0), m(1), m(2), + M(0), M(1), m(2), + m(0), M(1), m(2), + m(0), m(1), M(2), + M(0), m(1), M(2), + M(0), M(1), M(2), + m(0), M(1), M(2); + + // Edges of the bounding box + Eigen::MatrixXi E_box(12,2); + E_box << + 0, 1, + 1, 2, + 2, 3, + 3, 0, + 4, 5, + 5, 6, + 6, 7, + 7, 4, + 0, 4, + 1, 5, + 2, 6, + 7 ,3; + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + + // Plot the corners of the bounding box as points + viewer.data().add_points(V_box,Eigen::RowVector3d(1,0,0)); + + // Plot the edges of the bounding box + for (unsigned i=0;i +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/bunny.off", V, F); + + // Init the viewer + igl::opengl::glfw::Viewer viewer; + + // Attach a menu plugin + igl::opengl::glfw::imgui::ImGuiPlugin plugin; + viewer.plugins.push_back(&plugin); + igl::opengl::glfw::imgui::ImGuiMenu menu; + plugin.widgets.push_back(&menu); + + // Customize the menu + double doubleVariable = 0.1f; // Shared between two menus + + // Add content to the default menu window + menu.callback_draw_viewer_menu = [&]() + { + // Draw parent menu content + menu.draw_viewer_menu(); + + // Add new group + if (ImGui::CollapsingHeader("New Group", ImGuiTreeNodeFlags_DefaultOpen)) + { + // Expose variable directly ... + ImGui::InputDouble("double", &doubleVariable, 0, 0, "%.4f"); + + // ... or using a custom callback + static bool boolVariable = true; + if (ImGui::Checkbox("bool", &boolVariable)) + { + // do something + std::cout << "boolVariable: " << std::boolalpha << boolVariable << std::endl; + } + + // Expose an enumeration type + enum Orientation { Up=0, Down, Left, Right }; + static Orientation dir = Up; + ImGui::Combo("Direction", (int *)(&dir), "Up\0Down\0Left\0Right\0\0"); + + // We can also use a std::vector defined dynamically + static int num_choices = 3; + static std::vector choices; + static int idx_choice = 0; + if (ImGui::InputInt("Num letters", &num_choices)) + { + num_choices = std::max(1, std::min(26, num_choices)); + } + if (num_choices != (int) choices.size()) + { + choices.resize(num_choices); + for (int i = 0; i < num_choices; ++i) + choices[i] = std::string(1, 'A' + i); + if (idx_choice >= num_choices) + idx_choice = num_choices - 1; + } + ImGui::Combo("Letter", &idx_choice, choices); + + // Add a button + if (ImGui::Button("Print Hello", ImVec2(-1,0))) + { + std::cout << "Hello\n"; + } + } + }; + + // Draw additional windows + menu.callback_draw_custom_window = [&]() + { + // Define next window position + size + ImGui::SetNextWindowPos(ImVec2(180.f * menu.menu_scaling(), 10), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(200, 160), ImGuiCond_FirstUseEver); + ImGui::Begin( + "New Window", nullptr, + ImGuiWindowFlags_NoSavedSettings + ); + + // Expose the same variable directly ... + ImGui::PushItemWidth(-80); + ImGui::DragScalar("double", ImGuiDataType_Double, &doubleVariable, 0.1, 0, 0, "%.4f"); + ImGui::PopItemWidth(); + + static std::string str = "bunny"; + ImGui::InputText("Name", str); + + ImGui::End(); + }; + + // Plot the mesh + viewer.data().set_mesh(V, F); + viewer.data().add_label(viewer.data().V.row(0) + viewer.data().V_normals.row(0).normalized()*0.005, "Hello World!"); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/107_MultipleMeshes/main.cpp b/vendor/libigl/tutorial/107_MultipleMeshes/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4fef7d5248c70352f230d3d4bfcae0ac350ebf11 --- /dev/null +++ b/vendor/libigl/tutorial/107_MultipleMeshes/main.cpp @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +int main(int argc, char * argv[]) +{ + igl::opengl::glfw::Viewer viewer; + const auto names = + {"cube.obj","sphere.obj","xcylinder.obj","ycylinder.obj","zcylinder.obj"}; + std::map colors; + int last_selected = -1; + for(const auto & name : names) + { + viewer.load_mesh_from_file(std::string(TUTORIAL_SHARED_PATH) + "/" + name); + colors.emplace(viewer.data().id, 0.5*Eigen::RowVector3d::Random().array() + 0.5); + } + + viewer.callback_key_down = + [&](igl::opengl::glfw::Viewer &, unsigned int key, int mod) + { + if(key == GLFW_KEY_BACKSPACE) + { + int old_id = viewer.data().id; + if (viewer.erase_mesh(viewer.selected_data_index)) + { + colors.erase(old_id); + last_selected = -1; + } + return true; + } + return false; + }; + + // Refresh selected mesh colors + viewer.callback_pre_draw = + [&](igl::opengl::glfw::Viewer &) + { + if (last_selected != viewer.selected_data_index) + { + for (auto &data : viewer.data_list) + { + data.set_colors(colors[data.id]); + } + viewer.data_list[viewer.selected_data_index].set_colors(Eigen::RowVector3d(0.9,0.1,0.1)); + last_selected = viewer.selected_data_index; + } + return false; + }; + + viewer.launch(); + return EXIT_SUCCESS; +} diff --git a/vendor/libigl/tutorial/108_MultipleViews/main.cpp b/vendor/libigl/tutorial/108_MultipleViews/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..51c190fff64b3bcebdbb3df61e8aacdb736abf22 --- /dev/null +++ b/vendor/libigl/tutorial/108_MultipleViews/main.cpp @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include + +int main(int argc, char * argv[]) +{ + igl::opengl::glfw::Viewer viewer; + + viewer.load_mesh_from_file(std::string(TUTORIAL_SHARED_PATH) + "/cube.obj"); + viewer.load_mesh_from_file(std::string(TUTORIAL_SHARED_PATH) + "/sphere.obj"); + + unsigned int left_view, right_view; + int cube_id = viewer.data_list[0].id; + int sphere_id = viewer.data_list[1].id; + viewer.callback_init = [&](igl::opengl::glfw::Viewer &) + { + viewer.core().viewport = Eigen::Vector4f(0, 0, 640, 800); + left_view = viewer.core_list[0].id; + right_view = viewer.append_core(Eigen::Vector4f(640, 0, 640, 800)); + return false; + }; + + viewer.callback_key_down = [&](igl::opengl::glfw::Viewer &, unsigned int key, int mod) + { + if(key == GLFW_KEY_SPACE) + { + // By default, when a core is appended, all loaded meshes will be displayed in that core. + // Displaying can be controlled by calling viewer.data().set_visible(). + viewer.data(cube_id).set_visible(false, left_view); + viewer.data(sphere_id).set_visible(false, right_view); + } + return false; + }; + + viewer.callback_post_resize = [&](igl::opengl::glfw::Viewer &v, int w, int h) { + v.core( left_view).viewport = Eigen::Vector4f(0, 0, w / 2, h); + v.core(right_view).viewport = Eigen::Vector4f(w / 2, 0, w - (w / 2), h); + return true; + }; + + viewer.launch(); + return EXIT_SUCCESS; +} diff --git a/vendor/libigl/tutorial/109_ImGuizmo/main.cpp b/vendor/libigl/tutorial/109_ImGuizmo/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..27d497c12ddf00e8ab5781a488d98e78539c6bdd --- /dev/null +++ b/vendor/libigl/tutorial/109_ImGuizmo/main.cpp @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + // Load a mesh from file + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(argc>1?argv[1]: TUTORIAL_SHARED_PATH "/cow.off",V,F); + // Set up viewer + igl::opengl::glfw::Viewer vr; + vr.data().set_mesh(V,F); + + igl::opengl::glfw::imgui::ImGuiPlugin imgui_plugin; + vr.plugins.push_back(&imgui_plugin); + + // Add a 3D gizmo plugin + igl::opengl::glfw::imgui::ImGuizmoWidget gizmo; + imgui_plugin.widgets.push_back(&gizmo); + // Initialize ImGuizmo at mesh centroid + gizmo.T.block(0,3,3,1) = + 0.5*(V.colwise().maxCoeff() + V.colwise().minCoeff()).transpose().cast(); + // Update can be applied relative to this remembered initial transform + const Eigen::Matrix4f T0 = gizmo.T; + // Attach callback to apply imguizmo's transform to mesh + gizmo.callback = [&](const Eigen::Matrix4f & T) + { + const Eigen::Matrix4d TT = (T*T0.inverse()).cast().transpose(); + vr.data().set_vertices( + (V.rowwise().homogeneous()*TT).rowwise().hnormalized()); + vr.data().compute_normals(); + }; + // Maya-style keyboard shortcuts for operation + vr.callback_key_pressed = [&](decltype(vr) &,unsigned int key, int mod) + { + switch(key) + { + case ' ': gizmo.visible = !gizmo.visible; return true; + case 'W': case 'w': gizmo.operation = ImGuizmo::TRANSLATE; return true; + case 'E': case 'e': gizmo.operation = ImGuizmo::ROTATE; return true; + case 'R': case 'r': gizmo.operation = ImGuizmo::SCALE; return true; + } + return false; + }; + + igl::opengl::glfw::imgui::ImGuiMenu menu; + imgui_plugin.widgets.push_back(&menu); + + std::cout< +#include +#include + +#include +#include + + +Eigen::MatrixXd X,B; +Eigen::MatrixXi Tri; +Eigen::MatrixXi Tet; +Eigen::VectorXi TriTag; +Eigen::VectorXi TetTag; + +Eigen::VectorXd D; + +std::vector XFields; +std::vector EFields; + +std::vector XF; +std::vector TriF; +std::vector TetF; + + +// This function is called every time a keyboard button is pressed +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + using namespace std; + using namespace Eigen; + + if (key >= '1' && key <= '9') + { + double t = double((key - '1')+1) / 9.0; + + VectorXd v = B.col(2).array() - B.col(2).minCoeff(); + v /= v.col(0).maxCoeff(); + + vector s; + + for (unsigned i=0; i(t-0.1)) // select a thick slab + s.push_back(i); + + MatrixXd V_temp(s.size()*4,3); + MatrixXi F_temp(s.size()*4,3); + VectorXd D_temp(s.size()*4); + + for (unsigned i=0; i 1 ? argv[1] : TUTORIAL_SHARED_PATH "/hand.msh", X, Tri, Tet, TriTag, TetTag, XFields, XF, EFields, TriF, TetF); + + for(auto i:EFields) + std::cout<(); + + // Compute barycenters + igl::barycenter(X, Tet, B); + + // Plot the generated mesh + igl::opengl::glfw::Viewer viewer; + + viewer.callback_key_down = &key_down; + key_down(viewer,'5',0); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/111_MatCap/main.cpp b/vendor/libigl/tutorial/111_MatCap/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9830940b0992117c9ebb43a7a0688b7443e8f23e --- /dev/null +++ b/vendor/libigl/tutorial/111_MatCap/main.cpp @@ -0,0 +1,19 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + igl::opengl::glfw::Viewer v; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh( + argc>1?argv[1]: TUTORIAL_SHARED_PATH "/armadillo.obj",V,F); + Eigen::Matrix R,G,B,A; + igl::png::readPNG(argc>2?argv[2]: TUTORIAL_SHARED_PATH "/jade.png",R,G,B,A); + v.data().set_mesh(V,F); + v.data().set_texture(R,G,B,A); + v.data().use_matcap = true; + v.data().show_lines = false; + v.launch(); +} diff --git a/vendor/libigl/tutorial/112_Selection/main.cpp b/vendor/libigl/tutorial/112_Selection/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2b3bcbb2edb911b641d6faaf46865afff73008d5 --- /dev/null +++ b/vendor/libigl/tutorial/112_Selection/main.cpp @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include + +#include +#include + +int main(int argc, char *argv[]) +{ + // Inline mesh of a cube + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh( + argc>1?argv[1]: TUTORIAL_SHARED_PATH "/armadillo.obj",V,F); + + // Plot the mesh + igl::opengl::glfw::Viewer vr; + igl::opengl::glfw::imgui::ImGuiPlugin imgui_plugin; + vr.plugins.push_back(&imgui_plugin); + igl::opengl::glfw::imgui::SelectionWidget widget; + imgui_plugin.widgets.push_back(&widget); + + Eigen::VectorXd W = Eigen::VectorXd::Zero(V.rows()); + Eigen::Array and_visible = + Eigen::Array::Zero(V.rows()); + const Eigen::MatrixXd CM = (Eigen::MatrixXd(2,3)<< + 0.3,0.3,0.5, + 255.0/255.0,228.0/255.0,58.0/255.0).finished(); + bool only_visible = false; + const auto update = [&]() + { + const bool was_face_based = vr.data().face_based; + Eigen::VectorXd S = W; + if(only_visible) { S.array() *= and_visible; } + vr.data().set_data(S,0,1,igl::COLOR_MAP_TYPE_PLASMA,2); + vr.data().face_based = was_face_based; + vr.data().set_colormap(CM); + }; + igl::AABB tree; + tree.init(V,F); + widget.callback = [&]() + { + screen_space_selection(V,F,tree,vr.core().view,vr.core().proj,vr.core().viewport,widget.L,W,and_visible); + update(); + }; + vr.callback_key_pressed = [&](decltype(vr) &,unsigned int key, int mod) + { + switch(key) + { + case ' ': only_visible = !only_visible; update(); return true; + case 'D': case 'd': W.setZero(); update(); return true; + } + return false; + }; + std::cout<(); + vr.data().line_color.head(3) = (CM.row(0).head(3)*0.5).cast(); + vr.data().show_lines = F.rows() < 20000; + update(); + vr.launch(); +} diff --git a/vendor/libigl/tutorial/201_Normals/main.cpp b/vendor/libigl/tutorial/201_Normals/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..76996518b0abd6a0d13611f8d83f0fbc7ef04606 --- /dev/null +++ b/vendor/libigl/tutorial/201_Normals/main.cpp @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +#include + +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +Eigen::MatrixXd N_vertices; +Eigen::MatrixXd N_faces; +Eigen::MatrixXd N_corners; + + +// This function is called every time a keyboard button is pressed +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + switch(key) + { + case '1': + viewer.data().set_normals(N_faces); + return true; + case '2': + viewer.data().set_normals(N_vertices); + return true; + case '3': + viewer.data().set_normals(N_corners); + return true; + default: break; + } + return false; +} + +int main(int argc, char *argv[]) +{ + // Load a mesh in OFF format + igl::read_triangle_mesh( + argc>1?argv[1]: TUTORIAL_SHARED_PATH "/fandisk.off",V,F); + + // Compute per-face normals + igl::per_face_normals(V,F,N_faces); + + // Compute per-vertex normals + igl::per_vertex_normals(V,F,N_vertices); + + // Compute per-corner normals, |dihedral angle| > 20 degrees --> crease + igl::per_corner_normals(V,F,20,N_corners); + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.callback_key_down = &key_down; + viewer.data().show_lines = false; + viewer.data().set_mesh(V, F); + viewer.data().set_normals(N_faces); + std::cout<< + "Press '1' for per-face normals."< +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + MatrixXd V; + MatrixXi F; + igl::readOFF(TUTORIAL_SHARED_PATH "/bumpy.off",V,F); + + VectorXd K; + // Compute integral of Gaussian curvature + igl::gaussian_curvature(V,F,K); + // Compute mass matrix + SparseMatrix M,Minv; + igl::massmatrix(V,F,igl::MASSMATRIX_TYPE_DEFAULT,M); + igl::invert_diag(M,Minv); + // Divide by area to get integral average + K = (Minv*K).eval(); + + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().set_data(K); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/203_CurvatureDirections/main.cpp b/vendor/libigl/tutorial/203_CurvatureDirections/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8720487313eef00eeb97858b84c4bf9dfd1c2674 --- /dev/null +++ b/vendor/libigl/tutorial/203_CurvatureDirections/main.cpp @@ -0,0 +1,64 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + std::string filename = TUTORIAL_SHARED_PATH "/fertility.off"; + if(argc>1) + { + filename = argv[1]; + } + // Load a mesh in OFF format + igl::read_triangle_mesh(filename, V, F); + + // Alternative discrete mean curvature + MatrixXd HN; + SparseMatrix L,M,Minv; + igl::cotmatrix(V,F,L); + igl::massmatrix(V,F,igl::MASSMATRIX_TYPE_VORONOI,M); + igl::invert_diag(M,Minv); + // Laplace-Beltrami of position + HN = -Minv*(L*V); + // Extract magnitude as mean curvature + VectorXd H = HN.rowwise().norm(); + + // Compute curvature directions via quadric fitting + MatrixXd PD1,PD2; + VectorXd PV1,PV2; + igl::principal_curvature(V,F,PD1,PD2,PV1,PV2); + // mean curvature + H = 0.5*(PV1+PV2); + + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + + viewer.data().set_data(H); + + // Average edge length for sizing + const double avg = igl::avg_edge_length(V,F); + + // Draw a red segment parallel to the maximal curvature direction + const RowVector3d red(0.8,0.2,0.2),blue(0.2,0.2,0.8); + viewer.data().add_edges(V + PD1*avg, V - PD1*avg, red); + + // Draw a blue segment parallel to the minimal curvature direction + viewer.data().add_edges(V + PD2*avg, V - PD2*avg, blue); + + // Hide wireframe + viewer.data().show_lines = false; + + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/204_Gradient/main.cpp b/vendor/libigl/tutorial/204_Gradient/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..920f526d5feebf569dec1f020231d8379c7bb36c --- /dev/null +++ b/vendor/libigl/tutorial/204_Gradient/main.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include +#include + +#include + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + MatrixXd V; + MatrixXi F; + + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/cheburashka.off", V, F); + + // Read scalar function values from a file, U: #V by 1 + VectorXd U; + igl::readDMAT(TUTORIAL_SHARED_PATH "/cheburashka-scalar.dmat",U); + + // Compute gradient operator: #F*3 by #V + SparseMatrix G; + igl::grad(V,F,G); + + // Compute gradient of U + MatrixXd GU = Map((G*U).eval().data(),F.rows(),3); + // Compute gradient magnitude + const VectorXd GU_mag = GU.rowwise().norm(); + + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + + viewer.data().set_data(U); + + // Average edge length divided by average gradient (for scaling) + const double max_size = igl::avg_edge_length(V,F) / GU_mag.mean(); + // Draw a black segment in direction of gradient at face barycenters + MatrixXd BC; + igl::barycenter(V,F,BC); + const RowVector3d black(0,0,0); + viewer.data().add_edges(BC,BC+max_size*GU, black); + + // Hide wireframe + viewer.data().show_lines = false; + + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/205_Laplacian/main.cpp b/vendor/libigl/tutorial/205_Laplacian/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a9a3dee8ff9fc309a3b5db1c6732a7729a49a7bb --- /dev/null +++ b/vendor/libigl/tutorial/205_Laplacian/main.cpp @@ -0,0 +1,104 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +Eigen::MatrixXd V,U; +Eigen::MatrixXi F; +Eigen::SparseMatrix L; +igl::opengl::glfw::Viewer viewer; + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/cow.off", V, F); + + // Compute Laplace-Beltrami operator: #V by #V + igl::cotmatrix(V,F,L); + + // Alternative construction of same Laplacian + SparseMatrix G,K; + // Gradient/Divergence + igl::grad(V,F,G); + // Diagonal per-triangle "mass matrix" + VectorXd dblA; + igl::doublearea(V,F,dblA); + // Place areas along diagonal #dim times + const auto & T = 1.*(dblA.replicate(3,1)*0.5).asDiagonal(); + // Laplacian K built as discrete divergence of gradient or equivalently + // discrete Dirichelet energy Hessian + K = -G.transpose() * T * G; + cout<<"|K-L|: "<<(K-L).norm()<bool + { + switch(key) + { + case 'r': + case 'R': + U = V; + break; + case ' ': + { + // Recompute just mass matrix on each step + SparseMatrix M; + igl::massmatrix(U,F,igl::MASSMATRIX_TYPE_BARYCENTRIC,M); + // Solve (M-delta*L) U = M*U + const auto & S = (M - 0.001*L); + Eigen::SimplicialLLT > solver(S); + assert(solver.info() == Eigen::Success); + U = solver.solve(M*U).eval(); + // Compute centroid and subtract (also important for numerics) + VectorXd dblA; + igl::doublearea(U,F,dblA); + double area = 0.5*dblA.sum(); + MatrixXd BC; + igl::barycenter(U,F,BC); + RowVector3d centroid(0,0,0); + for(int i = 0;i +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::opengl::glfw::Viewer viewer; + // Load a mesh in OFF format + igl::readOBJ(TUTORIAL_SHARED_PATH "/armadillo.obj", V, F); + + const auto update_distance = [&](const int vid) + { + Eigen::VectorXi VS,FS,VT,FT; + // The selected vertex is the source + VS.resize(1); + VS << vid; + // All vertices are the targets + VT.setLinSpaced(V.rows(),0,V.rows()-1); + Eigen::VectorXd d; + std::cout<<"Computing geodesic distance to vertex "<bool + { + int fid; + Eigen::Vector3f bc; + // Cast a ray in the view direction starting from the mouse position + double x = viewer.current_mouse_x; + double y = viewer.core().viewport(3) - viewer.current_mouse_y; + if(igl::unproject_onto_mesh( + Eigen::Vector2f(x,y), + viewer.core().view, + viewer.core().proj, + viewer.core().viewport, + V, + F, + fid, + bc)) + { + int max; + bc.maxCoeff(&max); + int vid = F(fid,max); + update_distance(vid); + return true; + } + return false; + }; + viewer.data().set_mesh(V,F); + viewer.data().show_lines = false; + + cout << "Click on mesh to define new source.\n" << std::endl; + update_distance(0); + return viewer.launch(); +} diff --git a/vendor/libigl/tutorial/207_PolygonLaplacian/main.cpp b/vendor/libigl/tutorial/207_PolygonLaplacian/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9efcaa0d89a902101bd10f8c88006834201af60f --- /dev/null +++ b/vendor/libigl/tutorial/207_PolygonLaplacian/main.cpp @@ -0,0 +1,122 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + + // Load a mesh in OBJ format + Eigen::MatrixXd OV,V; + Eigen::VectorXi I,C; + igl::readOBJ( + argc<=1?TUTORIAL_SHARED_PATH "/cylinder.obj" :argv[1],V,I,C); + // center + V.rowwise() -= V.colwise().mean(); + OV = V; + // Convert polygon representation to triangles + Eigen::MatrixXi F; + Eigen::VectorXi J; + igl::polygons_to_triangles(I,C,F,J); + Eigen::SparseMatrix pL,pM,pP; + igl::cotmatrix(V,I,C,pL,pM,pP); + Eigen::SparseMatrix tL,tM; + igl::cotmatrix(V,F,tL); + igl::massmatrix(V,F,igl::MASSMATRIX_TYPE_DEFAULT,tM); + const double bbd = (V.colwise().maxCoeff()- V.colwise().minCoeff()).norm(); + igl::opengl::glfw::Viewer vr; + vr.data_list[0].set_mesh(V,F); + vr.append_mesh(); + vr.selected_data_index = 0; + vr.data_list[0].set_face_based(true); + Eigen::MatrixXi E; + igl::edges(I,C,E); + bool show_edges = true; + bool use_poly = true; + Eigen::MatrixXd pHN; + Eigen::MatrixXd tHN; + const auto update = [&]() + { + // why does windows need this Eigen::VectorXd(...) ? + pHN = (pL*V).array().colwise() / Eigen::VectorXd(pM.diagonal()).array(); + tHN = (tL*V).array().colwise() / Eigen::VectorXd(tM.diagonal()).array(); + pHN *= 1.0/pHN.rowwise().norm().maxCoeff(); + tHN *= 1.0/tHN.rowwise().norm().maxCoeff(); + const auto was_face_based = vr.data_list[0].face_based; + Eigen::MatrixXd QV(V.rows()*2,3); + QV.topRows(V.rows()) = V; + if(use_poly) + { + printf("using polygon Laplacian\n"); + QV.bottomRows(V.rows()) = V-pHN; + }else + { + printf("using triangle Laplacian\n"); + QV.bottomRows(V.rows()) = V-tHN; + } + Eigen::MatrixXi QE(V.rows(),2); + for(int i = 0;i _1,_2; + igl::cotmatrix(V,I,C,_1,pM,_2); + igl::massmatrix(V,F,igl::MASSMATRIX_TYPE_DEFAULT,tM); + V *= sqrt(original_area / pM.diagonal().sum()); + }; + const auto cmcf_step = [&]() + { + const Eigen::SparseMatrix S = + use_poly? ((pM) - 0.05*(pL)): ((tM) - 0.05*(tL)); + const Eigen::MatrixXd rhs = use_poly? pM*V : tM*V; + Eigen::SimplicialLLT > solver(S); + assert(solver.info() == Eigen::Success); + V = solver.solve(rhs).eval(); + // recompute just mass matrices + recompute_M(); + // center + V.rowwise() -= V.colwise().mean(); + vr.data_list[0].set_vertices(V); + vr.data_list[0].compute_normals(); + update(); + }; + vr.callback_key_pressed = [&](decltype(vr) &,unsigned int key, int mod) + { + switch(key) + { + case ' ': cmcf_step(); return true; + case 'R': case 'r': V=OV;recompute_M();vr.data_list[0].set_vertices(V);vr.data_list[0].compute_normals(); update();return true; + case 'P': case 'p': use_poly=!use_poly; update();return true; + case 'L': case 'l': show_edges=!show_edges; update();return true; + } + return false; + }; + update(); + vr.launch(); +} diff --git a/vendor/libigl/tutorial/301_Slice/main.cpp b/vendor/libigl/tutorial/301_Slice/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..521ffc525530107c5398ba073b3e2dd9d2bbf0f6 --- /dev/null +++ b/vendor/libigl/tutorial/301_Slice/main.cpp @@ -0,0 +1,40 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + MatrixXd V; + MatrixXi F; + igl::readOFF(TUTORIAL_SHARED_PATH "/decimated-knight.off",V,F); + + // 100 random indices into rows of F + VectorXi I; + igl::floor((0.5*(VectorXd::Random(100,1).array()+1.)*F.rows()).eval(),I); + + // 50 random indices into rows of I + VectorXi J; + igl::floor((0.5*(VectorXd::Random(50,1).array()+1.)*I.rows()).eval(),J); + + // K = I(J); + VectorXi K; + igl::slice(I,J,K); + + // default green for all faces + MatrixXd C = RowVector3d(0.4,0.8,0.3).replicate(F.rows(),1); + // Red for each in K + MatrixXd R = RowVector3d(1.0,0.3,0.3).replicate(K.rows(),1); + // C(K,:) = R + igl::slice_into(R,K,1,C); + + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().set_colors(C); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/302_Sort/main.cpp b/vendor/libigl/tutorial/302_Sort/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..78dab20f020f3fb8ef9dba2124dff389967a59a1 --- /dev/null +++ b/vendor/libigl/tutorial/302_Sort/main.cpp @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + MatrixXd V; + MatrixXi F; + igl::readOFF(TUTORIAL_SHARED_PATH "/decimated-knight.off",V,F); + + // Sort barycenters lexicographically + MatrixXd BC,sorted_BC; + igl::barycenter(V,F,BC); + VectorXi I,J; + // sorted_BC = BC(I,:) + igl::sortrows(BC,true,sorted_BC,I); + // Get sorted "place" from sorted indices + J.resize(I.rows()); + // J(I) = 1:numel(I) + igl::slice_into(igl::colon(0,I.size()-1),I,J); + + // Pseudo-color based on sorted place + MatrixXd C; + igl::jet(J,true,C); + + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().set_colors(C); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/303_LaplaceEquation/main.cpp b/vendor/libigl/tutorial/303_LaplaceEquation/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..98bee35cb58032c822a5e26f79e20e3244d3f539 --- /dev/null +++ b/vendor/libigl/tutorial/303_LaplaceEquation/main.cpp @@ -0,0 +1,68 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + MatrixXd V; + MatrixXi F; + igl::readOFF(TUTORIAL_SHARED_PATH "/camelhead.off",V,F); + // Find boundary edges + MatrixXi E; + igl::boundary_facets(F,E); + // Find boundary vertices + VectorXi b,IA,IC; + igl::unique(E,b,IA,IC); + // List of all vertex indices + VectorXi all,in; + igl::colon(0,V.rows()-1,all); + // List of interior indices + igl::setdiff(all,b,in,IA); + + // Construct and slice up Laplacian + SparseMatrix L,L_in_in,L_in_b; + igl::cotmatrix(V,F,L); + igl::slice(L,in,in,L_in_in); + igl::slice(L,in,b,L_in_b); + + // Dirichlet boundary conditions from z-coordinate + VectorXd bc; + VectorXd Z = V.col(2); + igl::slice(Z,b,bc); + + // Solve PDE + SimplicialLLT > solver(-L_in_in); + VectorXd Z_in = solver.solve(L_in_b*bc); + // slice into solution + igl::slice_into(Z_in,in,Z); + + // Alternative, short hand + igl::min_quad_with_fixed_data mqwf; + // Linear term is 0 + VectorXd B = VectorXd::Zero(V.rows(),1); + // Empty constraints + VectorXd Beq; + SparseMatrix Aeq; + // Our cotmatrix is _negative_ definite, so flip sign + igl::min_quad_with_fixed_precompute((-L).eval(),b,Aeq,true,mqwf); + igl::min_quad_with_fixed_solve(mqwf,B,bc,Beq,Z); + + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().show_lines = false; + viewer.data().set_data(Z); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/304_LinearEqualityConstraints/main.cpp b/vendor/libigl/tutorial/304_LinearEqualityConstraints/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..64c4f472a2e0f2837fe782049ddbaeb6b973fbb9 --- /dev/null +++ b/vendor/libigl/tutorial/304_LinearEqualityConstraints/main.cpp @@ -0,0 +1,89 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + MatrixXd V; + MatrixXi F; + igl::readOFF(TUTORIAL_SHARED_PATH "/cheburashka.off",V,F); + + // Two fixed points + VectorXi b(2,1); + // Left hand, left foot + b<<4331,5957; + VectorXd bc(2,1); + bc<<1,-1; + + // Construct Laplacian and mass matrix + SparseMatrix L,M,Minv,Q; + igl::cotmatrix(V,F,L); + igl::massmatrix(V,F,igl::MASSMATRIX_TYPE_VORONOI,M); + igl::invert_diag(M,Minv); + // Bi-Laplacian + Q = L * (Minv * L); + // Zero linear term + VectorXd B = VectorXd::Zero(V.rows(),1); + + VectorXd Z,Z_const; + { + // Alternative, short hand + igl::min_quad_with_fixed_data mqwf; + // Empty constraints + VectorXd Beq; + SparseMatrix Aeq; + igl::min_quad_with_fixed_precompute(Q,b,Aeq,true,mqwf); + igl::min_quad_with_fixed_solve(mqwf,B,bc,Beq,Z); + } + + { + igl::min_quad_with_fixed_data mqwf; + // Constraint forcing difference of two points to be 0 + SparseMatrix Aeq(1,V.rows()); + // Right hand, right foot + Aeq.insert(0,6074) = 1; + Aeq.insert(0,6523) = -1; + Aeq.makeCompressed(); + VectorXd Beq(1,1); + Beq(0) = 0; + igl::min_quad_with_fixed_precompute(Q,b,Aeq,true,mqwf); + igl::min_quad_with_fixed_solve(mqwf,B,bc,Beq,Z_const); + } + + // Use same color axes + const double min_z = std::min(Z.minCoeff(),Z_const.minCoeff()); + const double max_z = std::max(Z.maxCoeff(),Z_const.maxCoeff()); + + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().show_lines = false; + viewer.data().set_data(Z,min_z,max_z); + + viewer.callback_key_down = + [&Z,&Z_const,&min_z,&max_z](igl::opengl::glfw::Viewer& viewer,unsigned char key,int mod)->bool + { + if(key == ' ') + { + static bool toggle = true; + viewer.data().set_data(toggle?Z_const:Z,min_z,max_z); + toggle = !toggle; + return true; + }else + { + return false; + } + }; + cout<< + "Press [space] to toggle between unconstrained and constrained."< +#include +#include +#include +#include +#include +#include +#include +#include +#include + +Eigen::VectorXi b; +Eigen::VectorXd B,bc,lx,ux,Beq,Bieq,Z; +Eigen::SparseMatrix Q,Aeq,Aieq; + +void solve(igl::opengl::glfw::Viewer &viewer) +{ + using namespace std; + igl::active_set_params as; + as.max_iter = 8; + igl::active_set(Q,B,b,bc,Aeq,Beq,Aieq,Bieq,lx,ux,as,Z); + viewer.data().set_data(Z); +} + +bool key_down(igl::opengl::glfw::Viewer &viewer, unsigned char key, int mod) +{ + switch(key) + { + case '.': + Beq(0) *= 2.0; + solve(viewer); + return true; + case ',': + Beq(0) /= 2.0; + solve(viewer); + return true; + case ' ': + solve(viewer); + return true; + default: + return false; + } +} + + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + MatrixXd V; + MatrixXi F; + igl::readOFF(TUTORIAL_SHARED_PATH "/cheburashka.off",V,F); + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().show_lines = false; + viewer.callback_key_down = &key_down; + + // One fixed point + b.resize(1,1); + // point on belly. + b<<2556; + bc.resize(1,1); + bc<<1; + + // Construct Laplacian and mass matrix + SparseMatrix L,M,Minv; + igl::cotmatrix(V,F,L); + igl::massmatrix(V,F,igl::MASSMATRIX_TYPE_VORONOI,M); + //M = (M/M.diagonal().maxCoeff()).eval(); + igl::invert_diag(M,Minv); + // Bi-Laplacian + Q = L.transpose() * (Minv * L); + // Zero linear term + B = VectorXd::Zero(V.rows(),1); + + // Lower and upper bound + lx = VectorXd::Zero(V.rows(),1); + ux = VectorXd::Ones(V.rows(),1); + + // Equality constraint constrain solution to sum to 1 + Beq.resize(1,1); + Beq(0) = 0.08; + Aeq = M.diagonal().sparseView().transpose(); + // (Empty inequality constraints) + solve(viewer); + cout<< + "Press '.' to increase scale and resolve."< +#include +#include +#include +#include +#include +#include +#include +#include + +Eigen::MatrixXd V,U; +Eigen::MatrixXi F; +int c=0; +double bbd = 1; +bool twod = 0; +int main(int argc, char * argv[]) +{ + using namespace Eigen; + using namespace std; + using namespace igl; + VectorXd D; + if(!read_triangle_mesh( + argc>1?argv[1]: TUTORIAL_SHARED_PATH "/beetle.off",V,F)) + { + cout<<"failed to load mesh"< L,M; + cotmatrix(V,F,L); + L = (-L).eval(); + massmatrix(V,F,MASSMATRIX_TYPE_DEFAULT,M); + const size_t k = 5; + if(!eigs(L,M,k+1,EIGS_TYPE_SM,U,D)) + { + cout<<"failed."<bool + { + switch(key) + { + default: + return false; + case ' ': + { + U = U.rightCols(k).eval(); + // Rescale eigen vectors for visualization + VectorXd Z = + bbd*0.5*U.col(c); + if(twod) + { + V.col(2) = Z; + viewer.data().set_mesh(V,F); + viewer.data().compute_normals(); + } + viewer.data().set_data(U.col(c).eval()); + c = (c+1)%U.cols(); + return true; + } + } + }; + viewer.data().set_mesh(V,F); + viewer.callback_key_down(viewer,' ',0); + viewer.data().show_lines = false; + std::cout<< +R"( + [space] Cycle through eigen modes +)"; + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/401_BiharmonicDeformation/main.cpp b/vendor/libigl/tutorial/401_BiharmonicDeformation/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4f7c793901c67c8d8b848abd2025c0c58c3e2ec6 --- /dev/null +++ b/vendor/libigl/tutorial/401_BiharmonicDeformation/main.cpp @@ -0,0 +1,125 @@ +#include +#include +#include +#include +#include +#include +#include + +double bc_frac = 1.0; +double bc_dir = -0.03; +bool deformation_field = false; +Eigen::MatrixXd V,U,V_bc,U_bc; +Eigen::VectorXd Z; +Eigen::MatrixXi F; +Eigen::VectorXi b; + +bool pre_draw(igl::opengl::glfw::Viewer & viewer) +{ + using namespace Eigen; + // Determine boundary conditions + if(viewer.core().is_animating) + { + bc_frac += bc_dir; + bc_dir *= (bc_frac>=1.0 || bc_frac<=0.0?-1.0:1.0); + } + + const MatrixXd U_bc_anim = V_bc+bc_frac*(U_bc-V_bc); + if(deformation_field) + { + MatrixXd D; + MatrixXd D_bc = U_bc_anim - V_bc; + igl::harmonic(V,F,b,D_bc,2,D); + U = V+D; + }else + { + igl::harmonic(V,F,b,U_bc_anim,2.,U); + } + viewer.data().set_vertices(U); + viewer.data().compute_normals(); + return false; +} + +bool key_down(igl::opengl::glfw::Viewer &viewer, unsigned char key, int mods) +{ + switch(key) + { + case ' ': + viewer.core().is_animating = !viewer.core().is_animating; + return true; + case 'D': + case 'd': + deformation_field = !deformation_field; + return true; + } + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + igl::readOBJ(TUTORIAL_SHARED_PATH "/decimated-max.obj",V,F); + U=V; + // S(i) = j: j<0 (vertex i not in handle), j >= 0 (vertex i in handle j) + VectorXi S; + igl::readDMAT(TUTORIAL_SHARED_PATH "/decimated-max-selection.dmat",S); + igl::colon(0,V.rows()-1,b); + b.conservativeResize(stable_partition( b.data(), b.data()+b.size(), + [&S](int i)->bool{return S(i)>=0;})-b.data()); + + // Boundary conditions directly on deformed positions + U_bc.resize(b.size(),V.cols()); + V_bc.resize(b.size(),V.cols()); + for(int bi = 0;bi=0 && S(F(f,1))>=0 && S(F(f,2))>=0) + { + C.row(f) = purple; + }else + { + C.row(f) = gold; + } + } + + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(U, F); + viewer.data().show_lines = false; + viewer.data().set_colors(C); + viewer.core().trackball_angle = Eigen::Quaternionf(sqrt(2.0),0,sqrt(2.0),0); + viewer.core().trackball_angle.normalize(); + viewer.callback_pre_draw = &pre_draw; + viewer.callback_key_down = &key_down; + //viewer.core().is_animating = true; + viewer.core().animation_max_fps = 30.; + cout<< + "Press [space] to toggle deformation."< +#include +#include +#include +#include +#include + +double z_max = 1.0; +double z_dir = -0.03; +int k = 2; +bool resolve = true; +Eigen::MatrixXd V,U; +Eigen::VectorXd Z; +Eigen::MatrixXi F; +Eigen::VectorXi b; +Eigen::VectorXd bc; + +bool pre_draw(igl::opengl::glfw::Viewer & viewer) +{ + using namespace Eigen; + if(resolve) + { + igl::harmonic(V,F,b,bc,k,Z); + resolve = false; + } + U.col(2) = z_max*Z; + viewer.data().set_vertices(U); + viewer.data().compute_normals(); + if(viewer.core().is_animating) + { + z_max += z_dir; + z_dir *= (z_max>=1.0 || z_max<=0.0?-1.0:1.0); + } + return false; +} + +bool key_down(igl::opengl::glfw::Viewer &viewer, unsigned char key, int mods) +{ + switch(key) + { + case ' ': + viewer.core().is_animating = !viewer.core().is_animating; + break; + case '.': + k++; + k = (k>4?4:k); + resolve = true; + break; + case ',': + k--; + k = (k<1?1:k); + resolve = true; + break; + } + return true; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + igl::readOBJ(TUTORIAL_SHARED_PATH "/bump-domain.obj",V,F); + U=V; + // Find boundary vertices outside annulus + typedef Matrix VectorXb; + VectorXb is_outer = (V.rowwise().norm().array()-1.0)>-1e-15; + VectorXb is_inner = (V.rowwise().norm().array()-0.15)<1e-15; + VectorXb in_b = is_outer.array() || is_inner.array(); + igl::colon(0,V.rows()-1,b); + b.conservativeResize(stable_partition( b.data(), b.data()+b.size(), + [&in_b](int i)->bool{return in_b(i);})-b.data()); + bc.resize(b.size(),1); + for(int bi = 0;bi +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +typedef + std::vector > + RotationList; + +const Eigen::RowVector3d sea_green(70./255.,252./255.,167./255.); +int selected = 0; +Eigen::MatrixXd V,W,U,C,M; +Eigen::MatrixXi T,F,BE; +Eigen::VectorXi P; +RotationList pose; +double anim_t = 1.0; +double anim_t_dir = -0.03; + +bool pre_draw(igl::opengl::glfw::Viewer & viewer) +{ + using namespace Eigen; + using namespace std; + if(viewer.core().is_animating) + { + // Interpolate pose and identity + RotationList anim_pose(pose.size()); + for(int e = 0;e vT; + igl::forward_kinematics(C,BE,P,anim_pose,vQ,vT); + const int dim = C.cols(); + MatrixXd T(BE.rows()*(dim+1),dim); + for(int e = 0;e=1.0 || anim_t<=0.0?-1.0:1.0); + } + return false; +} + +bool key_down(igl::opengl::glfw::Viewer &viewer, unsigned char key, int mods) +{ + switch(key) + { + case ' ': + viewer.core().is_animating = !viewer.core().is_animating; + break; + case '.': + selected++; + selected = std::min(std::max(selected,0),(int)W.cols()-1); + viewer.data().set_data(W.col(selected)); + break; + case ',': + selected--; + selected = std::min(std::max(selected,0),(int)W.cols()-1); + viewer.data().set_data(W.col(selected)); + break; + } + return true; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + igl::readMESH(TUTORIAL_SHARED_PATH "/hand.mesh",V,T,F); + U=V; + igl::readTGF(TUTORIAL_SHARED_PATH "/hand.tgf",C,BE); + // retrieve parents for forward kinematics + igl::directed_edge_parents(BE,P); + + // Read pose as matrix of quaternions per row + MatrixXd Q; + igl::readDMAT(TUTORIAL_SHARED_PATH "/hand-pose.dmat",Q); + igl::column_to_quats(Q,pose); + assert(pose.size() == BE.rows()); + + // List of boundary indices (aka fixed value indices into VV) + VectorXi b; + // List of boundary conditions of each weight function + MatrixXd bc; + igl::boundary_conditions(V,T,C,VectorXi(),BE,MatrixXi(),b,bc); + + // compute BBW weights matrix + igl::BBWData bbw_data; + // only a few iterations for sake of demo + bbw_data.active_set_params.max_iter = 8; + bbw_data.verbosity = 2; + if(!igl::bbw(V,T,b,bc,bbw_data,W)) + { + return EXIT_FAILURE; + } + + //MatrixXd Vsurf = V.topLeftCorner(F.maxCoeff()+1,V.cols()); + //MatrixXd Wsurf; + //if(!igl::bone_heat(Vsurf,F,C,VectorXi(),BE,MatrixXi(),Wsurf)) + //{ + // return false; + //} + //W.setConstant(V.rows(),Wsurf.cols(),1); + //W.topLeftCorner(Wsurf.rows(),Wsurf.cols()) = Wsurf = Wsurf = Wsurf = Wsurf; + + // Normalize weights to sum to one + igl::normalize_row_sums(W,W); + // precompute linear blend skinning matrix + igl::lbs_matrix(V,W,M); + + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(U, F); + viewer.data().set_data(W.col(selected)); + viewer.data().set_edges(C,BE,sea_green); + viewer.data().show_lines = false; + viewer.data().show_overlay_depth = false; + viewer.data().line_width = 1; + viewer.callback_pre_draw = &pre_draw; + viewer.callback_key_down = &key_down; + viewer.core().is_animating = false; + viewer.core().animation_max_fps = 30.; + cout<< + "Press '.' to show next weight function."< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +typedef + std::vector > + RotationList; + +const Eigen::RowVector3d sea_green(70./255.,252./255.,167./255.); +Eigen::MatrixXd V,W,C,U,M; +Eigen::MatrixXi F,BE; +Eigen::VectorXi P; +std::vector poses; +double anim_t = 0.0; +double anim_t_dir = 0.015; +bool use_dqs = false; +bool recompute = true; + +bool pre_draw(igl::opengl::glfw::Viewer & viewer) +{ + using namespace Eigen; + using namespace std; + if(recompute) + { + // Find pose interval + const int begin = (int)floor(anim_t)%poses.size(); + const int end = (int)(floor(anim_t)+1)%poses.size(); + const double t = anim_t - floor(anim_t); + + // Interpolate pose and identity + RotationList anim_pose(poses[begin].size()); + for(int e = 0;e vT; + igl::forward_kinematics(C,BE,P,anim_pose,vQ,vT); + const int dim = C.cols(); + MatrixXd T(BE.rows()*(dim+1),dim); + for(int e = 0;e +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +typedef + std::vector > + RotationList; + +const Eigen::RowVector3d sea_green(70./255.,252./255.,167./255.); +Eigen::MatrixXd V,U; +Eigen::MatrixXi F; +Eigen::VectorXi S,b; +Eigen::RowVector3d mid; +double anim_t = 0.0; +double anim_t_dir = 0.03; +igl::ARAPData arap_data; + +bool pre_draw(igl::opengl::glfw::Viewer & viewer) +{ + using namespace Eigen; + using namespace std; + MatrixXd bc(b.size(),V.cols()); + for(int i = 0;i(0,V.rows()-1,b); + b.conservativeResize(stable_partition( b.data(), b.data()+b.size(), + [](int i)->bool{return S(i)>=0;})-b.data()); + // Centroid + mid = 0.5*(V.colwise().maxCoeff() + V.colwise().minCoeff()); + // Precomputation + arap_data.max_iter = 100; + igl::arap_precomputation(V,F,V.cols(),b,arap_data); + + // Set color based on selection + MatrixXd C(F.rows(),3); + RowVector3d purple(80.0/255.0,64.0/255.0,255.0/255.0); + RowVector3d gold(255.0/255.0,228.0/255.0,58.0/255.0); + for(int f = 0;f=0 && S(F(f,1))>=0 && S(F(f,2))>=0) + { + C.row(f) = purple; + }else + { + C.row(f) = gold; + } + } + + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(U, F); + viewer.data().set_colors(C); + viewer.callback_pre_draw = &pre_draw; + viewer.callback_key_down = &key_down; + viewer.core().is_animating = false; + viewer.core().animation_max_fps = 30.; + cout<< + "Press [space] to toggle animation"< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +typedef + std::vector > + RotationList; + +const Eigen::RowVector3d sea_green(70./255.,252./255.,167./255.); +Eigen::MatrixXd V,U,M; +Eigen::MatrixXi F; +Eigen::VectorXi S,b; +Eigen::MatrixXd L; +Eigen::RowVector3d mid; +double anim_t = 0.0; +double anim_t_dir = 0.03; +double bbd = 1.0; +bool resolve = true; +igl::ARAPData arap_data,arap_grouped_data; +igl::ArapDOFData arap_dof_data; +Eigen::SparseMatrix Aeq; + +enum ModeType +{ + MODE_TYPE_ARAP = 0, + MODE_TYPE_ARAP_GROUPED = 1, + MODE_TYPE_ARAP_DOF = 2, + NUM_MODE_TYPES = 4 +} mode = MODE_TYPE_ARAP; + +bool pre_draw(igl::opengl::glfw::Viewer & viewer) +{ + using namespace Eigen; + using namespace std; + if(resolve) + { + MatrixXd bc(b.size(),V.cols()); + VectorXd Beq(3*b.size()); + for(int i = 0;i > ijv; + for(int i = 0;i(3*i + d,i + c*m*3 + d*m, homo(c))); + } + } + } + Aeq.setFromTriplets(ijv.begin(),ijv.end()); + igl::arap_dof_precomputation(V,F,M,G,arap_dof_data); + igl::arap_dof_recomputation(VectorXi(),Aeq,arap_dof_data); + // Initialize + MatrixXd Istack = MatrixXd::Identity(3,3+1).replicate(1,m); + igl::columnize(Istack,m,2,L); + + // Precomputation for ARAP + cout<<"Initializing ARAP..."< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +struct Mesh +{ + Eigen::MatrixXd V,U; + Eigen::MatrixXi T,F; +} low,high,scene; + +Eigen::MatrixXd W; +igl::ARAPData arap_data; + +int main(int argc, char * argv[]) +{ + using namespace Eigen; + using namespace std; + using namespace igl; + + // read the mesh, if the code is prepared outside of tutorial, the TUTORIAL_SHARED_PATH + // should be the data folder + if(!readMESH(TUTORIAL_SHARED_PATH "/octopus-low.mesh",low.V,low.T,low.F)) + { + cout<<"failed to load mesh"< list of singleton lists + std::vector > S; + // S will hav size of low.V.rows() and each list inside will have 1 element + igl::matrix_to_list(b,S); + cout<<"Computing weights for "< M; + igl::massmatrix(low.V,low.T,igl::MASSMATRIX_TYPE_DEFAULT,M); + const size_t n = low.V.rows(); + // f = ma + arap_data.f_ext = M * RowVector3d(0,-9.8,0).replicate(n,1); + // Random initial velocities to wiggle things + arap_data.vel = MatrixXd::Random(n,3); + + igl::opengl::glfw::Viewer viewer; + // Create one huge mesh containing both meshes + igl::cat(1,low.U,high.U,scene.U); + // need to remap the indices since we cat the V matrices + igl::cat(1,low.F,MatrixXi(high.F.array()+low.V.rows()),scene.F); + // Color each mesh + viewer.data().set_mesh(scene.U,scene.F); + MatrixXd C(scene.F.rows(),3); + C<< + RowVector3d(0.8,0.5,0.2).replicate(low.F.rows(),1), + RowVector3d(0.3,0.4,1.0).replicate(high.F.rows(),1); + viewer.data().set_colors(C); + + viewer.callback_key_pressed = + [&](igl::opengl::glfw::Viewer & viewer,unsigned int key,int mods)->bool + { + switch(key) + { + default: + return false; + case ' ': + viewer.core().is_animating = !viewer.core().is_animating; + return true; + case 'r': + low.U = low.V; + return true; + } + }; + viewer.callback_pre_draw = [&](igl::opengl::glfw::Viewer & viewer)->bool + { + glEnable(GL_CULL_FACE); + if(viewer.core().is_animating) + { + arap_solve(MatrixXd(0,3),arap_data,low.U); + for(int v = 0;v +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char * argv[]) +{ + + Eigen::MatrixXd V,U,C,W,T,M,Omega; + Eigen::MatrixXi F,BE; + igl::read_triangle_mesh(TUTORIAL_SHARED_PATH "/elephant.obj",V,F); + igl::readTGF( TUTORIAL_SHARED_PATH "/elephant.tgf",C,BE); + igl::readDMAT( TUTORIAL_SHARED_PATH "/elephant-weights.dmat",W); + igl::readDMAT( TUTORIAL_SHARED_PATH "/elephant-anim.dmat",T); + // convert weight to piecewise-rigid weights to stress test DDM + for (int i = 0; i < W.rows(); ++i) + { + int maxj; + W.row(i).maxCoeff(&maxj); + for (int j = 0; j < W.cols(); j++) + { + W(i, j) = double(maxj == j); + } + } + + igl::lbs_matrix(V,W,M); + + int p = 20; + float lambda = 3; // 0 < lambda + float kappa = 1; // 0 < kappa < lambda + float alpha = 0.8; // 0 <= alpha < 1 + igl::direct_delta_mush_precomputation(V, F,W, p, lambda, kappa, alpha, Omega); + + igl::opengl::glfw::Viewer viewer; + int frame = 0; + const int pr_id = viewer.selected_data_index; + viewer.append_mesh(); + const int ddm_id = viewer.selected_data_index; + Eigen::RowVector3d offset(1.1*(V.col(0).maxCoeff()-V.col(0).minCoeff()),0,0); + + viewer.callback_pre_draw = [&](igl::opengl::glfw::Viewer &) -> bool + { + if(viewer.core().is_animating) + { + const Eigen::Map Tf( + T.data()+frame*T.rows(),4*W.cols(),3); + U = (M*Tf).rowwise()-offset; + + Eigen::MatrixXd Cf; + Eigen::MatrixXi BEf; + igl::deform_skeleton(C,BE,Tf,Cf,BEf); + viewer.data(pr_id).set_edges(Cf,BEf, Eigen::RowVector3d(1,1,1)); + + viewer.data(pr_id).set_vertices(U); + viewer.data(pr_id).compute_normals(); + + { + std::vector> + T_list(BE.rows()); + for (int e = 0; e < BE.rows(); e++) + { + T_list[e] = Eigen::Affine3d::Identity(); + T_list[e].matrix().block(0,0,3,4) = Tf.block(e*4,0,4,3).transpose(); + } + igl::direct_delta_mush(V, T_list, Omega, U); + } + U.rowwise() += offset; + viewer.data(ddm_id).set_vertices(U); + viewer.data(ddm_id).compute_normals(); + + frame++; + if(frame == T.cols()) + { + frame = 0; + viewer.core().is_animating = false; + } + } + return false; + }; + viewer.callback_key_pressed = [&](igl::opengl::glfw::Viewer &, unsigned int key, int mod) + { + switch(key) + { + case ' ': + viewer.core().is_animating = !viewer.core().is_animating; + return true; + } + return false; + }; + + + + for(auto & id : {pr_id,ddm_id}) + { + if(id == pr_id) + { + viewer.data(id).set_mesh( (V.rowwise()-offset*1.0).eval() ,F); + viewer.data(id).set_colors(Eigen::RowVector3d(214./255.,170./255.,148./255.)); + viewer.data(id).set_edges(C,BE, Eigen::RowVector3d(1,1,1)); + }else if(id == ddm_id){ + viewer.data(id).set_mesh( (V.rowwise()+offset*1.0).eval() ,F); + viewer.data(id).set_colors(Eigen::RowVector3d(132./255.,214./255.,105./255.)); + } + viewer.data(id).show_lines = false; + viewer.data(id).set_face_based(true); + viewer.data(id).show_overlay_depth = false; + } + viewer.core().is_animating = false; + viewer.core().animation_max_fps = 24.; + //viewer.data().set_colors(V,F); + + + viewer.launch_init(); + viewer.core().align_camera_center(V); + + viewer.launch_rendering(true); + viewer.launch_shut(); +} diff --git a/vendor/libigl/tutorial/409_Kelvinlets/main.cpp b/vendor/libigl/tutorial/409_Kelvinlets/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..74e598dde80789d210b2045b39be39f9ce478834 --- /dev/null +++ b/vendor/libigl/tutorial/409_Kelvinlets/main.cpp @@ -0,0 +1,176 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { +void ShowHelpMarker(const char* desc) +{ + ImGui::SameLine(); + ImGui::TextDisabled("(?)"); + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::PushTextWrapPos(450.0f); + ImGui::TextUnformatted(desc); + ImGui::PopTextWrapPos(); + ImGui::EndTooltip(); + } +} +} + +int main() +{ + Eigen::MatrixXd V1, OrigV; + Eigen::MatrixXi F1, OrigF; + + igl::readOFF(TUTORIAL_SHARED_PATH "/bumpy.off", OrigV, OrigF); + std::cout << "1 View original mesh\n"; + std::cout << "2 Switch to deformed mesh\n"; + V1 = OrigV; + F1 = OrigF; + + igl::opengl::glfw::Viewer viewer; + igl::opengl::glfw::imgui::ImGuiPlugin plugin; + viewer.plugins.push_back(&plugin); + igl::opengl::glfw::imgui::ImGuiMenu menu; + plugin.widgets.push_back(&menu); + + auto brushRadius = 1.; + auto brushType = igl::BrushType::GRAB; + auto scale = 1; + menu.callback_draw_custom_window = [&]() { + ImGui::SetNextWindowPos(ImVec2(180.f * menu.menu_scaling(), 10), + ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(200, 160), ImGuiCond_FirstUseEver); + ImGui::Begin( + "Kelvinlet Brushes", nullptr, ImGuiWindowFlags_NoSavedSettings); + + ImGui::InputDouble("Brush Radius", &brushRadius, 0, 0, "%.4f"); + ImGui::Combo("Brush type", + reinterpret_cast(&brushType), + "Grab\0Scale\0Twist\0Pinch\0\0"); + ImGui::InputInt("Falloff", &scale); + ShowHelpMarker("Defines how localized the stroke is {1,2,3}"); + ImGui::End(); + }; + + Eigen::Vector3d posStart(0, 0, 0); + Eigen::Vector3d posEnd; + decltype(OrigV) result; + auto min_point = V1.colwise().minCoeff(); + auto max_point = V1.colwise().maxCoeff(); + // to multiply brush force proportional to size of mesh + auto brush_strength = (max_point - min_point).norm(); + Eigen::Matrix3d twist, pinch; + twist << 0, 1, -1, -1, 0, 1, 1, -1, 0; // skew-symmetric + pinch << 0, 1, 1, 1, 0, 1, 1, 1, 0; // symmetric + + viewer.callback_key_down = + [&](igl::opengl::glfw::Viewer& viewer, unsigned char key, int) { + if (key == '1') { + viewer.data().clear(); + viewer.data().set_mesh(OrigV, OrigF); + viewer.core().align_camera_center(OrigV, OrigF); + } else if (key == '2') { + viewer.data().clear(); + viewer.data().set_mesh(V1, F1); + viewer.core().align_camera_center(V1, F1); + } + return false; + }; + + viewer.callback_mouse_down = + [&](igl::opengl::glfw::Viewer& viewer, int, int) -> bool { + Eigen::Vector3f bc; + int fid; + auto x = viewer.current_mouse_x; + auto y = + viewer.core().viewport(3) - static_cast(viewer.current_mouse_y); + if (igl::unproject_onto_mesh(Eigen::Vector2f(x, y), + viewer.core().view, + viewer.core().proj, + viewer.core().viewport, + V1, + F1, + fid, + bc)) { + posStart = igl::unproject(Eigen::Vector3f(x, y, viewer.down_mouse_z), + viewer.core().view, + viewer.core().proj, + viewer.core().viewport) + .template cast(); + return true; + } + return false; + }; + + viewer.callback_mouse_move = + [&](igl::opengl::glfw::Viewer& viewer, int, int) -> bool { + if (!posStart.isZero() && !posStart.hasNaN()) { + posEnd = igl::unproject( + Eigen::Vector3f(viewer.current_mouse_x, + viewer.core().viewport[3] - + static_cast(viewer.current_mouse_y), + viewer.down_mouse_z), + viewer.core().view, + viewer.core().proj, + viewer.core().viewport) + .template cast(); + + // exaggerate the force by a little bit + Eigen::Vector3d forceVec = (posEnd - posStart) * brush_strength; + + int scaleFactor = forceVec.norm(); + if (posEnd.x() < posStart.x()) { + // probably not the best way to determine direction. + scaleFactor = -scaleFactor; + } + Eigen::Matrix3d mat; + switch (brushType) { + case igl::BrushType::GRAB: + mat.setZero(); + break; + case igl::BrushType::SCALE: + mat = Eigen::Matrix3d::Identity() * scaleFactor; + break; + case igl::BrushType::TWIST: + mat = twist * scaleFactor; + break; + case igl::BrushType::PINCH: + mat = pinch * scaleFactor; + break; + } + + igl::kelvinlets( + V1, + posStart, + forceVec, + mat, + igl::KelvinletParams(brushRadius, scale, brushType), + result); + viewer.data().set_vertices(result); + viewer.data().compute_normals(); + return true; + } + return false; + }; + + viewer.callback_mouse_up = + [&](igl::opengl::glfw::Viewer& viewer, int, int) -> bool { + if (!posStart.isZero()) { + V1 = result; + posStart.setZero(); + return true; + } + return false; + }; + + viewer.data().set_mesh(V1, F1); + viewer.core().align_camera_center(V1, F1); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/501_HarmonicParam/main.cpp b/vendor/libigl/tutorial/501_HarmonicParam/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..973c0af6b9b5add0bef35ce6a5523b708d7ba476 --- /dev/null +++ b/vendor/libigl/tutorial/501_HarmonicParam/main.cpp @@ -0,0 +1,64 @@ +#include +#include +#include +#include +#include + + + +int main(int argc, char *argv[]) +{ + Eigen::MatrixXd V, V_uv; + Eigen::MatrixXi F; + // Load a mesh in OFF format + igl::read_triangle_mesh(TUTORIAL_SHARED_PATH "/camelhead.off", V, F); + + // Find the open boundary + Eigen::VectorXi bnd; + igl::boundary_loop(F,bnd); + + // Map the boundary to a circle, preserving edge proportions + Eigen::MatrixXd bnd_uv; + igl::map_vertices_to_circle(V,bnd,bnd_uv); + + // Harmonic parametrization for the internal vertices + igl::harmonic(V,F,bnd,bnd_uv,1,V_uv); + + // Scale UV to make the texture more clear + V_uv *= 5; + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().set_uv(V_uv); + // Attach callback to allow toggling between 3D and 2D view + viewer.callback_key_pressed = + [&V,&V_uv,&F](igl::opengl::glfw::Viewer& viewer, unsigned int key, int /*mod*/) + { + if(key == '3' || key == '2') + { + // Plot the 3D mesh or 2D UV coordinates + viewer.data().set_vertices(key=='3'?V:V_uv); + viewer.data().compute_normals(); + viewer.core().align_camera_center(key=='3'?V:V_uv,F); + // key press was used + return true; + } + // key press not used + return false; + }; + + // Disable wireframe + viewer.data().show_lines = false; + + // Draw default checkerboard texture + viewer.data().show_texture = true; + + std::cout< +#include +#include + +#include + + +Eigen::MatrixXd V; +Eigen::MatrixXi F; +Eigen::MatrixXd V_uv; + +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + + if (key == '1') + { + // Plot the 3D mesh + viewer.data().set_mesh(V,F); + viewer.core().align_camera_center(V,F); + } + else if (key == '2') + { + // Plot the mesh in 2D using the UV coordinates as vertex coordinates + viewer.data().set_mesh(V_uv,F); + viewer.core().align_camera_center(V_uv,F); + } + + viewer.data().compute_normals(); + + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/camelhead.off", V, F); + + // Fix two points on the boundary + VectorXi bnd,b(2,1); + igl::boundary_loop(F,bnd); + b(0) = bnd(0); + b(1) = bnd(bnd.size()/2); + MatrixXd bc(2,2); + bc<<0,0,1,0; + + // LSCM parametrization + igl::lscm(V,F,b,bc,V_uv); + + // Scale the uv + V_uv *= 5; + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().set_uv(V_uv); + viewer.callback_key_down = &key_down; + + // Disable wireframe + viewer.data().show_lines = false; + + // Draw checkerboard texture + viewer.data().show_texture = true; + + // Launch the viewer + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/503_ARAPParam/main.cpp b/vendor/libigl/tutorial/503_ARAPParam/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..661483159febeac96d66c40bbb8f31b0f291454a --- /dev/null +++ b/vendor/libigl/tutorial/503_ARAPParam/main.cpp @@ -0,0 +1,91 @@ +#include +#include +#include +#include +#include +#include + + +Eigen::MatrixXd V; +Eigen::MatrixXi F; +Eigen::MatrixXd V_uv; +Eigen::MatrixXd initial_guess; + +bool show_uv = false; + +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + if (key == '1') + show_uv = false; + else if (key == '2') + show_uv = true; + + if (key == 'q') + V_uv = initial_guess; + + if (show_uv) + { + viewer.data().set_mesh(V_uv,F); + viewer.core().align_camera_center(V_uv,F); + } + else + { + viewer.data().set_mesh(V,F); + viewer.core().align_camera_center(V,F); + } + + viewer.data().compute_normals(); + + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace std; + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/camelhead.off", V, F); + + // Compute the initial solution for ARAP (harmonic parametrization) + Eigen::VectorXi bnd; + igl::boundary_loop(F,bnd); + Eigen::MatrixXd bnd_uv; + igl::map_vertices_to_circle(V,bnd,bnd_uv); + + igl::harmonic(V,F,bnd,bnd_uv,1,initial_guess); + + // Add dynamic regularization to avoid to specify boundary conditions + igl::ARAPData arap_data; + arap_data.with_dynamics = true; + Eigen::VectorXi b = Eigen::VectorXi::Zero(0); + Eigen::MatrixXd bc = Eigen::MatrixXd::Zero(0,0); + + // Initialize ARAP + arap_data.max_iter = 100; + // 2 means that we're going to *solve* in 2d + arap_precomputation(V,F,2,b,arap_data); + + + // Solve arap using the harmonic map as initial guess + V_uv = initial_guess; + + arap_solve(bc,arap_data,V_uv); + + + // Scale UV to make the texture more clear + V_uv *= 20; + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.data().set_uv(V_uv); + viewer.callback_key_down = &key_down; + + // Disable wireframe + viewer.data().show_lines = false; + + // Draw checkerboard texture + viewer.data().show_texture = true; + + // Launch the viewer + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/504_NRosyDesign/main.cpp b/vendor/libigl/tutorial/504_NRosyDesign/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4b2e96566f72fcdda53a949a5fbb7f28de54a1ee --- /dev/null +++ b/vendor/libigl/tutorial/504_NRosyDesign/main.cpp @@ -0,0 +1,148 @@ +#include +#include +#include +#include +#include +#include +#include + + +// Mesh +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +// Constrained faces id +Eigen::VectorXi b; + +// Cosntrained faces representative vector +Eigen::MatrixXd bc; + +// Degree of the N-RoSy field +int N = 4; + +// Converts a representative vector per face in the full set of vectors that describe +// an N-RoSy field +void representative_to_nrosy( + const Eigen::MatrixXd& V, + const Eigen::MatrixXi& F, + const Eigen::MatrixXd& R, + const int N, + Eigen::MatrixXd& Y) +{ + using namespace Eigen; + using namespace std; + MatrixXd B1, B2, B3; + + igl::local_basis(V,F,B1,B2,B3); + + Y.resize(F.rows()*N,3); + for (unsigned i=0;i 0.001) + viewer.data().add_points(V.row(i),RowVector3d(1,0,0)); + } + + // Highlight in red the constrained faces + MatrixXd C = MatrixXd::Constant(F.rows(),3,1); + for (unsigned i=0; i= '1' && key <= '9') + N = key - '0'; + + MatrixXd R; + VectorXd S; + + igl::copyleft::comiso::nrosy(V,F,b,bc,VectorXi(),VectorXd(),MatrixXd(),N,0.5,R,S); + plot_mesh_nrosy(viewer,V,F,N,R,S,b); + + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace std; + using namespace Eigen; + + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/bumpy.off", V, F); + + // Threshold faces with high anisotropy + b.resize(1); + b << 0; + bc.resize(1,3); + bc << 1,1,1; + + igl::opengl::glfw::Viewer viewer; + + // Interpolate the field and plot + key_down(viewer, '4', 0); + + // Plot the mesh + viewer.data().set_mesh(V, F); + viewer.callback_key_down = &key_down; + + // Disable wireframe + viewer.data().show_lines = false; + + // Launch the viewer + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/505_MIQ/main.cpp b/vendor/libigl/tutorial/505_MIQ/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3f2f2f88f9243866d854f0bd34420db78c14ab92 --- /dev/null +++ b/vendor/libigl/tutorial/505_MIQ/main.cpp @@ -0,0 +1,325 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// Input mesh +Eigen::MatrixXd V; +Eigen::MatrixXi F; + + +// Face barycenters +Eigen::MatrixXd B; + +// Scale for visualizing the fields +double global_scale; +bool extend_arrows = false; + +// Cross field +Eigen::MatrixXd X1,X2; + +// Bisector field +Eigen::MatrixXd BIS1, BIS2; + +// Combed bisector +Eigen::MatrixXd BIS1_combed, BIS2_combed; + +// Per-corner, integer mismatches +Eigen::Matrix MMatch; + +// Field singularities +Eigen::Matrix isSingularity, singularityIndex; + +// Per corner seams +Eigen::Matrix Seams; + +// Combed field +Eigen::MatrixXd X1_combed, X2_combed; + + +// Global parametrization (with seams) +Eigen::MatrixXd UV_seams; +Eigen::MatrixXi FUV_seams; + +// Global parametrization +Eigen::MatrixXd UV; +Eigen::MatrixXi FUV; + + +// Create a texture that hides the integer translation in the parametrization +void line_texture(Eigen::Matrix &texture_R, + Eigen::Matrix &texture_G, + Eigen::Matrix &texture_B) + { + unsigned size = 128; + unsigned size2 = size/2; + unsigned lineWidth = 3; + texture_R.setConstant(size, size, 255); + for (unsigned i=0; i'8') + return false; + + viewer.data().clear(); + viewer.data().show_lines = false; + viewer.data().show_texture = false; + + if (key == '1') + { + // Cross field + viewer.data().set_mesh(V, F); + viewer.data().add_edges(extend_arrows ? B - global_scale*X1 : B, B + global_scale*X1 ,Eigen::RowVector3d(1,0,0)); + viewer.data().add_edges(extend_arrows ? B - global_scale*X2 : B, B + global_scale*X2 ,Eigen::RowVector3d(0,0,1)); + } + + if (key == '2') + { + // Bisector field + viewer.data().set_mesh(V, F); + viewer.data().add_edges(extend_arrows ? B - global_scale*BIS1 : B, B + global_scale*BIS1 ,Eigen::RowVector3d(1,0,0)); + viewer.data().add_edges(extend_arrows ? B - global_scale*BIS2 : B, B + global_scale*BIS2 ,Eigen::RowVector3d(0,0,1)); + } + + if (key == '3') + { + // Bisector field combed + viewer.data().set_mesh(V, F); + viewer.data().add_edges(extend_arrows ? B - global_scale*BIS1_combed : B, B + global_scale*BIS1_combed ,Eigen::RowVector3d(1,0,0)); + viewer.data().add_edges(extend_arrows ? B - global_scale*BIS2_combed : B, B + global_scale*BIS2_combed ,Eigen::RowVector3d(0,0,1)); + } + + if (key == '4') + { + // Singularities and cuts + viewer.data().set_mesh(V, F); + + // Plot cuts + int l_count = Seams.sum(); + Eigen::MatrixXd P1(l_count,3); + Eigen::MatrixXd P2(l_count,3); + + for (unsigned i=0; i 0) + viewer.data().add_points(V.row(i),Eigen::RowVector3d(1,0,0)); + else if (singularityIndex(i) > 2) + viewer.data().add_points(V.row(i),Eigen::RowVector3d(0,1,0)); + } + + } + + if (key == '5') + { + // Singularities and cuts, original field + // Singularities and cuts + viewer.data().set_mesh(V, F); + viewer.data().add_edges(extend_arrows ? B - global_scale*X1_combed : B, B + global_scale*X1_combed ,Eigen::RowVector3d(1,0,0)); + viewer.data().add_edges(extend_arrows ? B - global_scale*X2_combed : B, B + global_scale*X2_combed ,Eigen::RowVector3d(0,0,1)); + + // Plot cuts + int l_count = Seams.sum(); + Eigen::MatrixXd P1(l_count,3); + Eigen::MatrixXd P2(l_count,3); + + for (unsigned i=0; i 0) + viewer.data().add_points(V.row(i),Eigen::RowVector3d(1,0,0)); + else if (singularityIndex(i) > 2) + viewer.data().add_points(V.row(i),Eigen::RowVector3d(0,1,0)); + } + } + + if (key == '6') + { + // Global parametrization UV + viewer.data().set_mesh(UV, FUV); + viewer.data().set_uv(UV); + viewer.data().show_lines = true; + } + + if (key == '7') + { + // Global parametrization in 3D + viewer.data().set_mesh(V, F); + viewer.data().set_uv(UV,FUV); + viewer.data().show_texture = true; + } + + if (key == '8') + { + // Global parametrization in 3D with seams + viewer.data().set_mesh(V, F); + viewer.data().set_uv(UV_seams,FUV_seams); + viewer.data().show_texture = true; + } + + viewer.data().set_colors(Eigen::RowVector3d(1,1,1)); + + // Replace the standard texture with an integer shift invariant texture + Eigen::Matrix texture_R, texture_G, texture_B; + line_texture(texture_R, texture_G, texture_B); + viewer.data().set_texture(texture_R, texture_B, texture_G); + + viewer.core().align_camera_center(viewer.data().V,viewer.data().F); + + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/3holes.off", V, F); + + double gradient_size = 50; + double iter = 0; + double stiffness = 5.0; + bool direct_round = 0; + + // Compute face barycenters + igl::barycenter(V, F, B); + + // Compute scale for visualizing fields + global_scale = .5*igl::avg_edge_length(V, F); + + // Contrain one face + VectorXi b(1); + b << 0; + MatrixXd bc(1, 3); + bc << 1, 0, 0; + + // Create a smooth 4-RoSy field + VectorXd S; + igl::copyleft::comiso::nrosy(V, F, b, bc, VectorXi(), VectorXd(), MatrixXd(), 4, 0.5, X1, S); + + // Find the orthogonal vector + MatrixXd B1, B2, B3; + igl::local_basis(V, F, B1, B2, B3); + X2 = igl::rotate_vectors(X1, VectorXd::Constant(1, igl::PI / 2), B1, B2); + + // Always work on the bisectors, it is more general + igl::compute_frame_field_bisectors(V, F, X1, X2, BIS1, BIS2); + + // Comb the field, implicitly defining the seams + igl::comb_cross_field(V, F, BIS1, BIS2, BIS1_combed, BIS2_combed); + + // Find the integer mismatches + igl::cross_field_mismatch(V, F, BIS1_combed, BIS2_combed, true, MMatch); + + // Find the singularities + igl::find_cross_field_singularities(V, F, MMatch, isSingularity, singularityIndex); + + // Cut the mesh, duplicating all vertices on the seams + igl::cut_mesh_from_singularities(V, F, MMatch, Seams); + + // Comb the frame-field accordingly + igl::comb_frame_field(V, F, X1, X2, BIS1_combed, BIS2_combed, X1_combed, X2_combed); + + // Global parametrization + igl::copyleft::comiso::miq(V, + F, + X1_combed, + X2_combed, + MMatch, + isSingularity, + Seams, + UV, + FUV, + gradient_size, + stiffness, + direct_round, + iter, + 5, + true); + +// Global parametrization (with seams, only for demonstration) +igl::copyleft::comiso::miq(V, + F, + X1_combed, + X2_combed, + MMatch, + isSingularity, + Seams, + UV_seams, + FUV_seams, + gradient_size, + stiffness, + direct_round, + iter, + 5, + false); + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + + // Plot the original mesh with a texture parametrization + key_down(viewer,'7',0); + + // Launch the viewer + viewer.callback_key_down = &key_down; + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/506_FrameField/main.cpp b/vendor/libigl/tutorial/506_FrameField/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..697f115271748323b8d57f08ac0e278708db1dac --- /dev/null +++ b/vendor/libigl/tutorial/506_FrameField/main.cpp @@ -0,0 +1,255 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// Input mesh +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +// Face barycenters +Eigen::MatrixXd B; + +// Scale for visualizing the fields +double global_scale; + +// Input frame field constraints +Eigen::VectorXi b; +Eigen::MatrixXd bc1; +Eigen::MatrixXd bc2; + +// Interpolated frame field +Eigen::MatrixXd FF1, FF2; + +// Deformed mesh +Eigen::MatrixXd V_deformed; +Eigen::MatrixXd B_deformed; + +// Frame field on deformed +Eigen::MatrixXd FF1_deformed; +Eigen::MatrixXd FF2_deformed; + +// Cross field on deformed +Eigen::MatrixXd X1_deformed; +Eigen::MatrixXd X2_deformed; + +// Global parametrization +Eigen::MatrixXd V_uv; +Eigen::MatrixXi F_uv; + +// Create a texture that hides the integer translation in the parametrization +void line_texture(Eigen::Matrix &texture_R, + Eigen::Matrix &texture_G, + Eigen::Matrix &texture_B) +{ + unsigned size = 128; + unsigned size2 = size/2; + unsigned lineWidth = 3; + texture_R.setConstant(size, size, 255); + for (unsigned i=0; i'6') + return false; + + viewer.data().clear(); + viewer.data().show_lines = false; + viewer.data().show_texture = false; + + if (key == '1') + { + // Frame field constraints + viewer.data().set_mesh(V, F); + + MatrixXd F1_t = MatrixXd::Zero(FF1.rows(),FF1.cols()); + MatrixXd F2_t = MatrixXd::Zero(FF2.rows(),FF2.cols()); + // Highlight in red the constrained faces + MatrixXd C = MatrixXd::Constant(F.rows(),3,1); + for (unsigned i=0; i texture_R, texture_G, texture_B; + line_texture(texture_R, texture_G, texture_B); + viewer.data().set_texture(texture_R, texture_B, texture_G); + viewer.core().align_camera_center(viewer.data().V,viewer.data().F); + + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + + // Load a mesh in OBJ format + igl::readOBJ(TUTORIAL_SHARED_PATH "/bumpy-cube.obj", V, F); + + // Compute face barycenters + igl::barycenter(V, F, B); + + // Compute scale for visualizing fields + global_scale = .2*igl::avg_edge_length(V, F); + + // Load constraints + MatrixXd temp; + igl::readDMAT(TUTORIAL_SHARED_PATH "/bumpy-cube.dmat",temp); + + b = temp.block(0,0,temp.rows(),1).cast(); + bc1 = temp.block(0,1,temp.rows(),3); + bc2 = temp.block(0,4,temp.rows(),3); + + // Interpolate the frame field + igl::copyleft::comiso::frame_field(V, F, b, bc1, bc2, FF1, FF2); + + // Deform the mesh to transform the frame field in a cross field + igl::frame_field_deformer( + V,F,FF1,FF2,V_deformed,FF1_deformed,FF2_deformed); + + // Compute face barycenters deformed mesh + igl::barycenter(V_deformed, F, B_deformed); + + // Find the closest crossfield to the deformed frame field + igl::frame_to_cross_field(V_deformed,F,FF1_deformed,FF2_deformed,X1_deformed); + + // Find a smooth crossfield that interpolates the deformed constraints + MatrixXd bc_x(b.size(),3); + for (unsigned i=0; i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// Quad mesh generated from conjugate field +Eigen::MatrixXd VQC; +Eigen::MatrixXi FQC; +Eigen::MatrixXi FQCtri; +Eigen::MatrixXd PQC0, PQC1, PQC2, PQC3; + +// Planarized quad mesh +Eigen::MatrixXd VQCplan; +Eigen::MatrixXi FQCtriplan; +Eigen::MatrixXd PQC0plan, PQC1plan, PQC2plan, PQC3plan; + + +// Scale for visualizing the fields +double global_scale; //TODO: not used + + +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + using namespace std; + using namespace Eigen; + + // Plot the original quad mesh + if (key == '1') + { + // Draw the triangulated quad mesh + viewer.data().set_mesh(VQC, FQCtri); + + // Assign a color to each quad that corresponds to its planarity + VectorXd planarity; + igl::quad_planarity( VQC, FQC, planarity); + MatrixXd Ct; + igl::jet(planarity, 0, 0.01, Ct); + MatrixXd C(FQCtri.rows(),3); + C << Ct, Ct; + viewer.data().set_colors(C); + + // Plot a line for each edge of the quad mesh + viewer.data().add_edges(PQC0, PQC1, Eigen::RowVector3d(0,0,0)); + viewer.data().add_edges(PQC1, PQC2, Eigen::RowVector3d(0,0,0)); + viewer.data().add_edges(PQC2, PQC3, Eigen::RowVector3d(0,0,0)); + viewer.data().add_edges(PQC3, PQC0, Eigen::RowVector3d(0,0,0)); + } + + // Plot the planarized quad mesh + if (key == '2') + { + // Draw the triangulated quad mesh + viewer.data().set_mesh(VQCplan, FQCtri); + + // Assign a color to each quad that corresponds to its planarity + VectorXd planarity; + igl::quad_planarity( VQCplan, FQC, planarity); + MatrixXd Ct; + igl::jet(planarity, 0, 0.01, Ct); + MatrixXd C(FQCtri.rows(),3); + C << Ct, Ct; + viewer.data().set_colors(C); + + // Plot a line for each edge of the quad mesh + viewer.data().add_edges(PQC0plan, PQC1plan, Eigen::RowVector3d(0,0,0)); + viewer.data().add_edges(PQC1plan, PQC2plan, Eigen::RowVector3d(0,0,0)); + viewer.data().add_edges(PQC2plan, PQC3plan, Eigen::RowVector3d(0,0,0)); + viewer.data().add_edges(PQC3plan, PQC0plan, Eigen::RowVector3d(0,0,0)); + } + + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + + // Load a quad mesh generated by a conjugate field + igl::readOFF(TUTORIAL_SHARED_PATH "/inspired_mesh_quads_Conjugate.off", VQC, FQC); + + // Convert it in a triangle mesh + FQCtri.resize(2*FQC.rows(), 3); + FQCtri << FQC.col(0),FQC.col(1),FQC.col(2), + FQC.col(2),FQC.col(3),FQC.col(0); + igl::slice( VQC, FQC.col(0).eval(), 1, PQC0); + igl::slice( VQC, FQC.col(1).eval(), 1, PQC1); + igl::slice( VQC, FQC.col(2).eval(), 1, PQC2); + igl::slice( VQC, FQC.col(3).eval(), 1, PQC3); + + // Planarize it + igl::planarize_quad_mesh(VQC, FQC, 100, 0.005, VQCplan); + + // Convert the planarized mesh to triangles + igl::slice( VQCplan, FQC.col(0).eval(), 1, PQC0plan); + igl::slice( VQCplan, FQC.col(1).eval(), 1, PQC1plan); + igl::slice( VQCplan, FQC.col(2).eval(), 1, PQC2plan); + igl::slice( VQCplan, FQC.col(3).eval(), 1, PQC3plan); + + // Launch the viewer + igl::opengl::glfw::Viewer viewer; + key_down(viewer,'2',0); + viewer.data().invert_normals = true; + viewer.data().show_lines = false; + viewer.callback_key_down = &key_down; + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/601_Serialization/main.cpp b/vendor/libigl/tutorial/601_Serialization/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..678e16bd6510f8d068d48f8fbcb75d7b63c24a33 --- /dev/null +++ b/vendor/libigl/tutorial/601_Serialization/main.cpp @@ -0,0 +1,113 @@ +#include +#include +#include +#include + + +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +// derive from igl::Serializable to serialize your own type +struct State : public igl::Serializable +{ + Eigen::MatrixXd V; + Eigen::MatrixXi F; + std::vector ids; + + // You have to define this function to + // register the fields you want to serialize + virtual void InitSerialization() + { + this->Add(V , "V"); + this->Add(F , "F"); + this->Add(ids, "ids"); + } +}; + +//// alternatively you can do it like the following to have +//// a non-intrusive serialization: +//// +//struct State +//{ +// Eigen::MatrixXd V; +// Eigen::MatrixXi F; +// std::vector ids; +//}; +// +// +//namespace igl +//{ +// namespace serialization +// { +// // the `template <>` is essential +// template <> inline void serialize(const State& obj,std::vector& buffer){ +// ::igl::serialize(obj.V,std::string("V"),buffer); +// ::igl::serialize(obj.F,std::string("F"),buffer); +// ::igl::serialize(obj.ids,std::string("ids"),buffer); +// } +// template <> inline void deserialize(State& obj,const std::vector& buffer){ +// ::igl::deserialize(obj.V,std::string("V"),buffer); +// ::igl::deserialize(obj.F,std::string("F"),buffer); +// ::igl::deserialize(obj.ids,std::string("ids"),buffer); +// } +// } +//} +// +////OR: +// +//SERIALIZE_TYPE(State, +// SERIALIZE_MEMBER(V) +// SERIALIZE_MEMBER(F) +// SERIALIZE_MEMBER_NAME(ids,"ids") +//) + +int main(int argc, char *argv[]) +{ + std::string binaryFile = "binData"; + std::string xmlFile = "data.xml"; + + bool b = true; + unsigned int num = 10; + std::vector vec = {0.1f,0.002f,5.3f}; + + // use overwrite = true for the first serialization to create or overwrite an existing file + igl::serialize(b,"B",binaryFile,true); + // append following serialization to existing file + igl::serialize(num,"Number",binaryFile); + igl::serialize(vec,"VectorName",binaryFile); + + // deserialize back to variables + igl::deserialize(b,"B",binaryFile); + igl::deserialize(num,"Number",binaryFile); + igl::deserialize(vec,"VectorName",binaryFile); + + State stateIn, stateOut; + + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/2triangles.off",stateIn.V,stateIn.F); + + // Save some integers in a vector + stateIn.ids.push_back(6); + stateIn.ids.push_back(7); + + // Serialize the state of the application + igl::serialize(stateIn,"State",binaryFile,true); + + // Load the state from the same file + igl::deserialize(stateOut,"State",binaryFile); + + // Plot the state + std::cout << "Vertices: " << std::endl << stateOut.V << std::endl; + std::cout << "Faces: " << std::endl << stateOut.F << std::endl; + std::cout << "ids: " << std::endl + << stateOut.ids[0] << " " << stateOut.ids[1] << std::endl; + + // XML serialization + + // binary = false, overwrite = true + igl::xml::serialize_xml(vec,"VectorXML",xmlFile,false,true); + // binary = true, overwrite = false + igl::xml::serialize_xml(vec,"VectorBin",xmlFile,true,false); + igl::xml::deserialize_xml(vec,"VectorXML",xmlFile); + igl::xml::deserialize_xml(vec,"VectorBin",xmlFile); +} diff --git a/vendor/libigl/tutorial/602_Matlab/main.cpp b/vendor/libigl/tutorial/602_Matlab/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1fb24742fe204d476d0b1c5d3819c0665d7cea3e --- /dev/null +++ b/vendor/libigl/tutorial/602_Matlab/main.cpp @@ -0,0 +1,70 @@ + +#include +#include +#include +#include +#include + +// On mac you may need to issue something like: +// +// PATH=$PATH:/Applications/MATLAB_R2019a.app/bin/ ./tutorial/602_Matlab_bin + +// Base mesh +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +// Matlab instance +Engine* engine; + +// Eigenvectors of the laplacian +Eigen::MatrixXd EV; + +// This function is called every time a keyboard button is pressed +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + if (key >= '1' && key <= '9') + { + viewer.data().set_data(EV.col((key - '1') + 1)); + } + + return false; +} + +int main(int argc, char *argv[]) +{ + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/3holes.off", V, F); + + // Launch MATLAB + igl::matlab::mlinit(&engine); + + // Compute the discrete Laplacian operator + Eigen::SparseMatrix L; + igl::cotmatrix(V,F,L); + + // Send Laplacian matrix to matlab + igl::matlab::mlsetmatrix(&engine,"L",L); + + // Plot the laplacian matrix using matlab spy + igl::matlab::mleval(&engine,"spy(L)"); + + // Extract the first 10 eigenvectors + igl::matlab::mleval(&engine,"[EV,~] = eigs(-L,10,'sm')"); + + // Plot the size of EV (only for demonstration purposes) + std::cerr << igl::matlab::mleval(&engine,"size(EV)") << std::endl; + + // Retrieve the result + igl::matlab::mlgetmatrix(&engine,"EV",EV); + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.callback_key_down = &key_down; + viewer.data().set_mesh(V, F); + + // Plot the first non-trivial eigenvector + viewer.data().set_data(EV.col(1)); + + // Launch the viewer + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/602_Matlab/run.sh b/vendor/libigl/tutorial/602_Matlab/run.sh new file mode 100644 index 0000000000000000000000000000000000000000..3464edb76df6a2d9cb4882063437c1b5aebb0b9e --- /dev/null +++ b/vendor/libigl/tutorial/602_Matlab/run.sh @@ -0,0 +1,10 @@ +# Make sure that matlab can be launched from the commandline +# if it is not the case use the following commands: +# cd /usr/local/bin +# sudo ln -s /Applications/MATLAB_R2012b.app/bin/matlab + +# Tested on MAC only + +export DYLD_LIBRARY_PATH=/Applications/MATLAB_R2012b.app/bin/maci64/ + +./build/602_Matlab_bin diff --git a/vendor/libigl/tutorial/603_MEX/compileMEX.m b/vendor/libigl/tutorial/603_MEX/compileMEX.m new file mode 100644 index 0000000000000000000000000000000000000000..95d3445c416db64b70e9c942216e978b23dd0a9b --- /dev/null +++ b/vendor/libigl/tutorial/603_MEX/compileMEX.m @@ -0,0 +1,11 @@ +%% Compile the wrapper for readOBJ +mex readOBJ_mex.cpp ... + -I../../include ... + -I/opt/local/include/eigen3 %% Change this path to point to your copy of Eigen + +%% Load an OBJ mesh +[V,F] = readOBJ_mex('../shared/bumpy-cube.obj'); + +%% Plot the mesh +trimesh(F,V(:,1),V(:,2),V(:,3)); +axis vis3d; diff --git a/vendor/libigl/tutorial/603_MEX/readOBJ_mex.cpp b/vendor/libigl/tutorial/603_MEX/readOBJ_mex.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0ecf3e39140d7d3d308ed6e96bbefea17e324f8c --- /dev/null +++ b/vendor/libigl/tutorial/603_MEX/readOBJ_mex.cpp @@ -0,0 +1,46 @@ +#include "mex.h" + +#include +#include +#include + + +void mexFunction( + int nlhs, + mxArray *plhs[], + int nrhs, + const mxArray *prhs[] + ) +{ + using namespace Eigen; + /* Check for proper number of arguments */ + + if (nrhs != 1) + { + mexErrMsgIdAndTxt("MATLAB:mexcpp:nargin", + "readOBJ requires 1 input arguments, the path of the file to open"); + } + + // Read the file path + char* file_path = mxArrayToString(prhs[0]); + + MatrixXd V; + MatrixXi F; + + // Read the mesh + if(!igl::readOBJ(file_path,V,F)) + { + mexErrMsgIdAndTxt("MATLAB:mexcpp:fileio", "igl::readOBJ failed."); + } + // Return the matrices to matlab + switch(nlhs) + { + case 2: + igl::matlab::prepare_lhs_index(F,plhs+1); + case 1: + igl::matlab::prepare_lhs_double(V,plhs); + default: break; + } + + return; +} diff --git a/vendor/libigl/tutorial/604_Triangle/main.cpp b/vendor/libigl/tutorial/604_Triangle/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..41034f208c4e9edf30b1918e51eed0132f53fd42 --- /dev/null +++ b/vendor/libigl/tutorial/604_Triangle/main.cpp @@ -0,0 +1,48 @@ +#include +#include +// Input polygon +Eigen::MatrixXd V; +Eigen::MatrixXi E; +Eigen::MatrixXd H; + +// Triangulated interior +Eigen::MatrixXd V2; +Eigen::MatrixXi F2; + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + + // Create the boundary of a square + V.resize(8,2); + E.resize(8,2); + H.resize(1,2); + + // create two squares, one with edge length of 4, + // one with edge length of 2 + // both centered at origin + V << -1,-1, 1,-1, 1,1, -1, 1, + -2,-2, 2,-2, 2,2, -2, 2; + + // add the edges of the squares + E << 0,1, 1,2, 2,3, 3,0, + 4,5, 5,6, 6,7, 7,4; + + // specify a point that is inside a closed shape + // where we do not want triangulation to happen + H << 0,0; + + // Triangulate the interior + // a0.005 means that the area of each triangle should + // not be greater than 0.005 + // q means that no angles will be smaller than 20 degrees + // for a detailed set of commands please refer to: + // https://www.cs.cmu.edu/~quake/triangle.switch.html + igl::triangle::triangulate(V,E,H,"a0.005q",V2,F2); + + // Plot the generated mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V2,F2); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/605_Tetgen/main.cpp b/vendor/libigl/tutorial/605_Tetgen/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7e69f097423df69c18b6d71788ee6fe075e26849 --- /dev/null +++ b/vendor/libigl/tutorial/605_Tetgen/main.cpp @@ -0,0 +1,79 @@ +#include +#include +#include +#include + + +// Input polygon +Eigen::MatrixXd V; +Eigen::MatrixXi F; +Eigen::MatrixXd B; + +// Tetrahedralized interior +Eigen::MatrixXd TV; +Eigen::MatrixXi TT; +Eigen::MatrixXi TF; + +// This function is called every time a keyboard button is pressed +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + using namespace std; + using namespace Eigen; + + if (key >= '1' && key <= '9') + { + double t = double((key - '1')+1) / 9.0; + + VectorXd v = B.col(2).array() - B.col(2).minCoeff(); + v /= v.col(0).maxCoeff(); + + vector s; + + for (unsigned i=0; i +#include +#include +#include +#include +#include + + +// Mesh +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +Eigen::VectorXd AO; + +// It allows to change the degree of the field when a number is pressed +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + using namespace Eigen; + using namespace std; + const RowVector3d color(0.9,0.85,0.9); + switch(key) + { + case '1': + // Show the mesh without the ambient occlusion factor + viewer.data().set_colors(color); + break; + case '2': + { + // Show the mesh with the ambient occlusion factor + MatrixXd C = color.replicate(V.rows(),1); + for (unsigned i=0; i(AO(i)+0.2,1); + viewer.data().set_colors(C); + break; + } + case '.': + viewer.core().lighting_factor += 0.1; + break; + case ',': + viewer.core().lighting_factor -= 0.1; + break; + default: break; + } + viewer.core().lighting_factor = + std::min(std::max(viewer.core().lighting_factor,0.f),1.f); + + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace std; + using namespace Eigen; + cout<< + "Press 1 to turn off Ambient Occlusion"< +#include +#include +#include +#include + +// This function is called every time a keyboard button is pressed +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + if (key == '1') + { + // Allocate temporary buffers + Eigen::Matrix R(1280,800); + Eigen::Matrix G(1280,800); + Eigen::Matrix B(1280,800); + Eigen::Matrix A(1280,800); + + // Draw the scene in the buffers + viewer.core().draw_buffer( + viewer.data(),false,R,G,B,A); + + // Save it to a PNG + igl::png::writePNG(R,G,B,A,"out.png"); + } + + if (key == '2') + { + // Allocate temporary buffers + Eigen::Matrix R,G,B,A; + + // Read the PNG + igl::png::readPNG("out.png",R,G,B,A); + + // Replace the mesh with a triangulated square + Eigen::MatrixXd V(4,3); + V << + -0.5,-0.5,0, + 0.5,-0.5,0, + 0.5, 0.5,0, + -0.5, 0.5,0; + Eigen::MatrixXi F(2,3); + F << + 0,1,2, + 2,3,0; + Eigen::MatrixXd UV(4,2); + UV << + 0,0, + 1,0, + 1,1, + 0,1; + + viewer.data().clear(); + viewer.data().set_mesh(V,F); + viewer.data().set_uv(UV); + viewer.core().align_camera_center(V); + viewer.data().show_texture = true; + + // Use the image as a texture + viewer.data().set_texture(R,G,B); + + } + + + return false; +} + +int main(int argc, char *argv[]) +{ + // Load a mesh in OFF format + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::readOFF(TUTORIAL_SHARED_PATH "/bunny.off", V, F); + + std::cerr << "Press 1 to render the scene and save it in a png." << std::endl; + std::cerr << "Press 2 to load the saved png and use it as a texture." << std::endl; + + // Plot the mesh and register the callback + igl::opengl::glfw::Viewer viewer; + viewer.callback_key_down = &key_down; + viewer.data().set_mesh(V, F); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/608_RayTrace/main.cpp b/vendor/libigl/tutorial/608_RayTrace/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b08f6dfea9df40a10b8dbc1da713af7507f8744e --- /dev/null +++ b/vendor/libigl/tutorial/608_RayTrace/main.cpp @@ -0,0 +1,68 @@ +#include +#include +#include +#include +#include +#include +#include +// embree +#include + +#include + +int main(int argc, char *argv[]) +{ + int width=640; + int height=480; + + Eigen::MatrixXd V; + Eigen::MatrixXi F; + + const char *mesh_file=argc > 1 ? argv[1] : TUTORIAL_SHARED_PATH "/fertility.off"; + const char *png_file=argc > 2 ? argv[2]: "fertility_curvature.png"; + + // Load mesh + igl::read_triangle_mesh(mesh_file, V,F); + + Eigen::VectorXd K; + // Compute integral of Gaussian curvature + igl::gaussian_curvature(V,F,K); + // Compute mass matrix + Eigen::SparseMatrix M,Minv; + igl::massmatrix(V,F,igl::MASSMATRIX_TYPE_DEFAULT,M); + igl::invert_diag(M,Minv); + // Divide by area to get integral average + K = (Minv*K).eval(); + + // embree object + igl::embree::EmbreeRenderer er; + er.set_mesh(V,F,true); + + //er.set_uniform_color(Eigen::RowVector3d(0.3,0.3,0.3)); + er.set_data(K,igl::COLOR_MAP_TYPE_JET); + + Eigen::Matrix3d rot_matrix; + + // specify rotation + rot_matrix = Eigen::AngleAxisd( 10*igl::PI/180.0, Eigen::Vector3d::UnitX()) + * Eigen::AngleAxisd( 5*igl::PI/180.0, Eigen::Vector3d::UnitY()) + * Eigen::AngleAxisd( 4*igl::PI/180.0, Eigen::Vector3d::UnitZ()); + er.set_rot(rot_matrix); + + er.set_zoom(1.5); + er.set_orthographic(false); + + Eigen::Matrix R(width, height); + Eigen::Matrix G(width, height); + Eigen::Matrix B(width, height); + Eigen::Matrix A(width, height); + + // render view using embree + er.render_buffer(R,G,B,A); + + std::cout<<"Rendered scene saved to "< +//#undef IGL_STATIC_LIBRARY +#include +#include + +#include +#include + + +Eigen::MatrixXd VA,VB,VC; +Eigen::VectorXi J,I; +Eigen::MatrixXi FA,FB,FC; +igl::MeshBooleanType boolean_type( + igl::MESH_BOOLEAN_TYPE_UNION); + +const char * MESH_BOOLEAN_TYPE_NAMES[] = +{ + "Union", + "Intersect", + "Minus", + "XOR", + "Resolve", +}; + +void update(igl::opengl::glfw::Viewer &viewer) +{ + igl::copyleft::cgal::mesh_boolean(VA,FA,VB,FB,boolean_type,VC,FC,J); + Eigen::MatrixXd C(FC.rows(),3); + for(size_t f = 0;f( + (boolean_type+1)% igl::NUM_MESH_BOOLEAN_TYPES); + break; + case ',': + boolean_type = + static_cast( + (boolean_type+igl::NUM_MESH_BOOLEAN_TYPES-1)% + igl::NUM_MESH_BOOLEAN_TYPES); + break; + case '[': + viewer.core().camera_dnear -= 0.1; + return true; + case ']': + viewer.core().camera_dnear += 0.1; + return true; + } + update(viewer); + return true; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + igl::readOFF(TUTORIAL_SHARED_PATH "/cheburashka.off",VA,FA); + igl::readOFF(TUTORIAL_SHARED_PATH "/decimated-knight.off",VB,FB); + // Plot the mesh with pseudocolors + igl::opengl::glfw::Viewer viewer; + + // Initialize + update(viewer); + + viewer.data().show_lines = true; + viewer.callback_key_down = &key_down; + viewer.core().camera_dnear = 3.9; + cout<< + "Press '.' to switch to next boolean operation type."< +#include +#include +#include +#include + + +int main(int argc, char * argv[]) +{ + using namespace Eigen; + using namespace igl::copyleft::cgal; + using namespace std; + using namespace igl; + cout< J; + switch(view_id) + { + case 5: + // Compute result of (A ∩ B) + M = {{VA,FA},{VB,FB},"i"}; + J = M.J().array()+0; + break; + case 6: + // Compute result of (C ∪ D) + M = {{VC,FC},{VD,FD},"u"}; + J = M.J().array()+FA.rows()+FB.rows(); + break; + case 7: + // Compute result of (C ∪ D) ∪ E + M = {{{VC,FC},{VD,FD},"u"},{VE,FE},"u"}; + J = M.J().array()+FA.rows()+FB.rows(); + break; + case 8: + // Compute result of (A ∩ B) \ ((C ∪ D) ∪ E) + M = {{{VA,FA},{VB,FB},"i"},{{{VC,FC},{VD,FD},"u"},{VE,FE},"u"},"m"}; + J = M.J().array()+0; + break; + default: + assert(false && "unknown view id"); + } + viewer.data().set_mesh(M.cast_V(),M.F()); + I.resize(M.F().rows(),1); + // Compute colors based on original facets + for(int f = 0;fbool + { + switch(key) + { + case ']': + view_id = (view_id+1)%num_views; + break; + case '[': + view_id = (view_id+num_views-1)%num_views; + break; + default: + return false; + } + update(); + return true; + }; + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/701_Statistics/main.cpp b/vendor/libigl/tutorial/701_Statistics/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bd19f69ef15af06fc308235eb0d9254695a943fd --- /dev/null +++ b/vendor/libigl/tutorial/701_Statistics/main.cpp @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + + MatrixXd V; + MatrixXi F; + + igl::readOBJ(TUTORIAL_SHARED_PATH "/horse_quad.obj",V,F); + + // Count the number of irregular vertices, the border is ignored + vector irregular = igl::is_irregular_vertex(V,F); + + int vertex_count = V.rows(); + int irregular_vertex_count = + std::count(irregular.begin(),irregular.end(),true); + double irregular_ratio = double(irregular_vertex_count)/vertex_count; + + printf("Irregular vertices: \n%d/%d (%.2f%%)\n", + irregular_vertex_count,vertex_count, irregular_ratio*100); + + // Compute areas, min, max and standard deviation + VectorXd area; + igl::doublearea(V,F,area); + area = area.array() / 2; + + double area_avg = area.mean(); + double area_min = area.minCoeff() / area_avg; + double area_max = area.maxCoeff() / area_avg; + double area_sigma = sqrt(((area.array()-area_avg)/area_avg).square().mean()); + + printf("Areas (Min/Max)/Avg_Area Sigma: \n%.2f/%.2f (%.2f)\n", + area_min,area_max,area_sigma); + + // Compute per face angles, min, max and standard deviation + MatrixXd angles; + igl::internal_angles(V,F,angles); + angles = 360.0 * (angles/(2*igl::PI)); // Convert to degrees + + double angle_avg = angles.mean(); + double angle_min = angles.minCoeff(); + double angle_max = angles.maxCoeff(); + double angle_sigma = sqrt( (angles.array()-angle_avg).square().mean() ); + + printf("Angles in degrees (Min/Max) Sigma: \n%.2f/%.2f (%.2f)\n", + angle_min,angle_max,angle_sigma); + +} diff --git a/vendor/libigl/tutorial/702_WindingNumber/main.cpp b/vendor/libigl/tutorial/702_WindingNumber/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a3cbe5912530ba8dadef8aa9b656747188f671b7 --- /dev/null +++ b/vendor/libigl/tutorial/702_WindingNumber/main.cpp @@ -0,0 +1,148 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +Eigen::MatrixXd V,BC; +Eigen::VectorXd W; +Eigen::MatrixXi T,F,G; +double slice_z = 0.5; +enum OverLayType +{ + OVERLAY_NONE = 0, + OVERLAY_INPUT = 1, + OVERLAY_OUTPUT = 2, + NUM_OVERLAY = 3, +} overlay = OVERLAY_NONE; + +void update_visualization(igl::opengl::glfw::Viewer & viewer) +{ + using namespace Eigen; + using namespace std; + Eigen::Vector4d plane( + 0,0,1,-((1-slice_z)*V.col(2).minCoeff()+slice_z*V.col(2).maxCoeff())); + MatrixXd V_vis; + MatrixXi F_vis; + VectorXi J; + { + SparseMatrix bary; + // Value of plane's implicit function at all vertices + const VectorXd IV = + (V.col(0)*plane(0) + + V.col(1)*plane(1) + + V.col(2)*plane(2)).array() + + plane(3); + igl::marching_tets(V,T,IV,V_vis,F_vis,J,bary); + } + VectorXd W_vis; + igl::slice(W,J,W_vis); + MatrixXd C_vis; + // color without normalizing + igl::parula(W_vis,false,C_vis); + + + const auto & append_mesh = [&C_vis,&F_vis,&V_vis]( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const RowVector3d & color) + { + F_vis.conservativeResize(F_vis.rows()+F.rows(),3); + F_vis.bottomRows(F.rows()) = F.array()+V_vis.rows(); + V_vis.conservativeResize(V_vis.rows()+V.rows(),3); + V_vis.bottomRows(V.rows()) = V; + C_vis.conservativeResize(C_vis.rows()+F.rows(),3); + C_vis.bottomRows(F.rows()).rowwise() = color; + }; + switch(overlay) + { + case OVERLAY_INPUT: + append_mesh(V,F,RowVector3d(1.,0.894,0.227)); + break; + case OVERLAY_OUTPUT: + append_mesh(V,G,RowVector3d(0.8,0.8,0.8)); + break; + default: + break; + } + viewer.data().clear(); + viewer.data().set_mesh(V_vis,F_vis); + viewer.data().set_colors(C_vis); + viewer.data().set_face_based(true); +} + +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int mod) +{ + switch(key) + { + default: + return false; + case ' ': + overlay = (OverLayType)((1+(int)overlay)%NUM_OVERLAY); + break; + case '.': + slice_z = std::min(slice_z+0.01,0.99); + break; + case ',': + slice_z = std::max(slice_z-0.01,0.01); + break; + } + update_visualization(viewer); + return true; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + + cout<<"Usage:"<0.5).count(),4); + { + size_t k = 0; + for(size_t t = 0;t0.5) + { + CT.row(k) = T.row(t); + k++; + } + } + } + // find bounary facets of interior tets + igl::boundary_facets(CT,G); + // boundary_facets seems to be reversed... + G = G.rowwise().reverse().eval(); + + // normalize + W = (W.array() - W.minCoeff())/(W.maxCoeff()-W.minCoeff()); + + // Plot the generated mesh + igl::opengl::glfw::Viewer viewer; + update_visualization(viewer); + viewer.callback_key_down = &key_down; + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/703_Decimation/main.cpp b/vendor/libigl/tutorial/703_Decimation/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..11f44043fd54b8498c7474d6de67d54c2d54fc0d --- /dev/null +++ b/vendor/libigl/tutorial/703_Decimation/main.cpp @@ -0,0 +1,129 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char * argv[]) +{ + using namespace std; + using namespace Eigen; + using namespace igl; + cout<<"Usage: ./703_Decimation_bin [filename.(off|obj|ply)]"<=2) + { + filename = argv[1]; + } + MatrixXd V,OV; + MatrixXi F,OF; + read_triangle_mesh(filename,OV,OF); + + igl::opengl::glfw::Viewer viewer; + + // Prepare array-based edge data structures and priority queue + VectorXi EMAP; + MatrixXi E,EF,EI; + igl::min_heap< std::tuple > Q; + Eigen::VectorXi EQ; + // If an edge were collapsed, we'd collapse it to these points: + MatrixXd C; + int num_collapsed; + + // Function to reset original mesh and data structures + const auto & reset = [&]() + { + F = OF; + V = OV; + edge_flaps(F,E,EMAP,EF,EI); + C.resize(E.rows(),V.cols()); + VectorXd costs(E.rows()); + // https://stackoverflow.com/questions/2852140/priority-queue-clear-method + // Q.clear(); + Q = {}; + EQ = Eigen::VectorXi::Zero(E.rows()); + { + Eigen::VectorXd costs(E.rows()); + igl::parallel_for(E.rows(),[&](const int e) + { + double cost = e; + RowVectorXd p(1,3); + shortest_edge_and_midpoint(e,V,F,E,EMAP,EF,EI,cost,p); + C.row(e) = p; + costs(e) = cost; + },10000); + for(int e = 0;ebool + { + // If animating then collapse 10% of edges + if(viewer.core().is_animating && !Q.empty()) + { + bool something_collapsed = false; + // collapse edge + const int max_iter = std::ceil(0.01*Q.size()); + for(int j = 0;jbool + { + switch(key) + { + case ' ': + viewer.core().is_animating ^= 1; + break; + case 'R': + case 'r': + reset(); + break; + default: + return false; + } + return true; + }; + + reset(); + viewer.core().background_color.setConstant(1); + viewer.core().is_animating = true; + viewer.callback_key_down = key_down; + viewer.callback_pre_draw = pre_draw; + return viewer.launch(); +} diff --git a/vendor/libigl/tutorial/704_SignedDistance/main.cpp b/vendor/libigl/tutorial/704_SignedDistance/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5698a104d890799ccef30cc1c393c7eefae1e070 --- /dev/null +++ b/vendor/libigl/tutorial/704_SignedDistance/main.cpp @@ -0,0 +1,182 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +Eigen::MatrixXd V; +Eigen::MatrixXi T,F; + +igl::AABB tree; +igl::FastWindingNumberBVH fwn_bvh; + +Eigen::MatrixXd FN,VN,EN; +Eigen::MatrixXi E; +Eigen::VectorXi EMAP; +double max_distance = 1; + +double slice_z = 0.5; +bool overlay = false; + +bool useFastWindingNumber = false; + +void update_visualization(igl::opengl::glfw::Viewer & viewer) +{ + using namespace Eigen; + using namespace std; + Eigen::Vector4d plane( + 0,0,1,-((1-slice_z)*V.col(2).minCoeff()+slice_z*V.col(2).maxCoeff())); + MatrixXd V_vis; + MatrixXi F_vis; + // Extract triangle mesh slice through volume mesh and subdivide nasty + // triangles + { + VectorXi J; + SparseMatrix bary; + { + // Value of plane's implicit function at all vertices + const VectorXd IV = + (V.col(0)*plane(0) + + V.col(1)*plane(1) + + V.col(2)*plane(2)).array() + + plane(3); + igl::marching_tets(V,T,IV,V_vis,F_vis,J,bary); + igl::writeOBJ("vis.obj",V_vis,F_vis); + } + while(true) + { + MatrixXd l; + igl::edge_lengths(V_vis,F_vis,l); + l /= (V_vis.colwise().maxCoeff() - V_vis.colwise().minCoeff()).norm(); + const double max_l = 0.03; + if(l.maxCoeff() bad = l.array().rowwise().maxCoeff() > max_l; + MatrixXi F_vis_bad, F_vis_good; + igl::slice_mask(F_vis,bad,1,F_vis_bad); + igl::slice_mask(F_vis,(bad!=true).eval(),1,F_vis_good); + igl::upsample(V_vis,F_vis_bad); + F_vis = igl::cat(1,F_vis_bad,F_vis_good); + } + } + + // Compute signed distance + VectorXd S_vis; + + if (!useFastWindingNumber) + { + VectorXi I; + MatrixXd N,C; + // Bunny is a watertight mesh so use pseudonormal for signing + signed_distance_pseudonormal(V_vis,V,F,tree,FN,VN,EN,EMAP,S_vis,I,C,N); + } else { + signed_distance_fast_winding_number(V_vis, V, F, tree, fwn_bvh, S_vis); + } + + const auto & append_mesh = [&F_vis,&V_vis]( + const Eigen::MatrixXd & V, + const Eigen::MatrixXi & F, + const RowVector3d & color) + { + F_vis.conservativeResize(F_vis.rows()+F.rows(),3); + F_vis.bottomRows(F.rows()) = F.array()+V_vis.rows(); + V_vis.conservativeResize(V_vis.rows()+V.rows(),3); + V_vis.bottomRows(V.rows()) = V; + }; + if(overlay) + { + append_mesh(V,F,RowVector3d(0.8,0.8,0.8)); + } + viewer.data().clear(); + viewer.data().set_mesh(V_vis,F_vis); + viewer.data().set_data(S_vis); + viewer.core().lighting_factor = overlay; +} + +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int mod) +{ + switch(key) + { + default: + return false; + case ' ': + overlay ^= true; + break; + case '.': + slice_z = std::min(slice_z+0.01,0.99); + break; + case ',': + slice_z = std::max(slice_z-0.01,0.01); + break; + case '1': + useFastWindingNumber = true; + break; + case '2': + useFastWindingNumber = false; + break; + } + update_visualization(viewer); + return true; +} + +int main(int argc, char *argv[]) +{ + using namespace Eigen; + using namespace std; + + cout<<"Usage:"< +#include +#include +#include +#include +#include +#include + + +int main(int argc, char * argv[]) +{ + using namespace Eigen; + using namespace std; + using namespace igl; + MatrixXi F; + MatrixXd V; + // Read in inputs as double precision floating point meshes + read_triangle_mesh( + TUTORIAL_SHARED_PATH "/armadillo.obj",V,F); + cout<<"Creating grid..."< aliasing artifacts + B = S; + for_each(B.data(),B.data()+B.size(),[](double& b){b=(b>0?1:(b<0?-1:0));}); + } + cout<<"Marching cubes..."<bool + { + switch(key) + { + default: + return false; + case '1': + viewer.data().clear(); + viewer.data().set_mesh(V,F); + break; + case '2': + viewer.data().clear(); + viewer.data().set_mesh(SV,SF); + break; + case '3': + viewer.data().clear(); + viewer.data().set_mesh(BV,BF); + break; + } + viewer.data().set_face_based(true); + return true; + }; + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/706_FacetOrientation/main.cpp b/vendor/libigl/tutorial/706_FacetOrientation/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f1ddb29fdd0edfcd883525043b63a7bbf700e8e6 --- /dev/null +++ b/vendor/libigl/tutorial/706_FacetOrientation/main.cpp @@ -0,0 +1,109 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +igl::opengl::glfw::Viewer viewer; +Eigen::MatrixXd V; +std::vector C(2); +std::vector RGBcolors(2); +Eigen::MatrixXi F; +std::vector FF(2); +bool is_showing_reoriented = false; +bool facetwise = false; + +int main(int argc, char * argv[]) +{ + using namespace std; + cout<()/(double)C[pass].maxCoeff(); + HSV.rightCols(2).setConstant(1.0); + igl::hsv_to_rgb(HSV,RGBcolors[pass]); + } + viewer.data().set_colors(RGBcolors[facetwise]); + }; + + viewer.callback_key_pressed = + [&scramble_colors] + (igl::opengl::glfw::Viewer& /*viewer*/, unsigned int key, int mod)->bool + { + switch(key) + { + default: + return false; + case 'F': + case 'f': + { + facetwise = !facetwise; + break; + } + case 'S': + case 's': + { + scramble_colors(); + return true; + } + case ' ': + { + is_showing_reoriented = !is_showing_reoriented; + break; + } + } + viewer.data().clear(); + viewer.data().set_mesh(V,is_showing_reoriented?FF[facetwise]:F); + viewer.data().set_colors(RGBcolors[facetwise]); + return true; + }; + + + // Compute patches + for(int pass = 0;pass<2;pass++) + { + Eigen::VectorXi I; + igl::embree::reorient_facets_raycast( + V,F,F.rows()*100,10,pass==1,false,false,I,C[pass]); + // apply reorientation + FF[pass].conservativeResize(F.rows(),F.cols()); + for(int i = 0;i +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char * argv[]) +{ + using namespace std; + using namespace igl; + Eigen::MatrixXi F,SF; + Eigen::MatrixXd V,SV,VT; + bool show_swept_volume = false; + // Define a rigid motion + const auto & transform = [](const double t)->Eigen::Affine3d + { + Eigen::Affine3d T = Eigen::Affine3d::Identity(); + T.rotate(Eigen::AngleAxisd(t*2.*igl::PI,Eigen::Vector3d(0,1,0))); + T.translate(Eigen::Vector3d(0,0.125*cos(2.*igl::PI*t),0)); + return T; + }; + // Read in inputs as double precision floating point meshes + read_triangle_mesh( + TUTORIAL_SHARED_PATH "/bunny.off",V,F); + cout<bool + { + if(!show_swept_volume) + { + Eigen::Affine3d T = transform(0.25*igl::get_seconds()); + VT = V*T.matrix().block(0,0,3,3).transpose(); + Eigen::RowVector3d trans = T.matrix().block(0,3,3,1).transpose(); + VT = ( VT.rowwise() + trans).eval(); + viewer.data().set_vertices(VT); + viewer.data().compute_normals(); + } + return false; + }; + viewer.callback_key_down = + [&](igl::opengl::glfw::Viewer & viewer, unsigned char key, int mod)->bool + { + switch(key) + { + default: + return false; + case ' ': + show_swept_volume = !show_swept_volume; + viewer.data().clear(); + if(show_swept_volume) + { + viewer.data().set_mesh(SV,SF); + Eigen::Vector3d ambient = Eigen::Vector3d(SILVER_AMBIENT[0], SILVER_AMBIENT[1], SILVER_AMBIENT[2]); + Eigen::Vector3d diffuse = Eigen::Vector3d(SILVER_DIFFUSE[0], SILVER_DIFFUSE[1], SILVER_DIFFUSE[2]); + Eigen::Vector3d specular = Eigen::Vector3d(SILVER_SPECULAR[0], SILVER_SPECULAR[1], SILVER_SPECULAR[2]); + viewer.data().uniform_colors(ambient,diffuse,specular); + } + else + { + viewer.data().set_mesh(V,F); + } + viewer.core().is_animating = !show_swept_volume; + viewer.data().set_face_based(true); + break; + } + return true; + }; + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/708_Picking/main.cpp b/vendor/libigl/tutorial/708_Picking/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..226321039842767ba42a00b7653c010be159081a --- /dev/null +++ b/vendor/libigl/tutorial/708_Picking/main.cpp @@ -0,0 +1,45 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + // Mesh with per-face color + Eigen::MatrixXd V, C; + Eigen::MatrixXi F; + + // Load a mesh in OFF format + igl::readOFF(TUTORIAL_SHARED_PATH "/fertility.off", V, F); + + // Initialize white + C = Eigen::MatrixXd::Constant(F.rows(),3,1); + igl::opengl::glfw::Viewer viewer; + viewer.callback_mouse_down = + [&V,&F,&C](igl::opengl::glfw::Viewer& viewer, int, int)->bool + { + int fid; + Eigen::Vector3f bc; + // Cast a ray in the view direction starting from the mouse position + double x = viewer.current_mouse_x; + double y = viewer.core().viewport(3) - viewer.current_mouse_y; + if(igl::unproject_onto_mesh(Eigen::Vector2f(x,y), viewer.core().view, + viewer.core().proj, viewer.core().viewport, V, F, fid, bc)) + { + // paint hit red + C.row(fid)<<1,0,0; + viewer.data().set_colors(C); + return true; + } + return false; + }; + std::cout< + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +using namespace std; +using namespace Eigen; + +void check_mesh_for_issues(Eigen::MatrixXd& V, Eigen::MatrixXi& F); +void param_2d_demo_iter(igl::opengl::glfw::Viewer& viewer); +void get_soft_constraint_for_circle(Eigen::MatrixXd& V_o, Eigen::MatrixXi& F, Eigen::VectorXi& b, Eigen::MatrixXd& bc); +void soft_const_demo_iter(igl::opengl::glfw::Viewer& viewer); +void deform_3d_demo_iter(igl::opengl::glfw::Viewer& viewer); +void get_cube_corner_constraints(Eigen::MatrixXd& V_o, Eigen::MatrixXi& F, Eigen::VectorXi& b, Eigen::MatrixXd& bc); +void display_3d_mesh(igl::opengl::glfw::Viewer& viewer); +void int_set_to_eigen_vector(const std::set& int_set, Eigen::VectorXi& vec); + +Eigen::MatrixXd V; +Eigen::MatrixXi F; +bool first_iter = true; +igl::SLIMData sData; +igl::Timer timer; + +double uv_scale_param; + +enum DEMO_TYPE { + PARAM_2D, + SOFT_CONST, + DEFORM_3D +}; +DEMO_TYPE demo_type; + +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier){ + if (key == ' ') { + switch (demo_type) { + case PARAM_2D: { + param_2d_demo_iter(viewer); + break; + } + case SOFT_CONST: { + soft_const_demo_iter(viewer); + break; + } + case DEFORM_3D: { + deform_3d_demo_iter(viewer); + break; + } + default: + break; + } + } + + return false; +} + +void param_2d_demo_iter(igl::opengl::glfw::Viewer& viewer) { + if (first_iter) { + timer.start(); + igl::read_triangle_mesh(TUTORIAL_SHARED_PATH "/face.obj", V, F); + check_mesh_for_issues(V,F); + cout << "\tMesh is valid!" << endl; + + Eigen::MatrixXd uv_init; + Eigen::VectorXi bnd; Eigen::MatrixXd bnd_uv; + igl::boundary_loop(F,bnd); + igl::map_vertices_to_circle(V,bnd,bnd_uv); + + igl::harmonic(V,F,bnd,bnd_uv,1,uv_init); + if (igl::flipped_triangles(uv_init,F).size() != 0) { + igl::harmonic(F,bnd,bnd_uv,1,uv_init); // use uniform laplacian + } + + cout << "initialized parametrization" << endl; + + sData.slim_energy = igl::MappingEnergyType::SYMMETRIC_DIRICHLET; + Eigen::VectorXi b; Eigen::MatrixXd bc; + slim_precompute(V,F,uv_init,sData, igl::MappingEnergyType::SYMMETRIC_DIRICHLET, b,bc,0); + + uv_scale_param = 15 * (1./sqrt(sData.mesh_area)); + viewer.data().set_mesh(V, F); + viewer.core().align_camera_center(V,F); + viewer.data().set_uv(sData.V_o*uv_scale_param); + viewer.data().compute_normals(); + viewer.data().show_texture = true; + + first_iter = false; + } else { + timer.start(); + slim_solve(sData,1); // 1 iter + viewer.data().set_uv(sData.V_o*uv_scale_param); + } + cout << "time = " << timer.getElapsedTime() << endl; + cout << "energy = " << sData.energy << endl; +} + +void soft_const_demo_iter(igl::opengl::glfw::Viewer& viewer) { + if (first_iter) { + + igl::read_triangle_mesh(TUTORIAL_SHARED_PATH "/circle.obj", V, F); + + check_mesh_for_issues(V,F); + cout << "\tMesh is valid!" << endl; + Eigen::MatrixXd V_0 = V.block(0,0,V.rows(),2); + + Eigen::VectorXi b; Eigen::MatrixXd bc; + get_soft_constraint_for_circle(V_0,F,b,bc); + double soft_const_p = 1e5; + slim_precompute(V,F,V_0,sData,igl::MappingEnergyType::SYMMETRIC_DIRICHLET,b,bc,soft_const_p); + + viewer.data().set_mesh(V, F); + viewer.core().align_camera_center(V,F); + viewer.data().compute_normals(); + viewer.data().show_lines = true; + + first_iter = false; + + } else { + slim_solve(sData,1); // 1 iter + viewer.data().set_mesh(sData.V_o, F); + } +} + +void deform_3d_demo_iter(igl::opengl::glfw::Viewer& viewer) { + if (first_iter) { + timer.start(); + igl::readOBJ(TUTORIAL_SHARED_PATH "/cube_40k.obj", V, F); + + Eigen::MatrixXd V_0 = V; + Eigen::VectorXi b; Eigen::MatrixXd bc; + get_cube_corner_constraints(V_0,F,b,bc); + + double soft_const_p = 1e5; + sData.exp_factor = 5.0; + slim_precompute(V,F,V_0,sData,igl::MappingEnergyType::EXP_CONFORMAL,b,bc,soft_const_p); + //cout << "precomputed" << endl; + + first_iter = false; + display_3d_mesh(viewer); + + } else { + timer.start(); + slim_solve(sData,1); // 1 iter + display_3d_mesh(viewer); + } + cout << "time = " << timer.getElapsedTime() << endl; + cout << "energy = " << sData.energy << endl; +} + +void display_3d_mesh(igl::opengl::glfw::Viewer& viewer) { + MatrixXd V_temp; MatrixXi F_temp; + Eigen::MatrixXd Barycenters; + + igl::barycenter(sData.V,sData.F,Barycenters); + //cout << "Barycenters.rows() = " << Barycenters.rows() << endl; + //double t = double((key - '1')+1) / 9.0; + double view_depth = 10.; + double t = view_depth/9.; + + VectorXd v = Barycenters.col(2).array() - Barycenters.col(2).minCoeff(); + v /= v.col(0).maxCoeff(); + + vector s; + + for (unsigned i=0; i A; + igl::adjacency_matrix(F,A); + + Eigen::MatrixXi C, Ci; + igl::vertex_components(A, C, Ci); + + int connected_components = Ci.rows(); + if (connected_components!=1) { + cout << "Error! Input has multiple connected components" << endl; exit(1); + } + int euler_char = igl::euler_characteristic(V, F); + if (euler_char!=1) + { + cout << + "Error! Input does not have a disk topology, it's euler char is " << + euler_char << endl; + exit(1); + } + bool is_edge_manifold = igl::is_edge_manifold(F); + if (!is_edge_manifold) { + cout << "Error! Input is not an edge manifold" << endl; exit(1); + } + + Eigen::VectorXd areas; igl::doublearea(V,F,areas); + const double eps = 1e-14; + for (int i = 0; i < areas.rows(); i++) { + if (areas(i) < eps) { + cout << "Error! Input has zero area faces" << endl; exit(1); + } + } +} + +void get_soft_constraint_for_circle(Eigen::MatrixXd& V_o, Eigen::MatrixXi& F, Eigen::VectorXi& b, Eigen::MatrixXd& bc) { + + Eigen::VectorXi bnd; + igl::boundary_loop(F,bnd); + const int B_STEPS = 22; // constraint every B_STEPS vertices of the boundary + + b.resize(bnd.rows()/B_STEPS); + bc.resize(b.rows(),2); + + int c_idx = 0; + for (int i = B_STEPS; i < bnd.rows(); i+=B_STEPS) { + b(c_idx) = bnd(i); + c_idx++; + } + + bc.row(0) = V_o.row(b(0)); // keep it there for now + bc.row(1) = V_o.row(b(2)); + bc.row(2) = V_o.row(b(3)); + bc.row(3) = V_o.row(b(4)); + bc.row(4) = V_o.row(b(5)); + + + bc.row(0) << V_o(b(0),0), 0; + bc.row(4) << V_o(b(4),0), 0; + bc.row(2) << V_o(b(2),0), 0.1; + bc.row(3) << V_o(b(3),0), 0.05; + bc.row(1) << V_o(b(1),0), -0.15; + bc.row(5) << V_o(b(5),0), +0.15; +} + +void get_cube_corner_constraints(Eigen::MatrixXd& V, Eigen::MatrixXi& F, Eigen::VectorXi& b, Eigen::MatrixXd& bc) { + double min_x,max_x,min_y,max_y,min_z,max_z; + min_x = V.col(0).minCoeff(); max_x = V.col(0).maxCoeff(); + min_y = V.col(1).minCoeff(); max_y = V.col(1).maxCoeff(); + min_z = V.col(2).minCoeff(); max_z = V.col(2).maxCoeff(); + + + // get all cube corners + b.resize(8,1); bc.resize(8,3); + int x; + for (int i = 0; i < V.rows(); i++) { + if (V.row(i) == Eigen::RowVector3d(min_x,min_y,min_z)) b(0) = i; + if (V.row(i) == Eigen::RowVector3d(min_x,min_y,max_z)) b(1) = i; + if (V.row(i) == Eigen::RowVector3d(min_x,max_y,min_z)) b(2) = i; + if (V.row(i) == Eigen::RowVector3d(min_x,max_y,max_z)) b(3) = i; + if (V.row(i) == Eigen::RowVector3d(max_x,min_y,min_z)) b(4) = i; + if (V.row(i) == Eigen::RowVector3d(max_x,max_y,min_z)) b(5) = i; + if (V.row(i) == Eigen::RowVector3d(max_x,min_y,max_z)) b(6) = i; + if (V.row(i) == Eigen::RowVector3d(max_x,max_y,max_z)) b(7) = i; + } + + // get all cube edges + std::set cube_edge1; Eigen::VectorXi cube_edge1_vec; + for (int i = 0; i < V.rows(); i++) { + if ((V(i,0) == min_x && V(i,1) == min_y)) { + cube_edge1.insert(i); + } + } + Eigen::VectorXi edge1; + int_set_to_eigen_vector(cube_edge1, edge1); + + std::set cube_edge2; Eigen::VectorXi edge2; + for (int i = 0; i < V.rows(); i++) { + if ((V(i,0) == max_x && V(i,1) == max_y)) { + cube_edge2.insert(i); + } + } + int_set_to_eigen_vector(cube_edge2, edge2); + b = igl::cat(1,edge1,edge2); + + std::set cube_edge3; Eigen::VectorXi edge3; + for (int i = 0; i < V.rows(); i++) { + if ((V(i,0) == max_x && V(i,1) == min_y)) { + cube_edge3.insert(i); + } + } + int_set_to_eigen_vector(cube_edge3, edge3); + b = igl::cat(1,b,edge3); + + std::set cube_edge4; Eigen::VectorXi edge4; + for (int i = 0; i < V.rows(); i++) { + if ((V(i,0) == min_x && V(i,1) == max_y)) { + cube_edge4.insert(i); + } + } + int_set_to_eigen_vector(cube_edge4, edge4); + b = igl::cat(1,b,edge4); + + bc.resize(b.rows(),3); + Eigen::Matrix3d m; m = Eigen::AngleAxisd(0.3 * igl::PI, Eigen::Vector3d(1./sqrt(2.),1./sqrt(2.),0.)/*Eigen::Vector3d::UnitX()*/); + int i = 0; + for (; i < cube_edge1.size(); i++) { + Eigen::RowVector3d edge_rot_center(min_x,min_y,(min_z+max_z)/2.); + bc.row(i) = (V.row(b(i)) - edge_rot_center) * m + edge_rot_center; + } + for (; i < cube_edge1.size() + cube_edge2.size(); i++) { + Eigen::RowVector3d edge_rot_center(max_x,max_y,(min_z+max_z)/2.); + bc.row(i) = (V.row(b(i)) - edge_rot_center) * m.transpose() + edge_rot_center; + } + for (; i < cube_edge1.size() + cube_edge2.size() + cube_edge3.size(); i++) { + bc.row(i) = 0.75*V.row(b(i)); + } + for (; i < b.rows(); i++) { + bc.row(i) = 0.75*V.row(b(i)); + } +} + +void int_set_to_eigen_vector(const std::set& int_set, Eigen::VectorXi& vec) { + vec.resize(int_set.size()); int idx = 0; + for(auto f : int_set) { + vec(idx) = f; idx++; + } +} diff --git a/vendor/libigl/tutorial/710_SCAF/main.cpp b/vendor/libigl/tutorial/710_SCAF/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..242b86754d1403d967a122eb88ae57ca8ef44499 --- /dev/null +++ b/vendor/libigl/tutorial/710_SCAF/main.cpp @@ -0,0 +1,126 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +Eigen::MatrixXd V; +Eigen::MatrixXi F; +Eigen::MatrixXd V_uv; +igl::Timer timer; +igl::triangle::SCAFData scaf_data; + +bool show_uv = false; +float uv_scale = 0.2f; + +bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier) +{ + if (key == '1') + show_uv = false; + else if (key == '2') + show_uv = true; + + if (key == ' ') + { + timer.start(); + igl::triangle::scaf_solve(scaf_data, 1); + std::cout << "time = " << timer.getElapsedTime() << std::endl; + } + + const auto& V_uv = uv_scale * scaf_data.w_uv.topRows(V.rows()); + if (show_uv) + { + viewer.data().clear(); + viewer.data().set_mesh(V_uv,F); + viewer.data().set_uv(V_uv); + viewer.core().align_camera_center(V_uv,F); + } + else + { + viewer.data().set_mesh(V,F); + viewer.data().set_uv(V_uv); + viewer.core().align_camera_center(V,F); + } + + viewer.data().compute_normals(); + + return false; +} + +int main(int argc, char *argv[]) +{ + using namespace std; + // Load a mesh in OFF format + igl::readOBJ(TUTORIAL_SHARED_PATH "/camel_b.obj", V, F); + + Eigen::MatrixXd bnd_uv, uv_init; + + Eigen::VectorXd M; + igl::doublearea(V, F, M); + std::vector> all_bnds; + igl::boundary_loop(F, all_bnds); + + // Heuristic primary boundary choice: longest + auto primary_bnd = std::max_element(all_bnds.begin(), all_bnds.end(), [](const std::vector &a, const std::vector &b) { return a.size()(primary_bnd->data(), primary_bnd->size()); + + igl::map_vertices_to_circle(V, bnd, bnd_uv); + bnd_uv *= sqrt(M.sum() / (2 * igl::PI)); + if (all_bnds.size() == 1) + { + if (bnd.rows() == V.rows()) // case: all vertex on boundary + { + uv_init.resize(V.rows(), 2); + for (int i = 0; i < bnd.rows(); i++) + uv_init.row(bnd(i)) = bnd_uv.row(i); + } + else + { + igl::harmonic(V, F, bnd, bnd_uv, 1, uv_init); + if (igl::flipped_triangles(uv_init, F).size() != 0) + igl::harmonic(F, bnd, bnd_uv, 1, uv_init); // fallback uniform laplacian + } + } + else + { + // if there is a hole, fill it and erase additional vertices. + all_bnds.erase(primary_bnd); + Eigen::MatrixXi F_filled; + igl::topological_hole_fill(F, bnd, all_bnds, F_filled); + igl::harmonic(F_filled, bnd, bnd_uv ,1, uv_init); + uv_init.conservativeResize(V.rows(), 2); + } + + Eigen::VectorXi b; Eigen::MatrixXd bc; + igl::triangle::scaf_precompute(V, F, uv_init, scaf_data, igl::MappingEnergyType::SYMMETRIC_DIRICHLET, b, bc, 0); + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + const auto& V_uv = uv_scale * scaf_data.w_uv.topRows(V.rows()); + viewer.data().set_uv(V_uv); + viewer.callback_key_down = &key_down; + + // Enable wireframe + viewer.data().show_lines = true; + + // Draw checkerboard texture + viewer.data().show_texture = true; + + + std::cerr << "Press space for running an iteration." << std::endl; + std::cerr << "Press 1 for Mesh 2 for UV" << std::endl; + + // Launch the viewer + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/711_Subdivision/main.cpp b/vendor/libigl/tutorial/711_Subdivision/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..251b688aaf4309f9621c3e506401bfa553e1931a --- /dev/null +++ b/vendor/libigl/tutorial/711_Subdivision/main.cpp @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char * argv[]) +{ + using namespace std; + using namespace igl; + Eigen::MatrixXi OF,F; + Eigen::MatrixXd OV,V; + bool show_swept_volume = false; + read_triangle_mesh( + TUTORIAL_SHARED_PATH "/decimated-knight.off",OV,OF); + V = OV; + F = OF; + cout<bool + { + switch(key) + { + default: + return false; + case '1': + { + V = OV; + F = OF; + break; + } + case '2': + { + igl::upsample( Eigen::MatrixXd(V), Eigen::MatrixXi(F), V,F); + break; + } + case '3': + { + igl::loop( Eigen::MatrixXd(V), Eigen::MatrixXi(F), V,F); + break; + } + case '4': + { + igl::false_barycentric_subdivision( + Eigen::MatrixXd(V),Eigen::MatrixXi(F),V,F); + break; + } + } + viewer.data().clear(); + viewer.data().set_mesh(V,F); + viewer.data().set_face_based(true); + return true; + }; + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/712_DataSmoothing/main.cpp b/vendor/libigl/tutorial/712_DataSmoothing/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..77986dbde9b508970e6e4aed31d7735946bb577f --- /dev/null +++ b/vendor/libigl/tutorial/712_DataSmoothing/main.cpp @@ -0,0 +1,182 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + + + + +int main(int argc, char * argv[]) +{ + typedef Eigen::SparseMatrix SparseMat; + srand(57); + + //Read our mesh + Eigen::MatrixXd V; + Eigen::MatrixXi F; + if(!igl::read_triangle_mesh( + argc>1?argv[1]: TUTORIAL_SHARED_PATH "/beetle.off",V,F)) { + std::cout << "Failed to load mesh." << std::endl; + } + + //Constructing an exact function to smooth + igl::HeatGeodesicsData hgData; + igl::heat_geodesics_precompute(V, F, hgData); + Eigen::VectorXd heatDist; + Eigen::VectorXi gamma(1); gamma << 1947; //1631; + igl::heat_geodesics_solve(hgData, gamma, heatDist); + Eigen::VectorXd zexact = + 0.1*(heatDist.array() + (-heatDist.maxCoeff())).pow(2) + + 3*V.block(0,1,V.rows(),1).array().cos(); + + //Make the exact function noisy + const double s = 0.1*(zexact.maxCoeff() - zexact.minCoeff()); + Eigen::VectorXd znoisy = zexact + s*Eigen::VectorXd::Random(zexact.size()); + + //Constructing the squared Laplacian and squared Hessian energy + SparseMat L, M; + igl::cotmatrix(V, F, L); + igl::massmatrix(V, F, igl::MASSMATRIX_TYPE_BARYCENTRIC, M); + Eigen::SimplicialLDLT solver(M); + SparseMat MinvL = solver.solve(L); + SparseMat QL = L.transpose()*MinvL; + SparseMat QH; + igl::hessian_energy(V, F, QH); + SparseMat QcH; + igl::curved_hessian_energy(V, F, QcH); + + //Solve to find Laplacian-smoothed Hessian-smoothed, and + // curved-Hessian-smoothed solutions + const double al = 3e-7; + Eigen::SimplicialLDLT lapSolver(al*QL + (1.-al)*M); + Eigen::VectorXd zl = lapSolver.solve(al*M*znoisy); + const double ah = 2e-7; + Eigen::SimplicialLDLT hessSolver(ah*QH + (1.-ah)*M); + Eigen::VectorXd zh = hessSolver.solve(ah*M*znoisy); + const double ach = 3e-7; + Eigen::SimplicialLDLT curvedHessSolver(al*QcH + (1.-ach)*M); + Eigen::VectorXd zch = curvedHessSolver.solve(ach*M*znoisy); + + //Viewer that shows all functions: zexact, znoisy, zl, zh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V,F); + viewer.data().show_lines = false; + viewer.callback_key_down = + [&](igl::opengl::glfw::Viewer & viewer, unsigned char key, int mod)->bool + { + //Graduate result to show isolines, then compute color matrix + const Eigen::VectorXd* z; + switch(key) { + case '1': + z = &zexact; + break; + case '2': + z = &znoisy; + break; + case '3': + z = &zl; + break; + case '4': + z = &zh; + break; + case '5': + z = &zch; + break; + default: + return false; + } + viewer.data().set_data(*z); + return true; + }; + std::cout << R"(Smoothing a noisy function. +Usage: +1 Show original function +2 Show noisy function +3 Biharmonic smoothing (zero Neumann boundary) +4 Biharmonic smoothing (natural planar Hessian boundary) +5 Biharmonic smoothing (natural curved Hessian boundary) + +)"; + Eigen::MatrixXd CM; + igl::parula(Eigen::VectorXd::LinSpaced(21,0,1).eval(),false,CM); + igl::isolines_map(Eigen::MatrixXd(CM),CM); + viewer.data().set_colormap(CM); + viewer.data().set_data(znoisy); + viewer.launch(); + + + //Constructing a step function to smooth + Eigen::VectorXd zstep = Eigen::VectorXd::Zero(V.rows()); + for(int i=0; i0.31 ? 2. : 0); + } + + //Smooth that function + const double sl = 2e-5; + Eigen::SimplicialLDLT stepLapSolver(sl*QL + (1.-sl)*M); + Eigen::VectorXd stepzl = stepLapSolver.solve(al*M*zstep); + const double sh = 6e-6; + Eigen::SimplicialLDLT stepHessSolver(sh*QH + (1.-sh)*M); + Eigen::VectorXd stepzh = stepHessSolver.solve(ah*M*zstep); + const double sch = 2e-5; + Eigen::SimplicialLDLT stepCurvedHessSolver(sl*QcH + (1.-sch)*M); + Eigen::VectorXd stepzch = stepCurvedHessSolver.solve(ach*M*zstep); + + //Display functions + igl::opengl::glfw::Viewer viewer2; + viewer2.data().set_mesh(V,F); + viewer2.data().show_lines = false; + viewer2.callback_key_down = + [&](igl::opengl::glfw::Viewer & viewer, unsigned char key, int mod)->bool + { + //Graduate result to show isolines, then compute color matrix + const Eigen::VectorXd* z; + switch(key) { + case '1': + z = &zstep; + break; + case '2': + z = &stepzl; + break; + case '3': + z = &stepzh; + break; + case '4': + z = &stepzch; + break; + default: + return false; + } + viewer.data().set_data(*z); + return true; + }; + std::cout << R"(Smoothing a step function. +Usage: +1 Show step function +2 Biharmonic smoothing (zero Neumann boundary) +3 Biharmonic smoothing (natural planar Hessian boundary) +4 Biharmonic smoothing (natural curved Hessian boundary) + +)"; + + viewer2.data().set_colormap(CM); + viewer2.data().set_data(zstep); + viewer2.launch(); + + return 0; +} diff --git a/vendor/libigl/tutorial/713_ShapeUp/main.cpp b/vendor/libigl/tutorial/713_ShapeUp/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2508409ca3725d896bf8aaa579345edcd76ce2ad --- /dev/null +++ b/vendor/libigl/tutorial/713_ShapeUp/main.cpp @@ -0,0 +1,153 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Quad mesh loaded +Eigen::MatrixXd VQC; +Eigen::MatrixXi FQC; +Eigen::MatrixXi E; +Eigen::MatrixXi FQCtri; +Eigen::MatrixXd PQC0, PQC1, PQC2, PQC3; +// Euclidean-regular quad mesh +Eigen::MatrixXd VQCregular; +Eigen::MatrixXi FQCtriregular; +Eigen::MatrixXd PQC0regular, PQC1regular, PQC2regular, PQC3regular; + +igl::ShapeupData su_data; + + + +// Scale for visualizing the fields +double global_scale; //TODO: not used + +void quadAngleRegularity(const Eigen::MatrixXd& V, const Eigen::MatrixXi& Q, Eigen::VectorXd& angleRegularity) +{ + angleRegularity.conservativeResize(Q.rows()); + angleRegularity.setZero(); + for (int i=0;i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char * argv[]) +{ + const auto & tictoc = []() + { + static double t_start = igl::get_seconds(); + double diff = igl::get_seconds()-t_start; + t_start += diff; + return diff; + }; + + // Load a surface mesh which is a cube + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh( + argc>1?argv[1]: TUTORIAL_SHARED_PATH "/armadillo.obj",V,F); + + Eigen::RowVector3i side; + Eigen::MatrixXd TV; + tictoc(); + igl::voxel_grid(V,0,100,1,TV,side); + printf("igl::voxel_grid %g secs\n",tictoc()); + Eigen::MatrixXi TT5,TT6; + tictoc(); + igl::tetrahedralized_grid(TV,side,igl::TETRAHEDRALIZED_GRID_TYPE_5,TT5); + printf("igl::tetrahedralized_grid %g secs\n",tictoc()); + igl::tetrahedralized_grid(TV,side,igl::TETRAHEDRALIZED_GRID_TYPE_6_ROTATIONAL,TT6); + printf("igl::tetrahedralized_grid %g secs\n",tictoc()); + + tictoc(); + Eigen::VectorXd S; + { + Eigen::VectorXi I; + Eigen::MatrixXd C,N; + igl::signed_distance( + TV,V,F, + igl::SIGNED_DISTANCE_TYPE_FAST_WINDING_NUMBER, + std::numeric_limits::min(), + std::numeric_limits::max(), + S,I,C,N); + } + printf("igl::signed_distance %g secs\n",tictoc()); + + std::vector SV(3); + std::vector SF(3); + igl::marching_tets(TV,TT5,S,0,SV[0],SF[0]); + printf("igl::marching_tets5 %g secs\n",tictoc()); + igl::marching_tets(TV,TT6,S,0,SV[1],SF[1]); + printf("igl::marching_tets6 %g secs\n",tictoc()); + tictoc(); + igl::marching_cubes(S,TV,side(0),side(1),side(2),0,SV[2],SF[2]); + printf("igl::marching_cubes %g secs\n",tictoc()); + + + //igl::writeOBJ("tmc.obj",SV,SF); + + // Draw the mesh stored in (SV, SF) + igl::opengl::glfw::Viewer vr; + vr.data().set_mesh(V,F); + vr.data().is_visible = false; + vr.append_mesh(); + int sel = 0; + const auto update = [&]() + { + vr.data().clear(); + vr.data().set_mesh(SV[sel],SF[sel]); + }; + vr.callback_key_pressed = [&](decltype(vr) &,unsigned int key, int mod) + { + switch(key) + { + case ',': + case '.': + sel = (sel+SV.size()+(key=='.'?1:-1))%SV.size(); + update(); + return true; + case ' ': + vr.data_list[0].is_visible = !vr.data_list[0].is_visible; + vr.data_list[1].is_visible = !vr.data_list[1].is_visible; + vr.selected_data_index = (vr.selected_data_index+1)%2; + return true; + } + return false; + }; + update(); + vr.launch(); +} diff --git a/vendor/libigl/tutorial/715_MeshImplicitFunction/main.cpp b/vendor/libigl/tutorial/715_MeshImplicitFunction/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..131936fefbdbc6dbee46730be1f39a47f65ca691 --- /dev/null +++ b/vendor/libigl/tutorial/715_MeshImplicitFunction/main.cpp @@ -0,0 +1,242 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char * argv[]) +{ + const auto & tictoc = []() + { + static double t_start = igl::get_seconds(); + double diff = igl::get_seconds()-t_start; + t_start += diff; + return diff; + }; + + // Create an interesting shape with sharp features using SDF CSG with spheres. + const auto & sphere = []( + const Eigen::RowVector3d & c, + const double r, + const Eigen::RowVector3d & x)->double + { + return (x-c).norm() - r; + }; + const std::function f = + [&](const Eigen::RowVector3d & x)->double + { + return + std::min( + std::min(std::max( + sphere(Eigen::RowVector3d(-0.2,0,-0.2),0.5,x), + -sphere(Eigen::RowVector3d(+0.2,0,0.2),0.5,x)), + sphere(Eigen::RowVector3d(-0.15,0,-0.15),0.3,x) + ), + std::max( + std::max( + sphere(Eigen::RowVector3d(-0.2,-0.5,-0.2),0.6,x),x(1)+0.45),-0.6-x(1)) + ); + }; + Eigen::RowVector3d p0(-0.2,0.5,-0.2); + assert(abs(f(p0)) < 1e-10 && "p0 should be on zero level-set"); + + // Simple finite difference gradients + const auto & fd = []( + const std::function & f, + const Eigen::RowVector3d & x) + { + const double eps = 1e-10; + Eigen::RowVector3d g; + for(int c = 0;c<3;c++) + { + const Eigen::RowVector3d xp = x+eps*Eigen::RowVector3d(c==0,c==1,c==2); + const double fp = f(xp); + const Eigen::RowVector3d xn = x-eps*Eigen::RowVector3d(c==0,c==1,c==2); + const double fn = f(xn); + g(c) = (fp-fn)/(2*eps); + } + return g; + }; + const auto & f_grad = [&fd,&f](const Eigen::RowVector3d & x) + { + return fd(f,x).normalized(); + }; + + Eigen::MatrixXd V; + Eigen::MatrixXi Q,F; + Eigen::MatrixXd mcV,mcN; + Eigen::MatrixXi mcF; + + // Grid parameters + const Eigen::RowVector3d min_corner(-2,-2,-2); + const Eigen::RowVector3d max_corner(+2,+2,+2); + const int s = 256; + int nx = s+1; + int ny = s+1; + int nz = s+1; + const Eigen::RowVector3d step = + (max_corner-min_corner).array()/(Eigen::RowVector3d(nx,ny,nz).array()-1); + // Sparse grid below assumes regular grid + assert((step(0) == step(1))&&(step(0) == step(2))); + + // Dual contouring parameters + bool constrained = false; + bool triangles = false; + bool root_finding = true; + for(int pass = 0;pass<2;pass++) + { + const bool sparse = pass == 1; + printf("Using %s grid..\n",sparse?"sparse":"dense"); + if(sparse) + { + // igl::sparse_voxel_grid assumes (0,0,0) lies on the grid. But dense igl::grid + // below won't necessarily do that depending on nx,ny,nz. + tictoc(); + Eigen::MatrixXd GV; + Eigen::VectorXd Gf; + Eigen::Matrix GI; + igl::sparse_voxel_grid(p0,f,step(0),16.*pow(step(0),-2.),Gf,GV,GI); + const auto t_Gf = tictoc(); + printf(" %5f secs to populate sparse grid of %ld cells\n",t_Gf+tictoc(),GI.rows()); + // Dual contouring requires list of sparse edges (not cells) + // extract _all_ edges from sparse_voxel_grid (conservative) + Eigen::Matrix GI2; + { + Eigen::Matrix all_GI2(GI.rows()*12,2); + all_GI2 << + // front + GI.col(0),GI.col(1), + GI.col(1),GI.col(2), + GI.col(2),GI.col(3), + GI.col(3),GI.col(0), + // back + GI.col(4+0),GI.col(4+1), + GI.col(4+1),GI.col(4+2), + GI.col(4+2),GI.col(4+3), + GI.col(4+3),GI.col(4+0), + // sides + GI.col(0),GI.col(4+0), + GI.col(1),GI.col(4+1), + GI.col(2),GI.col(4+2), + GI.col(3),GI.col(4+3); + Eigen::VectorXi _1,_2; + igl::unique_simplices(all_GI2,GI2,_1,_2); + } + tictoc(); + Eigen::RowVector3d step = + (max_corner-min_corner).array()/(Eigen::RowVector3d(nx,ny,nz).array()-1); + igl::dual_contouring( + f,f_grad,step,Gf,GV,GI2,constrained,triangles,root_finding,V,Q); + printf(" %5f secs dual contouring\n",t_Gf+tictoc()); + // Could use igl::marching_cubes once + // https://github.com/libigl/libigl/pull/1687 is merged + tictoc(); + igl::copyleft::marching_cubes(Gf,GV,GI,mcV, mcF); + printf(" %5f secs marching cubes\n",t_Gf+tictoc()); + }else + { + + tictoc(); + igl::dual_contouring( + f,f_grad,min_corner,max_corner,nx,ny,nz,constrained,triangles,root_finding,V,Q); + printf(" %5f secs dual contouring\n",tictoc()); + // build and sample grid + tictoc(); + Eigen::MatrixXd GV; + igl::grid(Eigen::RowVector3i(nx,ny,nz),GV); + Eigen::VectorXd Gf(GV.rows()); + igl::parallel_for(GV.rows(),[&](const int i) + { + GV.row(i).array() *= (max_corner-min_corner).array(); + GV.row(i) += min_corner; + Gf(i) = f(GV.row(i)); + },1000ul); + const auto t_grid = tictoc(); + igl::marching_cubes(Gf,GV,nx,ny,nz,0,mcV,mcF); + const auto t_mc = tictoc(); + printf(" %5f secs (%5f + %5f) marching cubes\n",t_grid+t_mc,t_grid,t_mc); + } + } + + // Crisp (as possible) rendering of resulting MC triangle mesh + igl::per_corner_normals(mcV,mcF,20,mcN); + // Crisp rendering of resulting DC quad mesh with edges + Eigen::MatrixXi E; + Eigen::MatrixXd VV,N,NN; + Eigen::VectorXi J; + Eigen::MatrixXi FF; + if(triangles) + { + VV = V; + FF = Q; + E.resize(Q.rows()*3,2); + E<< + Q.col(0), Q.col(1), + Q.col(1), Q.col(2), + Q.col(2), Q.col(0); + }else + { + Eigen::VectorXi I,C; + igl::polygon_corners(Q,I,C); + E.resize(Q.rows()*4,2); + E<< + Q.col(0), Q.col(1), + Q.col(1), Q.col(2), + Q.col(2), Q.col(3), + Q.col(3), Q.col(0); + igl::per_face_normals(V,I,C,N,VV,FF,J); + igl::slice(N,J,1,NN); + igl::per_corner_normals(V,I,C,20,N,VV,FF,J,NN); + } + + igl::opengl::glfw::Viewer vr; + bool show_edges = true; + bool use_dc = true; + const auto update = [&]() + { + const bool was_face_based = vr.data().face_based ; + vr.data().clear(); + if(use_dc) + { + vr.data().set_mesh(VV,FF); + vr.data().show_lines = false; + vr.data().set_normals(NN); + if(show_edges) + { + vr.data().clear_edges(); + vr.data().set_edges(V,E,Eigen::RowVector3d(0,0,0)); + } + }else + { + vr.data().set_mesh(mcV,mcF); + vr.data().set_normals(mcN); + vr.data().show_lines = show_edges; + } + vr.data().face_based = was_face_based; + }; + update(); + vr.data().face_based = true; + vr.callback_key_pressed = [&](decltype(vr) &,unsigned int key, int mod) + { + switch(key) + { + case ' ': use_dc=!use_dc; update();return true; + case 'L': case 'l': show_edges=!show_edges; update();return true; + } + return false; + }; + std::cout< +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void set_colormap(igl::opengl::glfw::Viewer & viewer) +{ + const int num_intervals = 30; + Eigen::MatrixXd CM(num_intervals,3); + // Colormap texture + for(int i = 0;i1?argv[1]: TUTORIAL_SHARED_PATH "/beetle.off",V,F); + + // Precomputation + igl::HeatGeodesicsData data; + double t = std::pow(igl::avg_edge_length(V,F),2); + const auto precompute = [&]() + { + if(!igl::heat_geodesics_precompute(V,F,t,data)) + { + std::cerr<<"Error: heat_geodesics_precompute failed."<bool + { + int fid; + Eigen::Vector3f bc; + // Cast a ray in the view direction starting from the mouse position + double x = viewer.current_mouse_x; + double y = viewer.core().viewport(3) - viewer.current_mouse_y; + if(igl::unproject_onto_mesh(Eigen::Vector2f(x,y), viewer.core().view, + viewer.core().proj, viewer.core().viewport, V, F, fid, bc)) + { + Eigen::VectorXd D; + // if big mesh, just use closest vertex. Otherwise, blend distances to + // vertices of face using barycentric coordinates. + if(F.rows()>100000) + { + // 3d position of hit + const Eigen::RowVector3d m3 = + V.row(F(fid,0))*bc(0) + V.row(F(fid,1))*bc(1) + V.row(F(fid,2))*bc(2); + int cid = 0; + Eigen::Vector3d( + (V.row(F(fid,0))-m3).squaredNorm(), + (V.row(F(fid,1))-m3).squaredNorm(), + (V.row(F(fid,2))-m3).squaredNorm()).minCoeff(&cid); + const int vid = F(fid,cid); + igl::heat_geodesics_solve(data,(Eigen::VectorXi(1,1)<bool + { + if(update()) + { + down_on_mesh = true; + return true; + } + return false; + }; + viewer.callback_mouse_move = + [&](igl::opengl::glfw::Viewer& viewer, int, int)->bool + { + if(down_on_mesh) + { + update(); + return true; + } + return false; + }; + viewer.callback_mouse_up = + [&down_on_mesh](igl::opengl::glfw::Viewer& viewer, int, int)->bool + { + down_on_mesh = false; + return false; + }; + std::cout<bool + { + switch(key) + { + default: + return false; + case 'D': + case 'd': + data.use_intrinsic_delaunay = !data.use_intrinsic_delaunay; + std::cout<<(data.use_intrinsic_delaunay?"":"not ")<< + "using intrinsic delaunay..."< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + const auto time = [](std::function func)->double + { + const double t_before = igl::get_seconds(); + func(); + const double t_after = igl::get_seconds(); + return t_after-t_before; + }; + + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh(argc>1?argv[1]:TUTORIAL_SHARED_PATH "/bunny.off",V,F); + // Sample mesh for point cloud + Eigen::MatrixXd P,N; + { + Eigen::VectorXi I; + Eigen::SparseMatrix B; + igl::random_points_on_mesh(10000,V,F,B,I); + P = B*V; + Eigen::MatrixXd FN; + igl::per_face_normals(V,F,FN); + N.resize(P.rows(),3); + for(int p = 0;p > O_PI; + Eigen::MatrixXi O_CH; + Eigen::MatrixXd O_CN; + Eigen::VectorXd O_W; + igl::octree(P,O_PI,O_CH,O_CN,O_W); + Eigen::VectorXd A; + { + Eigen::MatrixXi I; + igl::knn(P,20,O_PI,O_CH,O_CN,O_W,I); + // CGAL is only used to help get point areas + igl::copyleft::cgal::point_areas(P,I,N,A); + } + + if(argc<=1) + { + // corrupt mesh + Eigen::MatrixXd BC; + igl::barycenter(V,F,BC); + Eigen::MatrixXd OV = V; + V.resize(F.rows()*3,3); + for(int f = 0;f (rand()) / static_cast (RAND_MAX), + Eigen::Vector3d::Random(3,1)); + V.row(v) = (OV.row(F(f,c))-BC.row(f))*R.matrix()+BC.row(f); + F(f,c) = v; + } + } + } + + // Generate a list of random query points in the bounding box + Eigen::MatrixXd Q = Eigen::MatrixXd::Random(1000000,3); + const Eigen::RowVector3d Vmin = V.colwise().minCoeff(); + const Eigen::RowVector3d Vmax = V.colwise().maxCoeff(); + const Eigen::RowVector3d Vdiag = Vmax-Vmin; + for(int q = 0;q0.5).eval(),1,QiP); + } + + // Positions of points inside of triangle soup (V,F) + Eigen::MatrixXd QiV; + { + igl::FastWindingNumberBVH fwn_bvh; + printf("triangle soup precomputation (% 8ld triangles): %g secs\n", + F.rows(), + time([&](){igl::fast_winding_number(V.cast().eval(),F,2,fwn_bvh);})); + Eigen::VectorXf WiV; + printf(" triangle soup evaluation (% 8ld queries): %g secs\n", + Q.rows(), + time([&](){igl::fast_winding_number(fwn_bvh,2,Q.cast().eval(),WiV);})); + igl::slice_mask(Q,WiV.array()>0.5,1,QiV); + } + + + // Visualization + igl::opengl::glfw::Viewer viewer; + // For dislpaying normals as little line segments + Eigen::MatrixXd PN(2*P.rows(),3); + Eigen::MatrixXi E(P.rows(),2); + const double bbd = igl::bounding_box_diagonal(V); + for(int p = 0;p +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char * argv[]) +{ + Eigen::MatrixXd OVX,VX,VY; + Eigen::MatrixXi FX,FY; + igl::read_triangle_mesh( argc>1?argv[1]: TUTORIAL_SHARED_PATH "/decimated-max.obj",VY,FY); + const double bbd = (VY.colwise().maxCoeff()-VY.colwise().minCoeff()).norm(); + FX = FY; + { + // sprinkle a noise so that we can see z-fighting when the match is perfect. + const double h = igl::avg_edge_length(VY,FY); + OVX = VY + 1e-2*h*Eigen::MatrixXd::Random(VY.rows(),VY.cols()); + } + + VX = OVX; + + igl::AABB Ytree; + Ytree.init(VY,FY); + Eigen::MatrixXd NY; + igl::per_face_normals(VY,FY,NY); + + igl::opengl::glfw::Viewer v; + std::cout<bool + { + if(v.core().is_animating) + { + single_iteration(); + } + return false; + }; + v.callback_key_pressed = + [&](igl::opengl::glfw::Viewer &,unsigned char key,int)->bool + { + switch(key) + { + case ' ': + { + v.core().is_animating = false; + single_iteration(); + return true; + } + case 'R': + case 'r': + // Random rigid transformation + apply_random_rotation(); + v.data().set_mesh(VX,FX); + v.data().compute_normals(); + return true; + break; + } + return false; + }; + + v.data().set_mesh(VY,FY); + v.data().set_colors(Eigen::RowVector3d(1,1,1)); + v.data().show_lines = false; + v.append_mesh(); + v.data().set_mesh(VX,FX); + v.data().show_lines = false; + v.launch(); +} diff --git a/vendor/libigl/tutorial/719_ExplodedView/main.cpp b/vendor/libigl/tutorial/719_ExplodedView/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8a00d9f4af3e655efc7647559083a041379bfa9d --- /dev/null +++ b/vendor/libigl/tutorial/719_ExplodedView/main.cpp @@ -0,0 +1,99 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char *argv[]) +{ + + Eigen::MatrixXd V; + Eigen::MatrixXi T,F; + igl::readMESH(argc>1?argv[1]: TUTORIAL_SHARED_PATH "/octopus-low.mesh",V,T,F); + // Some per-tet data + Eigen::VectorXd D; + { + Eigen::MatrixXd BC; + igl::barycenter(V,T,BC); + Eigen::VectorXd vol; + igl::volume(V,T,vol); + const Eigen::RowVectorXd c = vol.transpose()*BC/vol.array().sum(); + D = (BC.rowwise()-c).rowwise().norm(); + } + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + + double t = 1; + double s = 1; + const auto update = [&]() + { + Eigen::MatrixXd EV; + Eigen::MatrixXi EF; + Eigen::VectorXi I,J; + igl::exploded_view(V,T,s,t,EV,EF,I,J); + Eigen::VectorXd DJ; + igl::slice(D,J,1,DJ); + static bool first = true; + if(first) + { + viewer.data().clear(); + viewer.data().set_mesh(EV,EF); + first = false; + }else + { + viewer.data().set_vertices(EV); + } + viewer.data().set_face_based(true); + Eigen::MatrixXd C; + igl::colormap(igl::COLOR_MAP_TYPE_VIRIDIS,DJ,true,C); + viewer.data().set_colors(C); + }; + int mod = 0; + float prev_y; + viewer.callback_mouse_move = [&](igl::opengl::glfw::Viewer &, int x, int y)->bool + { + if((mod & IGL_MOD_SHIFT)||(mod & IGL_MOD_ALT)) + { + if(mod & IGL_MOD_SHIFT) + { + t = std::min(std::max(t+0.001*(y-prev_y),1.),2.); + } + if(mod & IGL_MOD_ALT) + { + s = std::min(std::max(s+0.001*(y-prev_y),0.),1.); + } + prev_y = y; + update(); + return true; + } + return false; + }; + // get modifier + viewer.callback_key_down = + [&](igl::opengl::glfw::Viewer &, unsigned char key, int _mod)->bool + { + prev_y = viewer.current_mouse_y; + mod = _mod; + return false; + }; + viewer.callback_key_up = + [&](igl::opengl::glfw::Viewer &, unsigned char key, int _mod)->bool + { + mod = _mod; + return false; + }; + update(); + viewer.launch(); +} diff --git a/vendor/libigl/tutorial/720_BlueNoise/main.cpp b/vendor/libigl/tutorial/720_BlueNoise/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e27d57203cf5ae7c43e7955948665accea70f80c --- /dev/null +++ b/vendor/libigl/tutorial/720_BlueNoise/main.cpp @@ -0,0 +1,108 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2020 Alec Jacobson +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char *argv[]) +{ + + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::read_triangle_mesh( + argc>1?argv[1]: TUTORIAL_SHARED_PATH "/elephant.obj",V,F); + Eigen::MatrixXd N; + igl::per_vertex_normals(V,F,N); + const double bbd = (V.colwise().maxCoeff()- V.colwise().minCoeff()).norm(); + + Eigen::MatrixXd P_blue; + Eigen::MatrixXd N_blue; + Eigen::VectorXd A_blue; + Eigen::MatrixXd C_blue; + { + const int n_desired = argc>2?atoi(argv[2]):50000; + // Heuristic to determine radius from desired number + const double r = [&V,&F](const int n) + { + Eigen::VectorXd A; + igl::doublearea(V,F,A); + return sqrt(((A.sum()*0.5/(n*0.6162910373))/igl::PI)); + }(n_desired); + printf("blue noise radius: %g\n",r); + Eigen::MatrixXd B; + Eigen::VectorXi I; + igl::blue_noise(V,F,r,B,I,P_blue); + igl::barycentric_interpolation(N,F,B,I,N_blue); + N_blue.rowwise().normalize(); + } + Eigen::MatrixXd P_white; + Eigen::MatrixXd N_white; + Eigen::VectorXd A_white; + Eigen::MatrixXd C_white; + { + Eigen::MatrixXd B; + Eigen::VectorXi I; + igl::random_points_on_mesh(P_blue.rows(),V,F,B,I,P_white); + igl::barycentric_interpolation(N,F,B,I,N_white); + N_white.rowwise().normalize(); + } + + // Color + Eigen::RowVector3d C(1,1,1); + + // Plot the mesh + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V,F); + viewer.data().show_lines = false; + viewer.data().show_faces = false; + viewer.data().point_size = 4; + + bool use_blue = true; + const auto update = [&]() + { + const Eigen::RowVector3d orange(1.0,0.7,0.2); + if(use_blue) + { + viewer.data().set_points(P_blue,Eigen::RowVector3d(0.3,0.4,1.0)); + viewer.data().set_edges_from_vector_field(P_blue,bbd*0.01*N_blue,orange); + }else + { + viewer.data().set_points(P_white,Eigen::RowVector3d(1,1,1)); + viewer.data().set_edges_from_vector_field(P_white,bbd*0.01*N_white,orange); + } + }; + update(); + + viewer.callback_key_pressed = + [&](igl::opengl::glfw::Viewer &,unsigned char key,int)->bool + { + switch(key) + { + case ' ': + { + use_blue = !use_blue; + update(); + return true; + } + } + return false; + }; + std::cout< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + + +int main(int argc, char * argv[]) +{ + typedef Eigen::SparseMatrix SparseMat; + + //Constants used for smoothing + const double howMuchToSmoothBy = 1e-1; + const int howManySmoothingInterations = 50; + + //Read our mesh + Eigen::MatrixXd V; + Eigen::MatrixXi F; + if(!igl::read_triangle_mesh + (argc>1?argv[1]: TUTORIAL_SHARED_PATH "/elephant.obj",V,F)) { + std::cout << "Failed to load mesh." << std::endl; + } + + //Orient edges for plotting + Eigen::MatrixXi E, oE; + igl::orient_halfedges(F, E, oE); + + //Compute edge midpoints & edge vectors + Eigen::MatrixXd edgeMps, parVec, perpVec; + igl::edge_midpoints(V, F, E, oE, edgeMps); + igl::edge_vectors(V, F, E, oE, parVec, perpVec); + + //Constructing a function to add noise to + const auto zraw_function = [] (const Eigen::Vector3d& x) { + return Eigen::Vector3d(0.2*x(1) + cos(2*x(1)+0.2), + 0.5*x(0) + 0.15, + 0.3*cos(0.2+igl::PI*x(2))); + }; + + Eigen::VectorXd zraw(2*edgeMps.rows()); + for(int i=0; i rhsSolver(M + howMuchToSmoothBy*L); + zsmoothed = rhsSolver.solve(M*zsmoothed); + } + + //Convert vector fields for plotting + const auto cr_result_to_vecs_and_colors = [&] + (const Eigen::VectorXd& z, Eigen::MatrixXd& vecs, Eigen::MatrixXd& colors) { + vecs.resize(edgeMps.rows(), 3); + for(int i=0; ibool + { + const Eigen::MatrixXd *vecs, *colors; + switch(key) { + case '1': + vecs = &rawvecs; + colors = &rawcolors; + break; + case '2': + vecs = &noisyvecs; + colors = &noisycolors; + break; + case '3': + vecs = &smoothedvecs; + colors = &smoothedcolors; + break; + default: + return false; + } + viewer.data().set_data(*colors); + viewer.data().clear_edges(); + const double s = 0.08; //How much to scale vectors during plotting + viewer.data().add_edges(edgeMps, edgeMps + s*(*vecs), + Eigen::RowVector3d(0.1, 0.1, 0.1)); + return true; + }; + std::cout << R"(Usage: +1 Show raw function +2 Show noisy function +3 Show smoothed function + +)"; + Eigen::MatrixXd CM; + igl::parula(Eigen::VectorXd::LinSpaced + (500,znoisy.minCoeff(), znoisy.maxCoeff()).eval(), true, CM); + viewer.data().set_colormap(CM); + viewer.callback_key_down(viewer, '1', 0); + viewer.launch(); + + return 0; +} diff --git a/vendor/libigl/tutorial/722_VectorParallelTransport/main.cpp b/vendor/libigl/tutorial/722_VectorParallelTransport/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..03fecccd285e0bcdceac923889968e88e6ec695d --- /dev/null +++ b/vendor/libigl/tutorial/722_VectorParallelTransport/main.cpp @@ -0,0 +1,147 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + + +int main(int argc, char * argv[]) +{ + typedef Eigen::SparseMatrix SparseMat; + typedef Eigen::Matrix Vector1d; + typedef Eigen::Matrix Vector1i; + + //Constants used for smoothing + const double howMuchToSmoothBy = 1e-1; + const int howManySmoothingInterations = 50; + + //Read our mesh + Eigen::MatrixXd V; + Eigen::MatrixXi F; + if(!igl::read_triangle_mesh + (argc>1?argv[1]: TUTORIAL_SHARED_PATH "/cheburashka.off",V,F)) { + std::cout << "Failed to load mesh." << std::endl; + } + + //Compute vector Laplacian and mass matrix + Eigen::MatrixXi E, oE;//Compute Laplacian and mass matrix + SparseMat vecL, vecM; + igl::cr_vector_mass(V, F, E, oE, vecM); + igl::cr_vector_laplacian(V, F, E, oE, vecL); + const int m = vecL.rows()/2; //The number of edges in the mesh + + //Convert the E / oE matrix format to list of edges / EMAP format required + // by the functions constructing scalar Crouzeix-Raviart functions + Eigen::MatrixXi Elist(m,2), EMAP(3*F.rows(),1); + for(int i=0; i0) { + Elist.row(e) << F(i, (j+1)%3), F(i, (j+2)%3); + } + } + } + SparseMat scalarL, scalarM; + igl::crouzeix_raviart_massmatrix(V, F, Elist, EMAP, scalarM); + igl::crouzeix_raviart_cotmatrix(V, F, Elist, EMAP, scalarL); + + //Compute edge midpoints & edge vectors + Eigen::MatrixXd edgeMps, parVec, perpVec; + igl::edge_midpoints(V, F, E, oE, edgeMps); + igl::edge_vectors(V, F, E, oE, parVec, perpVec); + + //Perform the vector heat method + const int initialIndex = 14319; + const double initialPara=0.95, initialPerp=0.08; + const double t = 0.01; + + SparseMat Aeq; + Eigen::VectorXd Beq; + Eigen::VectorXi known = Eigen::Vector2i(initialIndex, initialIndex+m); + Eigen::VectorXd knownVals = Eigen::Vector2d(initialPara, initialPerp); + Eigen::VectorXd Y0 = Eigen::VectorXd::Zero(2*m), Yt; + Y0(initialIndex) = initialPara; Y0(initialIndex+m) = initialPerp; + igl::min_quad_with_fixed + (SparseMat(vecM+t*vecL), Eigen::VectorXd(-vecM*Y0), known, knownVals, + Aeq, Beq, false, Yt); + + Eigen::VectorXd u0 = Eigen::VectorXd::Zero(m), ut; + u0(initialIndex) = sqrt(initialPara*initialPara + initialPerp*initialPerp); + Eigen::VectorXi knownScal = Vector1i(initialIndex); + Eigen::VectorXd knownScalVals = Vector1d(u0(initialIndex)); + igl::min_quad_with_fixed + (SparseMat(scalarM+t*scalarL), Eigen::VectorXd(-scalarM*u0), knownScal, + knownScalVals, Aeq, Beq, false, ut); + + Eigen::VectorXd phi0 = Eigen::VectorXd::Zero(m), phit; + phi0(initialIndex) = 1; + Eigen::VectorXd knownScalValsPhi = Vector1d(1); + igl::min_quad_with_fixed + (SparseMat(scalarM+t*scalarL), Eigen::VectorXd(-scalarM*phi0), knownScal, + knownScalValsPhi, Aeq, Beq, false, phit); + + Eigen::ArrayXd Xtfactor = ut.array() / + (phit.array() * (Yt.array().segment(0,m)*Yt.array().segment(0,m) + + Yt.array().segment(m,m)*Yt.array().segment(m,m)).sqrt()); + Eigen::VectorXd Xt(2*m); + Xt.segment(0,m) = Xtfactor * Yt.segment(0,m).array(); + Xt.segment(m,m) = Xtfactor * Yt.segment(m,m).array(); + + + //Compute scalar heat colors + igl::HeatGeodesicsData hgData; + igl::heat_geodesics_precompute(V, F, hgData); + Eigen::VectorXd heatColor; + Eigen::VectorXi gamma = Elist.row(initialIndex); + igl::heat_geodesics_solve(hgData, gamma, heatColor); + + + //Convert vector field for plotting + Eigen::MatrixXd vecs(m, 3); + for(int i=0; i